@uxf/e2e-playwright 11.88.1 → 11.89.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/components.d.ts +2 -0
- package/components.js +4 -0
- package/package.json +5 -2
- package/ui/h1.d.ts +7 -0
- package/ui/h1.e2e.d.ts +1 -0
- package/ui/h1.e2e.js +10 -0
- package/ui/h1.js +16 -0
- package/ui/time-picker-input.d.ts +11 -0
- package/ui/time-picker-input.e2e.d.ts +1 -0
- package/ui/time-picker-input.e2e.js +10 -0
- package/ui/time-picker-input.js +16 -0
- package/utils/form-component-model.js +1 -1
package/components.d.ts
CHANGED
|
@@ -7,11 +7,13 @@ export declare function createUi(page: Page): {
|
|
|
7
7
|
datetimePickerInput: (finder: import("./ui/datetime-picker-input").DatetimePickerInputFinder) => import("./ui/datetime-picker-input").DatetimePickerInputModel;
|
|
8
8
|
dropzone: (finder: import("./ui/dropzone").DropzoneFinder) => import("./ui/dropzone").DropzoneModel;
|
|
9
9
|
flashMessages: () => import("./ui/flash-messages").FlashMessagesModel;
|
|
10
|
+
h1: () => import("./ui/h1").H1Model;
|
|
10
11
|
multiCombobox: (finder: import("./ui/multi-combobox").MultiComboboxFinder) => import("./ui/multi-combobox").MultiComboboxModel;
|
|
11
12
|
multiSelect: (finder: import("./ui/multi-select").MultiSelectFinder) => import("./ui/multi-select").MultiSelectModel;
|
|
12
13
|
radioGroup: (finder: import("./ui/radio-group").RadioGroupFinder) => import("./ui/radio-group").RadioGroupModel;
|
|
13
14
|
textarea: (finder: import("./ui/textarea").TextareaFinder) => import("./ui/textarea").TextareaModel;
|
|
14
15
|
select: (finder: import("./ui/select").SelectFinder) => import("./ui/select").SelectModel;
|
|
15
16
|
textInput: (finder: import("./ui/text-input").TextInputFinder) => import("./ui/text-input").TextInputModel;
|
|
17
|
+
timePickerInput: (finder: import("./ui/time-picker-input").TimePickerInputFinder) => import("./ui/time-picker-input").TimePickerInputModel;
|
|
16
18
|
toggle: (finder: import("./ui/toggle").ToggleFinder) => import("./ui/toggle").ToggleModel;
|
|
17
19
|
};
|
package/components.js
CHANGED
|
@@ -8,12 +8,14 @@ const date_picker_input_1 = require("./ui/date-picker-input");
|
|
|
8
8
|
const datetime_picker_input_1 = require("./ui/datetime-picker-input");
|
|
9
9
|
const dropzone_1 = require("./ui/dropzone");
|
|
10
10
|
const flash_messages_1 = require("./ui/flash-messages");
|
|
11
|
+
const h1_1 = require("./ui/h1");
|
|
11
12
|
const multi_combobox_1 = require("./ui/multi-combobox");
|
|
12
13
|
const multi_select_1 = require("./ui/multi-select");
|
|
13
14
|
const radio_group_1 = require("./ui/radio-group");
|
|
14
15
|
const select_1 = require("./ui/select");
|
|
15
16
|
const text_input_1 = require("./ui/text-input");
|
|
16
17
|
const textarea_1 = require("./ui/textarea");
|
|
18
|
+
const time_picker_input_1 = require("./ui/time-picker-input");
|
|
17
19
|
const toggle_1 = require("./ui/toggle");
|
|
18
20
|
function createUi(page) {
|
|
19
21
|
return {
|
|
@@ -24,12 +26,14 @@ function createUi(page) {
|
|
|
24
26
|
datetimePickerInput: (0, datetime_picker_input_1.datetimePickerInput)(page),
|
|
25
27
|
dropzone: (0, dropzone_1.dropzone)(page),
|
|
26
28
|
flashMessages: (0, flash_messages_1.flashMessages)(page),
|
|
29
|
+
h1: (0, h1_1.h1)(page),
|
|
27
30
|
multiCombobox: (0, multi_combobox_1.multiCombobox)(page),
|
|
28
31
|
multiSelect: (0, multi_select_1.multiSelect)(page),
|
|
29
32
|
radioGroup: (0, radio_group_1.radioGroup)(page),
|
|
30
33
|
textarea: (0, textarea_1.textarea)(page),
|
|
31
34
|
select: (0, select_1.select)(page),
|
|
32
35
|
textInput: (0, text_input_1.textInput)(page),
|
|
36
|
+
timePickerInput: (0, time_picker_input_1.timePickerInput)(page),
|
|
33
37
|
toggle: (0, toggle_1.toggle)(page),
|
|
34
38
|
};
|
|
35
39
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/e2e-playwright",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.89.0",
|
|
4
4
|
"description": "UXF Playwright helpers",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -11,10 +11,13 @@
|
|
|
11
11
|
"e2e:ui": "BASE_URL=http://localhost:3000 ../../node_modules/.bin/playwright test --ui",
|
|
12
12
|
"e2e:debug": "BASE_URL=http://localhost:3000 ../../node_modules/.bin/playwright test --debug",
|
|
13
13
|
"e2e:ci": "../../node_modules/.bin/playwright test",
|
|
14
|
-
"typecheck": "
|
|
14
|
+
"typecheck": "tsc --noEmit --skipLibCheck"
|
|
15
15
|
},
|
|
16
16
|
"author": "UX Fans s.r.o",
|
|
17
17
|
"license": "MIT",
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@uxf/ui": "11.89.0"
|
|
20
|
+
},
|
|
18
21
|
"devDependencies": {
|
|
19
22
|
"dayjs": "1.11.19",
|
|
20
23
|
"@playwright/test": "1.56.1"
|
package/ui/h1.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Page } from "@playwright/test";
|
|
2
|
+
import { BaseModel } from "../utils/base-model";
|
|
3
|
+
export declare class H1Model extends BaseModel {
|
|
4
|
+
constructor(page: Page);
|
|
5
|
+
shouldHaveText(text: string): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export declare const h1: (page: Page) => () => H1Model;
|
package/ui/h1.e2e.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/ui/h1.e2e.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const test_1 = require("@playwright/test");
|
|
4
|
+
const components_1 = require("../components");
|
|
5
|
+
(0, test_1.test)("H1", async ({ page }) => {
|
|
6
|
+
const ui = (0, components_1.createUi)(page);
|
|
7
|
+
await page.goto("/");
|
|
8
|
+
await ui.h1().shouldHaveText("UXF Frontend monorepo");
|
|
9
|
+
await ui.h1().shouldHaveText("uxf Frontend monorepo");
|
|
10
|
+
});
|
package/ui/h1.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.h1 = exports.H1Model = void 0;
|
|
4
|
+
const test_1 = require("@playwright/test");
|
|
5
|
+
const base_model_1 = require("../utils/base-model");
|
|
6
|
+
class H1Model extends base_model_1.BaseModel {
|
|
7
|
+
constructor(page) {
|
|
8
|
+
super(page, page.locator("h1"));
|
|
9
|
+
}
|
|
10
|
+
shouldHaveText(text) {
|
|
11
|
+
return (0, test_1.expect)(this.locator.filter({ hasText: new RegExp(`^${text}$`, "i") })).toHaveCount(1);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.H1Model = H1Model;
|
|
15
|
+
const h1 = (page) => () => new H1Model(page);
|
|
16
|
+
exports.h1 = h1;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Page } from "@playwright/test";
|
|
2
|
+
import { FormComponentFinder } from "../utils/base-finder";
|
|
3
|
+
import { FormComponentModel } from "../utils/form-component-model";
|
|
4
|
+
export type TimePickerInputFinder = FormComponentFinder;
|
|
5
|
+
type TimePickerInputValue = `${number}:${number}`;
|
|
6
|
+
export declare class TimePickerInputModel extends FormComponentModel<TimePickerInputValue> {
|
|
7
|
+
constructor(page: Page, finder: FormComponentFinder);
|
|
8
|
+
change(value: TimePickerInputValue): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export declare const timePickerInput: (page: Page) => (finder: TimePickerInputFinder) => TimePickerInputModel;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const test_1 = require("@playwright/test");
|
|
4
|
+
const components_1 = require("../components");
|
|
5
|
+
(0, test_1.test)("Time picker input", async ({ page }) => {
|
|
6
|
+
const ui = (0, components_1.createUi)(page);
|
|
7
|
+
await page.goto("/examples/ui/time-picker-input/Default");
|
|
8
|
+
await ui.timePickerInput({ $name: "default" }).change("12:00");
|
|
9
|
+
await ui.timePickerInput({ $name: "invalid" }).shouldBeInvalid();
|
|
10
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.timePickerInput = exports.TimePickerInputModel = void 0;
|
|
4
|
+
const time_picker_input_1 = require("@uxf/ui/time-picker-input/time-picker-input");
|
|
5
|
+
const form_component_model_1 = require("../utils/form-component-model");
|
|
6
|
+
class TimePickerInputModel extends form_component_model_1.FormComponentModel {
|
|
7
|
+
constructor(page, finder) {
|
|
8
|
+
super(time_picker_input_1.TIME_PICKER_INPUT_COMPONENT_NAME, page, finder);
|
|
9
|
+
}
|
|
10
|
+
async change(value) {
|
|
11
|
+
return this.locator.locator("input").fill(value);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.TimePickerInputModel = TimePickerInputModel;
|
|
15
|
+
const timePickerInput = (page) => (finder) => new TimePickerInputModel(page, finder);
|
|
16
|
+
exports.timePickerInput = timePickerInput;
|
|
@@ -6,7 +6,7 @@ const classes_1 = require("@uxf/core/constants/classes");
|
|
|
6
6
|
const base_model_1 = require("./base-model");
|
|
7
7
|
class FormComponentModel extends base_model_1.BaseModel {
|
|
8
8
|
constructor(componentName, page, finder) {
|
|
9
|
-
const locator = page.locator(`[data-component
|
|
9
|
+
const locator = page.locator(`xpath=//*[@data-component="${componentName}" and @data-name="${finder.$name}"]`);
|
|
10
10
|
super(page, locator);
|
|
11
11
|
}
|
|
12
12
|
shouldBeInvalid() {
|