@uxf/e2e 11.12.1 → 11.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/components.d.ts +22 -0
  2. package/components.js +22 -0
  3. package/package.json +1 -1
  4. package/tests/checkbox-button.e2e.d.ts +1 -0
  5. package/tests/checkbox-button.e2e.js +18 -0
  6. package/tests/checkbox-input.e2e.d.ts +1 -0
  7. package/tests/checkbox-input.e2e.js +21 -0
  8. package/tests/combobox.e2e.d.ts +1 -0
  9. package/tests/combobox.e2e.js +20 -0
  10. package/tests/date-picker-input.e2e.d.ts +1 -0
  11. package/tests/date-picker-input.e2e.js +27 -0
  12. package/tests/date-time-picker-input.e2e.d.ts +1 -0
  13. package/tests/date-time-picker-input.e2e.js +26 -0
  14. package/tests/dropzone.e2e.d.ts +1 -0
  15. package/tests/dropzone.e2e.js +15 -0
  16. package/tests/message.e2e.d.ts +1 -0
  17. package/tests/message.e2e.js +24 -0
  18. package/tests/modal.e2e.d.ts +1 -0
  19. package/tests/modal.e2e.js +22 -0
  20. package/tests/multi-combobox.e2e.d.ts +1 -0
  21. package/tests/multi-combobox.e2e.js +20 -0
  22. package/tests/radio-group.e2e.d.ts +1 -0
  23. package/tests/radio-group.e2e.js +16 -0
  24. package/tests/select.e2e.js +1 -1
  25. package/tests/text-link.e2e.d.ts +1 -0
  26. package/tests/text-link.e2e.js +16 -0
  27. package/ui/checkbox-button.d.ts +11 -0
  28. package/ui/checkbox-button.js +23 -0
  29. package/ui/checkbox-input.d.ts +12 -0
  30. package/ui/checkbox-input.js +29 -0
  31. package/ui/combobox.d.ts +14 -0
  32. package/ui/combobox.js +38 -0
  33. package/ui/date-picker-input.d.ts +15 -0
  34. package/ui/date-picker-input.js +37 -0
  35. package/ui/datetime-picker-input.d.ts +15 -0
  36. package/ui/datetime-picker-input.js +37 -0
  37. package/ui/dropzone.d.ts +17 -0
  38. package/ui/dropzone.js +26 -0
  39. package/ui/message.d.ts +5 -0
  40. package/ui/message.js +17 -0
  41. package/ui/modal.d.ts +5 -0
  42. package/ui/modal.js +17 -0
  43. package/ui/multi-combobox.d.ts +13 -0
  44. package/ui/multi-combobox.js +33 -0
  45. package/ui/radio-group.d.ts +10 -0
  46. package/ui/radio-group.js +30 -0
  47. package/ui/select.d.ts +1 -1
  48. package/ui/select.js +2 -1
  49. package/ui/text-link.d.ts +11 -0
  50. package/ui/text-link.js +24 -0
package/components.d.ts CHANGED
@@ -1,9 +1,20 @@
1
1
  import { button } from "./ui/button";
2
2
  import { buttonGroup } from "./ui/button-group";
3
3
  import { buttonList } from "./ui/button-list";
4
+ import { checkboxButton } from "./ui/checkbox-button";
5
+ import { checkboxInput } from "./ui/checkbox-input";
6
+ import { combobox } from "./ui/combobox";
7
+ import { datePickerInput } from "./ui/date-picker-input";
8
+ import { datetimePickerInput } from "./ui/datetime-picker-input";
9
+ import { dropzone } from "./ui/dropzone";
4
10
  import { input } from "./ui/input";
11
+ import { message } from "./ui/message";
12
+ import { modal } from "./ui/modal";
13
+ import { multiCombobox } from "./ui/multi-combobox";
14
+ import { radioGroup } from "./ui/radio-group";
5
15
  import { select } from "./ui/select";
6
16
  import { textInput } from "./ui/text-input";
17
+ import { textLink } from "./ui/text-link";
7
18
  export declare const components: {
8
19
  button: typeof button;
9
20
  buttonGroup: typeof buttonGroup;
@@ -11,4 +22,15 @@ export declare const components: {
11
22
  input: typeof input;
12
23
  select: typeof select;
13
24
  textInput: typeof textInput;
25
+ combobox: typeof combobox;
26
+ multiCombobox: typeof multiCombobox;
27
+ checkboxInput: typeof checkboxInput;
28
+ checkboxButton: typeof checkboxButton;
29
+ datePickerInput: typeof datePickerInput;
30
+ datetimePickerInput: typeof datetimePickerInput;
31
+ modal: typeof modal;
32
+ message: typeof message;
33
+ radioGroup: typeof radioGroup;
34
+ textLink: typeof textLink;
35
+ dropzone: typeof dropzone;
14
36
  };
package/components.js CHANGED
@@ -4,9 +4,20 @@ exports.components = void 0;
4
4
  const button_1 = require("./ui/button");
5
5
  const button_group_1 = require("./ui/button-group");
6
6
  const button_list_1 = require("./ui/button-list");
7
+ const checkbox_button_1 = require("./ui/checkbox-button");
8
+ const checkbox_input_1 = require("./ui/checkbox-input");
9
+ const combobox_1 = require("./ui/combobox");
10
+ const date_picker_input_1 = require("./ui/date-picker-input");
11
+ const datetime_picker_input_1 = require("./ui/datetime-picker-input");
12
+ const dropzone_1 = require("./ui/dropzone");
7
13
  const input_1 = require("./ui/input");
14
+ const message_1 = require("./ui/message");
15
+ const modal_1 = require("./ui/modal");
16
+ const multi_combobox_1 = require("./ui/multi-combobox");
17
+ const radio_group_1 = require("./ui/radio-group");
8
18
  const select_1 = require("./ui/select");
9
19
  const text_input_1 = require("./ui/text-input");
20
+ const text_link_1 = require("./ui/text-link");
10
21
  exports.components = {
11
22
  button: button_1.button,
12
23
  buttonGroup: button_group_1.buttonGroup,
@@ -14,4 +25,15 @@ exports.components = {
14
25
  input: input_1.input,
15
26
  select: select_1.select,
16
27
  textInput: text_input_1.textInput,
28
+ combobox: combobox_1.combobox,
29
+ multiCombobox: multi_combobox_1.multiCombobox,
30
+ checkboxInput: checkbox_input_1.checkboxInput,
31
+ checkboxButton: checkbox_button_1.checkboxButton,
32
+ datePickerInput: date_picker_input_1.datePickerInput,
33
+ datetimePickerInput: datetime_picker_input_1.datetimePickerInput,
34
+ modal: modal_1.modal,
35
+ message: message_1.message,
36
+ radioGroup: radio_group_1.radioGroup,
37
+ textLink: text_link_1.textLink,
38
+ dropzone: dropzone_1.dropzone,
17
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/e2e",
3
- "version": "11.12.1",
3
+ "version": "11.15.0",
4
4
  "description": "UXF TestCafe helpers",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const testcafe_1 = require("testcafe");
4
+ const components_1 = require("../components");
5
+ const wait_for_react_1 = require("../utils/wait-for-react");
6
+ (0, testcafe_1.fixture)("Checkbox button")
7
+ .page("https://fe.uxf.dev/examples/ui/checkbox-button/Default")
8
+ .httpAuth({ username: "uxf", password: "uxf" })
9
+ .beforeEach(async (t) => {
10
+ await (0, wait_for_react_1.waitForReact)(10000, t);
11
+ });
12
+ (0, testcafe_1.test)("Checkbox button", async () => {
13
+ const defaultCheckboxButton = components_1.components.checkboxButton({ buttonText: "Opravdu?" });
14
+ await defaultCheckboxButton.shouldExist();
15
+ await defaultCheckboxButton.shouldBeChecked();
16
+ await defaultCheckboxButton.click();
17
+ await defaultCheckboxButton.shouldNotBeChecked();
18
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const testcafe_1 = require("testcafe");
4
+ const components_1 = require("../components");
5
+ const wait_for_react_1 = require("../utils/wait-for-react");
6
+ (0, testcafe_1.fixture)("Checkbox input")
7
+ .page("https://fe.uxf.dev/examples/ui/checkbox-input/Default")
8
+ .httpAuth({ username: "uxf", password: "uxf" })
9
+ .beforeEach(async (t) => {
10
+ await (0, wait_for_react_1.waitForReact)(10000, t);
11
+ });
12
+ (0, testcafe_1.test)("Checkbox input", async () => {
13
+ const defaultCheckboxInput = components_1.components.checkboxInput({ dataName: "checkbox-input" });
14
+ await defaultCheckboxInput.shouldExist();
15
+ await defaultCheckboxInput.shouldBeChecked();
16
+ await defaultCheckboxInput.click();
17
+ await defaultCheckboxInput.shouldNotBeChecked();
18
+ await components_1.components.checkboxInput({ dataName: "checkbox-input-disabled" }).shouldBeDisabled();
19
+ await components_1.components.checkboxInput({ dataName: "checkbox-input-disabled" }).click();
20
+ await components_1.components.checkboxInput({ dataName: "checkbox-input-disabled" }).shouldNotBeChecked();
21
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const testcafe_1 = require("testcafe");
4
+ const components_1 = require("../components");
5
+ const wait_for_react_1 = require("../utils/wait-for-react");
6
+ (0, testcafe_1.fixture)("Combobox")
7
+ .page("https://fe.uxf.dev/examples/ui/combobox/Default")
8
+ .httpAuth({ username: "uxf", password: "uxf" })
9
+ .beforeEach(async (t) => {
10
+ await (0, wait_for_react_1.waitForReact)(10000, t);
11
+ });
12
+ (0, testcafe_1.test)("Combobox", async () => {
13
+ const defaultCombobox = components_1.components.combobox({ dataName: "combobox" });
14
+ await defaultCombobox.shouldExist();
15
+ await defaultCombobox.shouldBeEmpty();
16
+ await defaultCombobox.selectItemWithTextFromDropdown("Option one");
17
+ await defaultCombobox.shouldHaveValue("Option one");
18
+ await components_1.components.combobox({ dataName: "combobox", nth: 1 }).replace("Option three");
19
+ await components_1.components.combobox({ dataName: "combobox", nth: 1 }).shouldHaveValue("Option three");
20
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const testcafe_1 = require("testcafe");
4
+ const components_1 = require("../components");
5
+ const wait_for_react_1 = require("../utils/wait-for-react");
6
+ (0, testcafe_1.fixture)("Date picker input")
7
+ .page("https://fe.uxf.dev/examples/ui/date-picker-input/Default")
8
+ .httpAuth({ username: "uxf", password: "uxf" })
9
+ .beforeEach(async (t) => {
10
+ await (0, wait_for_react_1.waitForReact)(10000, t);
11
+ });
12
+ (0, testcafe_1.test)("Date picker input", async () => {
13
+ const defaultDatePickerInput = components_1.components.datePickerInput({ dataName: "date" });
14
+ await defaultDatePickerInput.shouldBeEmpty();
15
+ await defaultDatePickerInput.shouldNotBeDisabled();
16
+ await defaultDatePickerInput.selectDate(1, 1, 2024);
17
+ await defaultDatePickerInput.shouldHaveValue("1. 1. 2024");
18
+ await defaultDatePickerInput.replace("05.12.2025");
19
+ await defaultDatePickerInput.shouldHaveValue("5. 12. 2025");
20
+ //do disabled se nedá psát
21
+ await components_1.components.datePickerInput({ dataName: "date-disabled" }).shouldBeDisabled();
22
+ await components_1.components.datePickerInput({ dataName: "date-disabled" }).selectDate(8, 1, 2024);
23
+ await components_1.components.datePickerInput({ dataName: "date-disabled" }).shouldHaveValue("5. 12. 2025");
24
+ await components_1.components.datePickerInput({ dataName: "date-invalid" }).shouldBeInvalid();
25
+ await defaultDatePickerInput.clear();
26
+ await defaultDatePickerInput.shouldBeEmpty();
27
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const testcafe_1 = require("testcafe");
4
+ const components_1 = require("../components");
5
+ const wait_for_react_1 = require("../utils/wait-for-react");
6
+ (0, testcafe_1.fixture)("Datetime picker input")
7
+ .page("https://fe.uxf.dev/examples/ui/datetime-picker-input/Default")
8
+ .httpAuth({ username: "uxf", password: "uxf" })
9
+ .beforeEach(async (t) => {
10
+ await (0, wait_for_react_1.waitForReact)(10000, t);
11
+ });
12
+ (0, testcafe_1.test)("Datetime picker input", async () => {
13
+ const defaultDatetimePickerInput = components_1.components.datetimePickerInput({ dataName: "date" });
14
+ await defaultDatetimePickerInput.shouldNotBeDisabled();
15
+ await defaultDatetimePickerInput.selectDatetime(1, 1, 2024, 12, 45);
16
+ await defaultDatetimePickerInput.shouldHaveValue("1. 1. 2024 12:45");
17
+ await defaultDatetimePickerInput.replace(5, 12, 2025, 13, 5);
18
+ await defaultDatetimePickerInput.shouldHaveValue("5. 12. 2025 13:05");
19
+ //do disabled se nedá psát
20
+ await components_1.components.datetimePickerInput({ dataName: "date-disabled" }).shouldBeDisabled();
21
+ await components_1.components.datetimePickerInput({ dataName: "date-disabled" }).replace(8, 1, 2024, 14, 5);
22
+ await components_1.components.datetimePickerInput({ dataName: "date-disabled" }).shouldHaveValue("5. 12. 2025 13:05");
23
+ await components_1.components.datetimePickerInput({ dataName: "date-invalid" }).shouldBeInvalid();
24
+ await defaultDatetimePickerInput.clear();
25
+ await defaultDatetimePickerInput.shouldBeEmpty();
26
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const testcafe_1 = require("testcafe");
4
+ const components_1 = require("../components");
5
+ const wait_for_react_1 = require("../utils/wait-for-react");
6
+ (0, testcafe_1.fixture)("Dropzone")
7
+ .page("https://fe.uxf.dev/examples/ui/dropzone/Default")
8
+ .httpAuth({ username: "uxf", password: "uxf" })
9
+ .beforeEach(async (t) => {
10
+ await (0, wait_for_react_1.waitForReact)(10000, t);
11
+ });
12
+ (0, testcafe_1.test)("Dropzone", async () => {
13
+ const defaultDropzone = components_1.components.dropzone({ name: "dropzone-disabled-drag-and-drop" });
14
+ await defaultDropzone.uploadFiles(["./Jpg-test.jpg"]);
15
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const testcafe_1 = require("testcafe");
4
+ const components_1 = require("../components");
5
+ const wait_for_react_1 = require("../utils/wait-for-react");
6
+ (0, testcafe_1.fixture)("Message")
7
+ .page("https://fe.uxf.dev/examples/ui/message/Default")
8
+ .httpAuth({ username: "uxf", password: "uxf" })
9
+ .beforeEach(async (t) => {
10
+ await (0, wait_for_react_1.waitForReact)(10000, t);
11
+ });
12
+ (0, testcafe_1.test)("UI Message", async () => {
13
+ await components_1.components.button({ text: "Click to open centered default confirm" }).click();
14
+ await components_1.components.message({}).shouldExist();
15
+ await components_1.components.button({ text: "Zrušit" }).shouldExists();
16
+ await components_1.components.button({ text: "Potvrdit" }).shouldExists();
17
+ await components_1.components.button({ text: "Potvrdit" }).click();
18
+ await components_1.components.message({}).shouldNotExist();
19
+ //message nejde zavřít klikem mimo
20
+ await components_1.components.button({ text: "Click to open centered default confirm" }).click();
21
+ await components_1.components.modal({}).shouldExist();
22
+ await components_1.components.button({ text: "Click to open centered default confirm" }).click();
23
+ await components_1.components.modal({}).shouldExist();
24
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const testcafe_1 = require("testcafe");
4
+ const components_1 = require("../components");
5
+ const wait_for_react_1 = require("../utils/wait-for-react");
6
+ (0, testcafe_1.fixture)("Modal")
7
+ .page("https://fe.uxf.dev/examples/ui/modal/Default")
8
+ .httpAuth({ username: "uxf", password: "uxf" })
9
+ .beforeEach(async (t) => {
10
+ await (0, wait_for_react_1.waitForReact)(10000, t);
11
+ });
12
+ (0, testcafe_1.test)("UI Modal", async () => {
13
+ await components_1.components.button({ text: "Click to open modal - default" }).click();
14
+ await components_1.components.modal({}).shouldExist();
15
+ await components_1.components.button({ text: "Close modal" }).click();
16
+ await components_1.components.modal({}).shouldNotExist();
17
+ //modal jde zavřít klikem mimo něj
18
+ await components_1.components.button({ text: "Click to open modal - default" }).click();
19
+ await components_1.components.modal({}).shouldExist();
20
+ await components_1.components.button({ text: "Click to open modal - default" }).click();
21
+ await components_1.components.modal({}).shouldNotExist();
22
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const testcafe_1 = require("testcafe");
4
+ const components_1 = require("../components");
5
+ const wait_for_react_1 = require("../utils/wait-for-react");
6
+ (0, testcafe_1.fixture)("Multi combobox")
7
+ .page("https://fe.uxf.dev/examples/ui/multi-combobox/Default")
8
+ .httpAuth({ username: "uxf", password: "uxf" })
9
+ .beforeEach(async (t) => {
10
+ await (0, wait_for_react_1.waitForReact)(10000, t);
11
+ });
12
+ (0, testcafe_1.test)("Multi combobox", async () => {
13
+ //TODO- dodělat, až bude správná classa na všech comboboxech a data-name u všech comboboxů
14
+ const defaultMultiCombobox = components_1.components.multiCombobox({ dataName: "multi-combobox" });
15
+ await defaultMultiCombobox.shouldExist();
16
+ await defaultMultiCombobox.selectItemFromDropdown("Option red");
17
+ await defaultMultiCombobox.replace("Option green");
18
+ await defaultMultiCombobox.selectItemByTypeText("Option four");
19
+ await components_1.components.multiCombobox({ dataName: "multi-combobox-disabled" }).shouldBeDisabled();
20
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const testcafe_1 = require("testcafe");
4
+ const components_1 = require("../components");
5
+ const wait_for_react_1 = require("../utils/wait-for-react");
6
+ (0, testcafe_1.fixture)("Radio Group")
7
+ .page("https://fe.uxf.dev/examples/ui/radio-group/Default")
8
+ .httpAuth({ username: "uxf", password: "uxf" })
9
+ .beforeEach(async (t) => {
10
+ await (0, wait_for_react_1.waitForReact)(10000, t);
11
+ });
12
+ (0, testcafe_1.test)("UI Radio Group", async () => {
13
+ await components_1.components.radioGroup({ id: "radiogroup" }).selectByText("Radio two");
14
+ await components_1.components.radioGroup({ id: "radiogroup" }).shouldBeSelected("Radio two");
15
+ await components_1.components.radioGroup({ id: "radiogroup" }).shouldNotBeSelected("Radio one");
16
+ });
@@ -10,7 +10,7 @@ const wait_for_react_1 = require("../utils/wait-for-react");
10
10
  await (0, wait_for_react_1.waitForReact)(10000, t);
11
11
  });
12
12
  (0, testcafe_1.test)("Select", async () => {
13
- const defaultSelect = components_1.components.select({ name: "default" });
13
+ const defaultSelect = components_1.components.select({ dataName: "select" });
14
14
  await defaultSelect.shouldBeEmpty();
15
15
  await defaultSelect.selectNthItem(2);
16
16
  await defaultSelect.shouldHaveValue("Option three");
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const testcafe_1 = require("testcafe");
4
+ const components_1 = require("../components");
5
+ const wait_for_react_1 = require("../utils/wait-for-react");
6
+ (0, testcafe_1.fixture)("Text Link")
7
+ .page("https://fe.uxf.dev/examples/ui/text-link/Default")
8
+ .httpAuth({ username: "uxf", password: "uxf" })
9
+ .beforeEach(async (t) => {
10
+ await (0, wait_for_react_1.waitForReact)(10000, t);
11
+ });
12
+ (0, testcafe_1.test)("UI Text Link", async () => {
13
+ await components_1.components.textLink({ text: "tímto odkazem" }).shouldExists();
14
+ await components_1.components.textLink({ text: "tímto odkazem" }).click();
15
+ await components_1.components.textLink({ text: "test" }).shouldNotExists();
16
+ });
@@ -0,0 +1,11 @@
1
+ import { BaseFinder } from "../utils/base-finder";
2
+ interface CheckboxButtonFinder extends BaseFinder {
3
+ buttonText: string;
4
+ }
5
+ export declare function checkboxButton(finder: CheckboxButtonFinder): {
6
+ click(): TestControllerPromise<any>;
7
+ shouldBeChecked(): TestControllerPromise<any>;
8
+ shouldNotBeChecked(): TestControllerPromise<any>;
9
+ shouldExist(): TestControllerPromise<any>;
10
+ };
11
+ export {};
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkboxButton = void 0;
4
+ const testcafe_1 = require("testcafe");
5
+ const create_selector_1 = require("../utils/create-selector");
6
+ function checkboxButton(finder) {
7
+ const checkboxButtonSelector = (0, create_selector_1.createSelector)(finder).find(".uxf-checkbox-button").withExactText(finder.buttonText);
8
+ return {
9
+ click() {
10
+ return testcafe_1.t.click(checkboxButtonSelector);
11
+ },
12
+ shouldBeChecked() {
13
+ return testcafe_1.t.expect(checkboxButtonSelector.hasClass("is-selected")).ok();
14
+ },
15
+ shouldNotBeChecked() {
16
+ return testcafe_1.t.expect(checkboxButtonSelector.hasClass("is-selected")).notOk();
17
+ },
18
+ shouldExist() {
19
+ return testcafe_1.t.expect(checkboxButtonSelector.exists).ok();
20
+ },
21
+ };
22
+ }
23
+ exports.checkboxButton = checkboxButton;
@@ -0,0 +1,12 @@
1
+ import { BaseFinder } from "../utils/base-finder";
2
+ interface CheckboxInputFinder extends BaseFinder {
3
+ dataName: string;
4
+ }
5
+ export declare function checkboxInput(finder: CheckboxInputFinder): {
6
+ click(): TestControllerPromise<any>;
7
+ shouldBeChecked(): TestControllerPromise<any>;
8
+ shouldNotBeChecked(): TestControllerPromise<any>;
9
+ shouldExist(): TestControllerPromise<any>;
10
+ shouldBeDisabled(): TestControllerPromise<any>;
11
+ };
12
+ export {};
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkboxInput = void 0;
4
+ const testcafe_1 = require("testcafe");
5
+ const create_selector_1 = require("../utils/create-selector");
6
+ function checkboxInput(finder) {
7
+ //TODO jakmile bude name na správné úrovni, tak udělat s name
8
+ const checkboxInputSelector = (0, create_selector_1.createSelector)(finder)
9
+ .find(".uxf-checkbox-input__wrapper")
10
+ .withAttribute("data-name", finder.dataName);
11
+ return {
12
+ click() {
13
+ return testcafe_1.t.click(checkboxInputSelector);
14
+ },
15
+ shouldBeChecked() {
16
+ return testcafe_1.t.expect(checkboxInputSelector.find(".uxf-checkbox-input").hasClass("is-selected")).ok();
17
+ },
18
+ shouldNotBeChecked() {
19
+ return testcafe_1.t.expect(checkboxInputSelector.find(".uxf-checkbox-input").hasClass("is-selected")).notOk();
20
+ },
21
+ shouldExist() {
22
+ return testcafe_1.t.expect(checkboxInputSelector.exists).ok();
23
+ },
24
+ shouldBeDisabled() {
25
+ return testcafe_1.t.expect(checkboxInputSelector.find(".uxf-checkbox-input").hasClass("is-disabled")).ok();
26
+ },
27
+ };
28
+ }
29
+ exports.checkboxInput = checkboxInput;
@@ -0,0 +1,14 @@
1
+ import { BaseFinder } from "../utils/base-finder";
2
+ interface ComboboxFinder extends BaseFinder {
3
+ dataName: string;
4
+ nth?: number;
5
+ }
6
+ export declare function combobox(finder: ComboboxFinder): {
7
+ typeTextAndSelectItemByIndex(optionText: string, index?: number): TestControllerPromise<any>;
8
+ selectItemWithTextFromDropdown(optionText: string): TestControllerPromise<any>;
9
+ shouldExist(): TestControllerPromise<any>;
10
+ shouldHaveValue(value: string): TestControllerPromise<any>;
11
+ shouldBeEmpty(): TestControllerPromise<any>;
12
+ replace(optionText: string, index?: number): TestControllerPromise<any>;
13
+ };
14
+ export {};
package/ui/combobox.js ADDED
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.combobox = void 0;
4
+ const testcafe_1 = require("testcafe");
5
+ const create_selector_1 = require("../utils/create-selector");
6
+ function combobox(finder) {
7
+ var _a;
8
+ const comboboxSelector = (0, create_selector_1.createSelector)(finder)
9
+ .find(".uxf-select-base")
10
+ .withAttribute("data-name", finder.dataName)
11
+ .nth((_a = finder.nth) !== null && _a !== void 0 ? _a : 0)
12
+ .find(".uxf-form-component__input");
13
+ return {
14
+ typeTextAndSelectItemByIndex(optionText, index = 0) {
15
+ return testcafe_1.t.typeText(comboboxSelector, optionText).click((0, testcafe_1.Selector)("li.uxf-dropdown__item").nth(index));
16
+ },
17
+ selectItemWithTextFromDropdown(optionText) {
18
+ return testcafe_1.t
19
+ .click(comboboxSelector.find(".uxf-select-base__arrow-icon"))
20
+ .click((0, testcafe_1.Selector)(".uxf-dropdown__item").withText(optionText));
21
+ },
22
+ shouldExist() {
23
+ return testcafe_1.t.expect(comboboxSelector.exists).ok();
24
+ },
25
+ shouldHaveValue(value) {
26
+ return testcafe_1.t.expect(comboboxSelector.find("input").value).eql(value);
27
+ },
28
+ shouldBeEmpty() {
29
+ return testcafe_1.t.expect(comboboxSelector.find("input").value).eql("");
30
+ },
31
+ replace(optionText, index = 0) {
32
+ return testcafe_1.t
33
+ .typeText(comboboxSelector, optionText, { replace: true })
34
+ .click((0, testcafe_1.Selector)("li.uxf-dropdown__item").nth(index));
35
+ },
36
+ };
37
+ }
38
+ exports.combobox = combobox;
@@ -0,0 +1,15 @@
1
+ import { BaseFinder } from "../utils/base-finder";
2
+ interface DatePickerInputFinder extends BaseFinder {
3
+ dataName: string;
4
+ }
5
+ export declare function datePickerInput(finder: DatePickerInputFinder): {
6
+ selectDate(DD: number, MM: number, YYYY: number): TestControllerPromise<any>;
7
+ replace(value: string): TestControllerPromise<any>;
8
+ shouldHaveValue(value: string): TestControllerPromise<any>;
9
+ shouldBeDisabled(): TestControllerPromise<any>;
10
+ shouldNotBeDisabled(): TestControllerPromise<any>;
11
+ shouldBeInvalid(): TestControllerPromise<any>;
12
+ clear(): TestControllerPromise<any>;
13
+ shouldBeEmpty(): TestControllerPromise<any>;
14
+ };
15
+ export {};
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.datePickerInput = void 0;
4
+ const testcafe_1 = require("testcafe");
5
+ const create_selector_1 = require("../utils/create-selector");
6
+ function datePickerInput(finder) {
7
+ const datepickerInputSelector = (0, create_selector_1.createSelector)(finder)
8
+ .find(".uxf-date-picker-input")
9
+ .withAttribute("data-name", finder.dataName);
10
+ return {
11
+ selectDate(DD, MM, YYYY) {
12
+ return testcafe_1.t.typeText(datepickerInputSelector.find(".uxf-input__element"), `${DD}.${MM}.${YYYY}`);
13
+ },
14
+ replace(value) {
15
+ return testcafe_1.t.typeText(datepickerInputSelector.find(".uxf-input__element"), value, { replace: true });
16
+ },
17
+ shouldHaveValue(value) {
18
+ return testcafe_1.t.expect(datepickerInputSelector.find(".uxf-input__element").value).eql(value);
19
+ },
20
+ shouldBeDisabled() {
21
+ return testcafe_1.t.expect(datepickerInputSelector.hasClass("is-disabled")).ok();
22
+ },
23
+ shouldNotBeDisabled() {
24
+ return testcafe_1.t.expect(datepickerInputSelector.hasClass("is-disabled")).notOk();
25
+ },
26
+ shouldBeInvalid() {
27
+ return testcafe_1.t.expect(datepickerInputSelector.hasAttribute("disabled")).notOk();
28
+ },
29
+ clear() {
30
+ return testcafe_1.t.click(datepickerInputSelector.find(".uxf-input__remove-button-inner"));
31
+ },
32
+ shouldBeEmpty() {
33
+ return testcafe_1.t.expect(datepickerInputSelector.find("input.uxf-input__element").value).eql("");
34
+ },
35
+ };
36
+ }
37
+ exports.datePickerInput = datePickerInput;
@@ -0,0 +1,15 @@
1
+ import { BaseFinder } from "../utils/base-finder";
2
+ interface DatetimePickerInputFinder extends BaseFinder {
3
+ dataName: string;
4
+ }
5
+ export declare function datetimePickerInput(finder: DatetimePickerInputFinder): {
6
+ selectDatetime(DD: number, MM: number, YYYY: number, hr: number, min: number): TestControllerPromise<any>;
7
+ replace(DD: number, MM: number, YYYY: number, hr: number, min: number): TestControllerPromise<any>;
8
+ shouldHaveValue(value: string): TestControllerPromise<any>;
9
+ shouldBeDisabled(): TestControllerPromise<any>;
10
+ shouldNotBeDisabled(): TestControllerPromise<any>;
11
+ shouldBeInvalid(): TestControllerPromise<any>;
12
+ clear(): TestControllerPromise<any>;
13
+ shouldBeEmpty(): TestControllerPromise<any>;
14
+ };
15
+ export {};
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.datetimePickerInput = void 0;
4
+ const testcafe_1 = require("testcafe");
5
+ const create_selector_1 = require("../utils/create-selector");
6
+ function datetimePickerInput(finder) {
7
+ const datetimepickerInputSelector = (0, create_selector_1.createSelector)(finder)
8
+ .find(".uxf-date-time-picker-input")
9
+ .withAttribute("data-name", finder.dataName);
10
+ return {
11
+ selectDatetime(DD, MM, YYYY, hr, min) {
12
+ return testcafe_1.t.typeText(datetimepickerInputSelector.find(".uxf-input__element"), `${DD}.${MM}.${YYYY} ${hr}:${min.toString().padStart(2, "0")}`);
13
+ },
14
+ replace(DD, MM, YYYY, hr, min) {
15
+ return testcafe_1.t.typeText(datetimepickerInputSelector.find(".uxf-input__element"), `${DD}.${MM}.${YYYY} ${hr}:${min.toString().padStart(2, "0")}`, { replace: true });
16
+ },
17
+ shouldHaveValue(value) {
18
+ return testcafe_1.t.expect(datetimepickerInputSelector.find(".uxf-input__element").value).eql(value);
19
+ },
20
+ shouldBeDisabled() {
21
+ return testcafe_1.t.expect(datetimepickerInputSelector.hasClass("is-disabled")).ok();
22
+ },
23
+ shouldNotBeDisabled() {
24
+ return testcafe_1.t.expect(datetimepickerInputSelector.hasClass("is-disabled")).notOk();
25
+ },
26
+ shouldBeInvalid() {
27
+ return testcafe_1.t.expect(datetimepickerInputSelector.hasAttribute("disabled")).notOk();
28
+ },
29
+ clear() {
30
+ return testcafe_1.t.click(datetimepickerInputSelector.find(".uxf-input__remove-button-inner"));
31
+ },
32
+ shouldBeEmpty() {
33
+ return testcafe_1.t.expect(datetimepickerInputSelector.find("input.uxf-input__element").value).eql("");
34
+ },
35
+ };
36
+ }
37
+ exports.datetimePickerInput = datetimePickerInput;
@@ -0,0 +1,17 @@
1
+ import { BaseFinder } from "../utils/base-finder";
2
+ interface DropzoneFinder extends BaseFinder {
3
+ name: string;
4
+ }
5
+ export declare function dropzone(finder: DropzoneFinder): {
6
+ /**
7
+ * V projektu vytvořit složku _uploads_ v root složce a do ní nahrát soubory.
8
+ * Ze složky _uploads_ se vybírají soubory, které jsou zadány jako filesToUpload.
9
+ *
10
+ * @param filesToUpload cesta k souboru musí začínat ./[název souboru]
11
+ *
12
+ * @example
13
+ * await defaultDropzone.uploadFiles(["./Jpg-test.jpg"]);
14
+ */
15
+ uploadFiles(filesToUpload: Array<string>): TestControllerPromise<any>;
16
+ };
17
+ export {};
package/ui/dropzone.js ADDED
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dropzone = void 0;
4
+ const testcafe_1 = require("testcafe");
5
+ const create_selector_1 = require("../utils/create-selector");
6
+ function dropzone(finder) {
7
+ const dropzoneSelector = (0, create_selector_1.createSelector)(finder)
8
+ .find("input.uxf-dropzone__input")
9
+ .withAttribute("name", finder.name)
10
+ .with({ visibilityCheck: false });
11
+ return {
12
+ /**
13
+ * V projektu vytvořit složku _uploads_ v root složce a do ní nahrát soubory.
14
+ * Ze složky _uploads_ se vybírají soubory, které jsou zadány jako filesToUpload.
15
+ *
16
+ * @param filesToUpload cesta k souboru musí začínat ./[název souboru]
17
+ *
18
+ * @example
19
+ * await defaultDropzone.uploadFiles(["./Jpg-test.jpg"]);
20
+ */
21
+ uploadFiles(filesToUpload) {
22
+ return testcafe_1.t.setFilesToUpload(dropzoneSelector, filesToUpload);
23
+ },
24
+ };
25
+ }
26
+ exports.dropzone = dropzone;
@@ -0,0 +1,5 @@
1
+ import { BaseFinder } from "../utils/base-finder";
2
+ export declare function message(finder: BaseFinder): {
3
+ shouldExist(): TestControllerPromise<any>;
4
+ shouldNotExist(): TestControllerPromise<any>;
5
+ };
package/ui/message.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.message = void 0;
4
+ const testcafe_1 = require("testcafe");
5
+ const create_selector_1 = require("../utils/create-selector");
6
+ function message(finder) {
7
+ const modalSelector = (0, create_selector_1.createSelector)(finder).find(".uxf-message__content");
8
+ return {
9
+ shouldExist() {
10
+ return testcafe_1.t.expect(modalSelector.exists).ok();
11
+ },
12
+ shouldNotExist() {
13
+ return testcafe_1.t.expect(modalSelector.exists).notOk();
14
+ },
15
+ };
16
+ }
17
+ exports.message = message;
package/ui/modal.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { BaseFinder } from "../utils/base-finder";
2
+ export declare function modal(finder: BaseFinder): {
3
+ shouldExist(): TestControllerPromise<any>;
4
+ shouldNotExist(): TestControllerPromise<any>;
5
+ };
package/ui/modal.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.modal = void 0;
4
+ const testcafe_1 = require("testcafe");
5
+ const create_selector_1 = require("../utils/create-selector");
6
+ function modal(finder) {
7
+ const modalSelector = (0, create_selector_1.createSelector)(finder).find(".uxf-dialog__panel");
8
+ return {
9
+ shouldExist() {
10
+ return testcafe_1.t.expect(modalSelector.exists).ok();
11
+ },
12
+ shouldNotExist() {
13
+ return testcafe_1.t.expect(modalSelector.exists).notOk();
14
+ },
15
+ };
16
+ }
17
+ exports.modal = modal;
@@ -0,0 +1,13 @@
1
+ import { BaseFinder } from "../utils/base-finder";
2
+ interface MultiComboboxFinder extends BaseFinder {
3
+ dataName: string;
4
+ nth?: number;
5
+ }
6
+ export declare function multiCombobox(finder: MultiComboboxFinder): {
7
+ selectItemByTypeText(optionText: string, index?: number): TestControllerPromise<any>;
8
+ selectItemFromDropdown(optionText: string): TestControllerPromise<any>;
9
+ shouldExist(): TestControllerPromise<any>;
10
+ shouldBeDisabled(): TestControllerPromise<any>;
11
+ replace(optionText: string, index?: number): TestControllerPromise<any>;
12
+ };
13
+ export {};
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.multiCombobox = void 0;
4
+ const testcafe_1 = require("testcafe");
5
+ const create_selector_1 = require("../utils/create-selector");
6
+ function multiCombobox(finder) {
7
+ var _a;
8
+ const multiComboboxSelector = (0, create_selector_1.createSelector)(finder)
9
+ .find(".uxf-multi-combobox")
10
+ .withAttribute("data-name", finder.dataName)
11
+ .nth((_a = finder.nth) !== null && _a !== void 0 ? _a : 0)
12
+ .find(".uxf-multi-combobox__button");
13
+ return {
14
+ selectItemByTypeText(optionText, index = 0) {
15
+ return testcafe_1.t.typeText(multiComboboxSelector, optionText).click((0, testcafe_1.Selector)(".uxf-dropdown__item").nth(index));
16
+ },
17
+ selectItemFromDropdown(optionText) {
18
+ return testcafe_1.t.click(multiComboboxSelector).click((0, testcafe_1.Selector)(".uxf-dropdown__item").withText(optionText));
19
+ },
20
+ shouldExist() {
21
+ return testcafe_1.t.expect(multiComboboxSelector.exists).ok();
22
+ },
23
+ shouldBeDisabled() {
24
+ return testcafe_1.t.expect(multiComboboxSelector.hasClass("is-disabled")).ok();
25
+ },
26
+ replace(optionText, index = 0) {
27
+ return testcafe_1.t
28
+ .typeText(multiComboboxSelector, optionText, { replace: true })
29
+ .click((0, testcafe_1.Selector)(".uxf-dropdown__item").nth(index));
30
+ },
31
+ };
32
+ }
33
+ exports.multiCombobox = multiCombobox;
@@ -0,0 +1,10 @@
1
+ import { BaseFinder } from "../utils/base-finder";
2
+ interface RadioGroupFinder extends BaseFinder {
3
+ id: string;
4
+ }
5
+ export declare function radioGroup(finder: RadioGroupFinder): {
6
+ selectByText(text: string): TestControllerPromise<any>;
7
+ shouldBeSelected(text: string): TestControllerPromise<any>;
8
+ shouldNotBeSelected(text: string): TestControllerPromise<any>;
9
+ };
10
+ export {};
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.radioGroup = void 0;
4
+ const testcafe_1 = require("testcafe");
5
+ const create_selector_1 = require("../utils/create-selector");
6
+ function radioGroup(finder) {
7
+ const radioGroupSelector = (0, create_selector_1.createSelector)(finder).find(".uxf-radio-group").withAttribute("id", finder.id);
8
+ return {
9
+ selectByText(text) {
10
+ return testcafe_1.t.click(radioGroupSelector.find(".uxf-radio-group__option").withExactText(text));
11
+ },
12
+ shouldBeSelected(text) {
13
+ return testcafe_1.t
14
+ .expect(radioGroupSelector
15
+ .find(".uxf-radio-group__option-wrapper")
16
+ .withExactText(text)
17
+ .hasClass("is-selected"))
18
+ .ok();
19
+ },
20
+ shouldNotBeSelected(text) {
21
+ return testcafe_1.t
22
+ .expect(radioGroupSelector
23
+ .find(".uxf-radio-group__option-wrapper")
24
+ .withExactText(text)
25
+ .hasClass("is-selected"))
26
+ .notOk();
27
+ },
28
+ };
29
+ }
30
+ exports.radioGroup = radioGroup;
package/ui/select.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { BaseFinder } from "../utils/base-finder";
2
2
  interface SelectInputFinder extends BaseFinder {
3
- name: string;
3
+ dataName: string;
4
4
  }
5
5
  export declare function select(finder: SelectInputFinder): {
6
6
  selectNthItem(nth: number): TestControllerPromise<any>;
package/ui/select.js CHANGED
@@ -4,8 +4,9 @@ exports.select = void 0;
4
4
  const testcafe_1 = require("testcafe");
5
5
  const create_selector_1 = require("../utils/create-selector");
6
6
  function select(finder) {
7
- // TODO - name
8
7
  const buttonSelector = (0, create_selector_1.createSelector)(finder)
8
+ .find(".uxf-select")
9
+ .withAttribute("data-name", finder.dataName)
9
10
  .find("button.uxf-input__element")
10
11
  .withAttribute("aria-haspopup", "listbox");
11
12
  return {
@@ -0,0 +1,11 @@
1
+ import { BaseFinder } from "../utils/base-finder";
2
+ interface TextLinkFinder extends BaseFinder {
3
+ text: string;
4
+ nth?: number;
5
+ }
6
+ export declare function textLink(finder: TextLinkFinder): {
7
+ click(): TestControllerPromise<any>;
8
+ shouldExists(): TestControllerPromise<any>;
9
+ shouldNotExists(): TestControllerPromise<any>;
10
+ };
11
+ export {};
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.textLink = void 0;
4
+ const testcafe_1 = require("testcafe");
5
+ const create_selector_1 = require("../utils/create-selector");
6
+ function textLink(finder) {
7
+ var _a;
8
+ const textLinkSelector = (0, create_selector_1.createSelector)(finder)
9
+ .find("a.uxf-text-link")
10
+ .withExactText(finder.text)
11
+ .nth((_a = finder.nth) !== null && _a !== void 0 ? _a : 0);
12
+ return {
13
+ click() {
14
+ return testcafe_1.t.click(textLinkSelector);
15
+ },
16
+ shouldExists() {
17
+ return testcafe_1.t.expect(textLinkSelector.exists).ok();
18
+ },
19
+ shouldNotExists() {
20
+ return testcafe_1.t.expect(textLinkSelector.exists).notOk();
21
+ },
22
+ };
23
+ }
24
+ exports.textLink = textLink;