@uxf/e2e 11.24.2 → 11.25.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.
- package/cms/menu.d.ts +8 -0
- package/cms/menu.js +34 -0
- package/components.d.ts +15 -9
- package/components.js +15 -9
- package/package.json +1 -1
- package/tests/multi-combobox.e2e.js +4 -0
- package/tests/sidebar-menu.e2e.d.ts +1 -0
- package/tests/sidebar-menu.e2e.js +42 -0
- package/tests/textarea.e2e.d.ts +1 -0
- package/tests/textarea.e2e.js +21 -0
- package/ui/date-picker-input.d.ts +1 -0
- package/ui/date-picker-input.js +3 -1
- package/ui/datetime-picker-input.d.ts +1 -0
- package/ui/datetime-picker-input.js +3 -1
- package/ui/dropzone.d.ts +1 -1
- package/ui/dropzone.js +1 -1
- package/ui/multi-combobox.d.ts +2 -0
- package/ui/multi-combobox.js +8 -0
- package/ui/radio-group.js +1 -1
- package/ui/select.js +1 -2
- package/ui/textarea.d.ts +14 -0
- package/ui/textarea.js +33 -0
package/cms/menu.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function menu(): {
|
|
2
|
+
openLink(mainLabel: string, subLabel?: string): TestControllerPromise<any>;
|
|
3
|
+
openBurgerMenu(): TestControllerPromise<any>;
|
|
4
|
+
openUserMenu(): TestControllerPromise<any>;
|
|
5
|
+
openUserMenuLink(userMenuLabel: string, device?: "mobile" | "desktop"): TestControllerPromise<any>;
|
|
6
|
+
shouldExistsLink(label: string): TestControllerPromise<any>;
|
|
7
|
+
shouldNotExistsLink(label: string): TestControllerPromise<any>;
|
|
8
|
+
};
|
package/cms/menu.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.menu = void 0;
|
|
4
|
+
const testcafe_1 = require("testcafe");
|
|
5
|
+
const menuLinkFinder = (0, testcafe_1.Selector)(".uxf-cms-menu__item");
|
|
6
|
+
function menu() {
|
|
7
|
+
return {
|
|
8
|
+
openLink(mainLabel, subLabel) {
|
|
9
|
+
if (!subLabel) {
|
|
10
|
+
return testcafe_1.t.click(menuLinkFinder.withExactText(mainLabel));
|
|
11
|
+
}
|
|
12
|
+
return testcafe_1.t.click(menuLinkFinder.withExactText(mainLabel)).click(menuLinkFinder.withExactText(subLabel));
|
|
13
|
+
},
|
|
14
|
+
openBurgerMenu() {
|
|
15
|
+
return testcafe_1.t.click((0, testcafe_1.Selector)(".uxf-cms-mobile-bar__button").nth(-1));
|
|
16
|
+
},
|
|
17
|
+
openUserMenu() {
|
|
18
|
+
return testcafe_1.t.click((0, testcafe_1.Selector)(".uxf-cms-user-menu__button"));
|
|
19
|
+
},
|
|
20
|
+
openUserMenuLink(userMenuLabel, device = "desktop") {
|
|
21
|
+
if (device === "desktop") {
|
|
22
|
+
return testcafe_1.t.click((0, testcafe_1.Selector)(menuLinkFinder).withExactText(userMenuLabel).nth(1));
|
|
23
|
+
}
|
|
24
|
+
return testcafe_1.t.click((0, testcafe_1.Selector)(menuLinkFinder).withExactText(userMenuLabel));
|
|
25
|
+
},
|
|
26
|
+
shouldExistsLink(label) {
|
|
27
|
+
return testcafe_1.t.expect(menuLinkFinder.withExactText(label).exists).ok();
|
|
28
|
+
},
|
|
29
|
+
shouldNotExistsLink(label) {
|
|
30
|
+
return testcafe_1.t.expect(menuLinkFinder.withExactText(label).exists).notOk();
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
exports.menu = menu;
|
package/components.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { menu } from "./cms/menu";
|
|
1
2
|
import { button } from "./ui/button";
|
|
2
3
|
import { buttonGroup } from "./ui/button-group";
|
|
3
4
|
import { buttonList } from "./ui/button-list";
|
|
@@ -16,23 +17,28 @@ import { radioGroup } from "./ui/radio-group";
|
|
|
16
17
|
import { select } from "./ui/select";
|
|
17
18
|
import { textInput } from "./ui/text-input";
|
|
18
19
|
import { textLink } from "./ui/text-link";
|
|
20
|
+
import { textarea } from "./ui/textarea";
|
|
19
21
|
export declare const components: {
|
|
20
22
|
button: typeof button;
|
|
21
23
|
buttonGroup: typeof buttonGroup;
|
|
22
24
|
buttonList: typeof buttonList;
|
|
23
|
-
input: typeof input;
|
|
24
|
-
select: typeof select;
|
|
25
|
-
textInput: typeof textInput;
|
|
26
25
|
combobox: typeof combobox;
|
|
27
|
-
multiCombobox: typeof multiCombobox;
|
|
28
|
-
checkboxInput: typeof checkboxInput;
|
|
29
|
-
checkboxButton: typeof checkboxButton;
|
|
30
26
|
datePickerInput: typeof datePickerInput;
|
|
31
27
|
datetimePickerInput: typeof datetimePickerInput;
|
|
32
|
-
|
|
28
|
+
dropzone: typeof dropzone;
|
|
29
|
+
flashMessage: typeof flashMessage;
|
|
30
|
+
checkboxButton: typeof checkboxButton;
|
|
31
|
+
checkboxInput: typeof checkboxInput;
|
|
32
|
+
input: typeof input;
|
|
33
33
|
message: typeof message;
|
|
34
|
+
modal: typeof modal;
|
|
35
|
+
multiCombobox: typeof multiCombobox;
|
|
34
36
|
radioGroup: typeof radioGroup;
|
|
37
|
+
select: typeof select;
|
|
38
|
+
textarea: typeof textarea;
|
|
39
|
+
textInput: typeof textInput;
|
|
35
40
|
textLink: typeof textLink;
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
cms: {
|
|
42
|
+
menu: typeof menu;
|
|
43
|
+
};
|
|
38
44
|
};
|
package/components.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.components = void 0;
|
|
4
|
+
const menu_1 = require("./cms/menu");
|
|
4
5
|
const button_1 = require("./ui/button");
|
|
5
6
|
const button_group_1 = require("./ui/button-group");
|
|
6
7
|
const button_list_1 = require("./ui/button-list");
|
|
@@ -19,23 +20,28 @@ const radio_group_1 = require("./ui/radio-group");
|
|
|
19
20
|
const select_1 = require("./ui/select");
|
|
20
21
|
const text_input_1 = require("./ui/text-input");
|
|
21
22
|
const text_link_1 = require("./ui/text-link");
|
|
23
|
+
const textarea_1 = require("./ui/textarea");
|
|
22
24
|
exports.components = {
|
|
23
25
|
button: button_1.button,
|
|
24
26
|
buttonGroup: button_group_1.buttonGroup,
|
|
25
27
|
buttonList: button_list_1.buttonList,
|
|
26
|
-
input: input_1.input,
|
|
27
|
-
select: select_1.select,
|
|
28
|
-
textInput: text_input_1.textInput,
|
|
29
28
|
combobox: combobox_1.combobox,
|
|
30
|
-
multiCombobox: multi_combobox_1.multiCombobox,
|
|
31
|
-
checkboxInput: checkbox_input_1.checkboxInput,
|
|
32
|
-
checkboxButton: checkbox_button_1.checkboxButton,
|
|
33
29
|
datePickerInput: date_picker_input_1.datePickerInput,
|
|
34
30
|
datetimePickerInput: datetime_picker_input_1.datetimePickerInput,
|
|
35
|
-
|
|
31
|
+
dropzone: dropzone_1.dropzone,
|
|
32
|
+
flashMessage: flash_message_1.flashMessage,
|
|
33
|
+
checkboxButton: checkbox_button_1.checkboxButton,
|
|
34
|
+
checkboxInput: checkbox_input_1.checkboxInput,
|
|
35
|
+
input: input_1.input,
|
|
36
36
|
message: message_1.message,
|
|
37
|
+
modal: modal_1.modal,
|
|
38
|
+
multiCombobox: multi_combobox_1.multiCombobox,
|
|
37
39
|
radioGroup: radio_group_1.radioGroup,
|
|
40
|
+
select: select_1.select,
|
|
41
|
+
textarea: textarea_1.textarea,
|
|
42
|
+
textInput: text_input_1.textInput,
|
|
38
43
|
textLink: text_link_1.textLink,
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
cms: {
|
|
45
|
+
menu: menu_1.menu,
|
|
46
|
+
},
|
|
41
47
|
};
|
package/package.json
CHANGED
|
@@ -16,5 +16,9 @@ const wait_for_react_1 = require("../utils/wait-for-react");
|
|
|
16
16
|
await defaultMultiCombobox.selectItemFromDropdown("Option red");
|
|
17
17
|
await defaultMultiCombobox.replace("Option green");
|
|
18
18
|
await defaultMultiCombobox.selectItemByTypeText("Option four");
|
|
19
|
+
await defaultMultiCombobox.shouldHaveValue("Option red");
|
|
20
|
+
await defaultMultiCombobox.shouldHaveValue("Option four");
|
|
21
|
+
await defaultMultiCombobox.shouldHaveValue("Option green");
|
|
19
22
|
await components_1.components.multiCombobox({ dataName: "multi-combobox-disabled" }).shouldBeDisabled();
|
|
23
|
+
await components_1.components.multiCombobox({ dataName: "multi-combobox-invalid" }).shouldBeInvalid();
|
|
20
24
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
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)("Menu")
|
|
7
|
+
.page("https://uxf-base.uxf.dev/admin")
|
|
8
|
+
.httpAuth({ username: "uxf", password: "uxf" })
|
|
9
|
+
.beforeEach(async (controller) => {
|
|
10
|
+
await (0, wait_for_react_1.waitForReact)(10000, controller);
|
|
11
|
+
});
|
|
12
|
+
(0, testcafe_1.test)("Menu desktop", async () => {
|
|
13
|
+
await components_1.components.textInput({ name: "username" }).type("root@uxf.cz");
|
|
14
|
+
await components_1.components.textInput({ name: "password" }).type("root");
|
|
15
|
+
await components_1.components.button({ text: "Přihlásit se" }).click();
|
|
16
|
+
await components_1.components.cms.menu().shouldExistsLink("Big test");
|
|
17
|
+
await components_1.components.cms.menu().shouldNotExistsLink("Small test");
|
|
18
|
+
//main menu item click
|
|
19
|
+
await components_1.components.cms.menu().openLink("Big test");
|
|
20
|
+
await testcafe_1.t.expect((0, testcafe_1.Selector)("h1").withExactText("Big test").exists).ok();
|
|
21
|
+
//hover on main menu and click on sub menu item
|
|
22
|
+
await components_1.components.cms.menu().openLink("Obsah", "Články");
|
|
23
|
+
await testcafe_1.t.expect((0, testcafe_1.Selector)("h1").withExactText("Články").exists).ok();
|
|
24
|
+
//submenu item click
|
|
25
|
+
await components_1.components.cms.menu().openLink("Otázky a odpovědi");
|
|
26
|
+
await testcafe_1.t.expect((0, testcafe_1.Selector)("h1").withExactText("Otázky a odpovědi").exists).ok();
|
|
27
|
+
//user menu item click
|
|
28
|
+
await testcafe_1.t.wait(2000);
|
|
29
|
+
await components_1.components.cms.menu().openUserMenu();
|
|
30
|
+
await components_1.components.cms.menu().openUserMenuLink("Změna hesla");
|
|
31
|
+
await testcafe_1.t.expect((0, testcafe_1.Selector)("h1").withExactText("Změna hesla").exists).ok();
|
|
32
|
+
});
|
|
33
|
+
(0, testcafe_1.test)("Menu mobile", async () => {
|
|
34
|
+
await testcafe_1.t.resizeWindow(390, 844);
|
|
35
|
+
await testcafe_1.t.setTestSpeed(0.5);
|
|
36
|
+
await components_1.components.textInput({ name: "username" }).type("root@uxf.cz");
|
|
37
|
+
await components_1.components.textInput({ name: "password" }).type("root");
|
|
38
|
+
await components_1.components.button({ text: "Přihlásit se" }).click();
|
|
39
|
+
await components_1.components.cms.menu().openBurgerMenu();
|
|
40
|
+
await components_1.components.cms.menu().openUserMenuLink("Změna hesla", "mobile");
|
|
41
|
+
await testcafe_1.t.expect((0, testcafe_1.Selector)("h1").withExactText("Změna hesla").exists).ok();
|
|
42
|
+
});
|
|
@@ -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)("Textarea")
|
|
7
|
+
.page("https://fe.uxf.dev/examples/ui/textarea/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)("Textarea", async () => {
|
|
13
|
+
const defaultTextarea = components_1.components.textarea({ dataName: "text-area" });
|
|
14
|
+
await defaultTextarea.shouldNotBeDisabled();
|
|
15
|
+
await defaultTextarea.type("Value");
|
|
16
|
+
await defaultTextarea.shouldHaveValue("testValue");
|
|
17
|
+
await defaultTextarea.replace("suffix");
|
|
18
|
+
await defaultTextarea.shouldHaveValue("suffix");
|
|
19
|
+
await components_1.components.textarea({ dataName: "text-area-diabled" }).shouldBeDisabled();
|
|
20
|
+
await components_1.components.textarea({ dataName: "text-area-read-only" }).shouldBeReadonly();
|
|
21
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseFinder } from "../utils/base-finder";
|
|
2
2
|
interface DatePickerInputFinder extends BaseFinder {
|
|
3
3
|
dataName: string;
|
|
4
|
+
nth?: number;
|
|
4
5
|
}
|
|
5
6
|
export declare function datePickerInput(finder: DatePickerInputFinder): {
|
|
6
7
|
selectDate(DD: number, MM: number, YYYY: number): TestControllerPromise<any>;
|
package/ui/date-picker-input.js
CHANGED
|
@@ -4,9 +4,11 @@ exports.datePickerInput = void 0;
|
|
|
4
4
|
const testcafe_1 = require("testcafe");
|
|
5
5
|
const create_selector_1 = require("../utils/create-selector");
|
|
6
6
|
function datePickerInput(finder) {
|
|
7
|
+
var _a;
|
|
7
8
|
const datepickerInputSelector = (0, create_selector_1.createSelector)(finder)
|
|
8
9
|
.find(".uxf-date-picker-input")
|
|
9
|
-
.withAttribute("data-name", finder.dataName)
|
|
10
|
+
.withAttribute("data-name", finder.dataName)
|
|
11
|
+
.nth((_a = finder.nth) !== null && _a !== void 0 ? _a : 0);
|
|
10
12
|
return {
|
|
11
13
|
selectDate(DD, MM, YYYY) {
|
|
12
14
|
return testcafe_1.t.typeText(datepickerInputSelector.find(".uxf-input__element"), `${DD}.${MM}.${YYYY}`);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseFinder } from "../utils/base-finder";
|
|
2
2
|
interface DatetimePickerInputFinder extends BaseFinder {
|
|
3
3
|
dataName: string;
|
|
4
|
+
nth?: number;
|
|
4
5
|
}
|
|
5
6
|
export declare function datetimePickerInput(finder: DatetimePickerInputFinder): {
|
|
6
7
|
selectDatetime(DD: number, MM: number, YYYY: number, hr: number, min: number): TestControllerPromise<any>;
|
|
@@ -4,9 +4,11 @@ exports.datetimePickerInput = void 0;
|
|
|
4
4
|
const testcafe_1 = require("testcafe");
|
|
5
5
|
const create_selector_1 = require("../utils/create-selector");
|
|
6
6
|
function datetimePickerInput(finder) {
|
|
7
|
+
var _a;
|
|
7
8
|
const datetimepickerInputSelector = (0, create_selector_1.createSelector)(finder)
|
|
8
9
|
.find(".uxf-date-time-picker-input")
|
|
9
|
-
.withAttribute("data-name", finder.dataName)
|
|
10
|
+
.withAttribute("data-name", finder.dataName)
|
|
11
|
+
.nth((_a = finder.nth) !== null && _a !== void 0 ? _a : 0);
|
|
10
12
|
return {
|
|
11
13
|
selectDatetime(DD, MM, YYYY, hr, min) {
|
|
12
14
|
return testcafe_1.t.typeText(datetimepickerInputSelector.find(".uxf-input__element"), `${DD}.${MM}.${YYYY} ${hr}:${min.toString().padStart(2, "0")}`);
|
package/ui/dropzone.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ interface DropzoneFinder extends BaseFinder {
|
|
|
4
4
|
}
|
|
5
5
|
export declare function dropzone(finder: DropzoneFinder): {
|
|
6
6
|
/**
|
|
7
|
-
* V projektu vytvořit složku _uploads_ v root složce a do ní nahrát soubory.
|
|
7
|
+
* V projektu vytvořit složku \_uploads_ v root složce a do ní nahrát soubory.
|
|
8
8
|
* Ze složky _uploads_ se vybírají soubory, které jsou zadány jako filesToUpload.
|
|
9
9
|
*
|
|
10
10
|
* @param filesToUpload cesta k souboru musí začínat ./[název souboru]
|
package/ui/dropzone.js
CHANGED
|
@@ -10,7 +10,7 @@ function dropzone(finder) {
|
|
|
10
10
|
.with({ visibilityCheck: false });
|
|
11
11
|
return {
|
|
12
12
|
/**
|
|
13
|
-
* V projektu vytvořit složku _uploads_ v root složce a do ní nahrát soubory.
|
|
13
|
+
* V projektu vytvořit složku \_uploads_ v root složce a do ní nahrát soubory.
|
|
14
14
|
* Ze složky _uploads_ se vybírají soubory, které jsou zadány jako filesToUpload.
|
|
15
15
|
*
|
|
16
16
|
* @param filesToUpload cesta k souboru musí začínat ./[název souboru]
|
package/ui/multi-combobox.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export declare function multiCombobox(finder: MultiComboboxFinder): {
|
|
|
8
8
|
selectItemFromDropdown(optionText: string): TestControllerPromise<any>;
|
|
9
9
|
shouldExist(): TestControllerPromise<any>;
|
|
10
10
|
shouldBeDisabled(): TestControllerPromise<any>;
|
|
11
|
+
shouldBeInvalid(): TestControllerPromise<any>;
|
|
11
12
|
replace(optionText: string, index?: number): TestControllerPromise<any>;
|
|
13
|
+
shouldHaveValue(value: string): TestControllerPromise<any>;
|
|
12
14
|
};
|
|
13
15
|
export {};
|
package/ui/multi-combobox.js
CHANGED
|
@@ -23,11 +23,19 @@ function multiCombobox(finder) {
|
|
|
23
23
|
shouldBeDisabled() {
|
|
24
24
|
return testcafe_1.t.expect(multiComboboxSelector.hasClass("is-disabled")).ok();
|
|
25
25
|
},
|
|
26
|
+
shouldBeInvalid() {
|
|
27
|
+
return testcafe_1.t.expect(multiComboboxSelector.hasClass("is-invalid")).ok();
|
|
28
|
+
},
|
|
26
29
|
replace(optionText, index = 0) {
|
|
27
30
|
return testcafe_1.t
|
|
28
31
|
.typeText(multiComboboxSelector, optionText, { replace: true })
|
|
29
32
|
.click((0, testcafe_1.Selector)(".uxf-dropdown__item").nth(index));
|
|
30
33
|
},
|
|
34
|
+
shouldHaveValue(value) {
|
|
35
|
+
return testcafe_1.t
|
|
36
|
+
.expect(multiComboboxSelector.find(".uxf-multi-combobox__selected-options").textContent)
|
|
37
|
+
.contains(value);
|
|
38
|
+
},
|
|
31
39
|
};
|
|
32
40
|
}
|
|
33
41
|
exports.multiCombobox = multiCombobox;
|
package/ui/radio-group.js
CHANGED
|
@@ -7,7 +7,7 @@ function radioGroup(finder) {
|
|
|
7
7
|
const radioGroupSelector = (0, create_selector_1.createSelector)(finder).find(".uxf-radio-group").withAttribute("id", finder.id);
|
|
8
8
|
return {
|
|
9
9
|
selectByText(text) {
|
|
10
|
-
return testcafe_1.t.click(radioGroupSelector.find(".uxf-radio-group__option").
|
|
10
|
+
return testcafe_1.t.click(radioGroupSelector.find(".uxf-radio-group__option").withText(text));
|
|
11
11
|
},
|
|
12
12
|
shouldBeSelected(text) {
|
|
13
13
|
return testcafe_1.t
|
package/ui/select.js
CHANGED
|
@@ -7,8 +7,7 @@ function select(finder) {
|
|
|
7
7
|
const buttonSelector = (0, create_selector_1.createSelector)(finder)
|
|
8
8
|
.find(".uxf-select")
|
|
9
9
|
.withAttribute("data-name", finder.dataName)
|
|
10
|
-
.find("
|
|
11
|
-
.withAttribute("aria-haspopup", "listbox");
|
|
10
|
+
.find("div.uxf-input__element");
|
|
12
11
|
return {
|
|
13
12
|
selectNthItem(nth) {
|
|
14
13
|
// TODO - asi použít helper na dropdown až bude existovat
|
package/ui/textarea.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseFinder } from "../utils/base-finder";
|
|
2
|
+
interface TextareaFinder extends BaseFinder {
|
|
3
|
+
dataName: string;
|
|
4
|
+
nth?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function textarea(finder: TextareaFinder): {
|
|
7
|
+
type(value: string): TestControllerPromise<any>;
|
|
8
|
+
replace(value: string): TestControllerPromise<any>;
|
|
9
|
+
shouldHaveValue(value: string): TestControllerPromise<any>;
|
|
10
|
+
shouldBeDisabled(): TestControllerPromise<any>;
|
|
11
|
+
shouldNotBeDisabled(): TestControllerPromise<any>;
|
|
12
|
+
shouldBeReadonly(): TestControllerPromise<any>;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
package/ui/textarea.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.textarea = void 0;
|
|
4
|
+
const testcafe_1 = require("testcafe");
|
|
5
|
+
const create_selector_1 = require("../utils/create-selector");
|
|
6
|
+
function textarea(finder) {
|
|
7
|
+
var _a;
|
|
8
|
+
const textareaSelector = (0, create_selector_1.createSelector)(finder)
|
|
9
|
+
.find(".uxf-textarea")
|
|
10
|
+
.withAttribute("data-name", finder.dataName)
|
|
11
|
+
.nth((_a = finder.nth) !== null && _a !== void 0 ? _a : 0);
|
|
12
|
+
return {
|
|
13
|
+
type(value) {
|
|
14
|
+
return testcafe_1.t.typeText(textareaSelector.find("textarea"), value);
|
|
15
|
+
},
|
|
16
|
+
replace(value) {
|
|
17
|
+
return testcafe_1.t.typeText(textareaSelector.find("textarea"), value, { replace: true });
|
|
18
|
+
},
|
|
19
|
+
shouldHaveValue(value) {
|
|
20
|
+
return testcafe_1.t.expect(textareaSelector.find("textarea").value).eql(value);
|
|
21
|
+
},
|
|
22
|
+
shouldBeDisabled() {
|
|
23
|
+
return testcafe_1.t.expect(textareaSelector.hasClass("is-disabled")).ok();
|
|
24
|
+
},
|
|
25
|
+
shouldNotBeDisabled() {
|
|
26
|
+
return testcafe_1.t.expect(textareaSelector.hasClass("is-disabled")).notOk();
|
|
27
|
+
},
|
|
28
|
+
shouldBeReadonly() {
|
|
29
|
+
return testcafe_1.t.expect(textareaSelector.hasClass("is-readonly")).ok();
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
exports.textarea = textarea;
|