@uxf/e2e-playwright 11.130.0 → 12.0.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/package.json +3 -3
- package/ui/checkbox-input.js +2 -2
- package/ui/combobox.js +2 -2
- package/ui/date-picker-input.js +2 -2
- package/ui/datetime-picker-input.js +2 -2
- package/ui/dropzone.js +2 -2
- package/ui/flash-messages.js +2 -2
- package/ui/multi-combobox.js +2 -2
- package/ui/multi-select.js +2 -2
- package/ui/radio-group.js +2 -2
- package/ui/select.js +2 -2
- package/ui/text-input.js +2 -2
- package/ui/textarea.js +2 -2
- package/ui/time-picker-input.js +2 -2
- package/ui/toggle.js +2 -2
- package/wysiwyg/hotkeys.e2e.d.ts +1 -0
- package/wysiwyg/hotkeys.e2e.js +66 -0
- package/wysiwyg/wysiwyg.e2e.js +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/e2e-playwright",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"description": "UXF Playwright helpers",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@playwright/test": "1.62.1",
|
|
20
20
|
"@uxf/core": "11.129.0",
|
|
21
|
-
"@uxf/ui": "
|
|
21
|
+
"@uxf/ui": "12.0.0",
|
|
22
22
|
"dayjs": "^1.11.21"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@playwright/test": "1.62.1",
|
|
26
26
|
"@uxf/core": "11.129.0",
|
|
27
|
-
"@uxf/ui": "
|
|
27
|
+
"@uxf/ui": "12.0.0",
|
|
28
28
|
"dayjs": "^1.11.21"
|
|
29
29
|
}
|
|
30
30
|
}
|
package/ui/checkbox-input.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.checkboxInput = exports.CheckboxInputModel = void 0;
|
|
4
|
-
const
|
|
4
|
+
const constants_1 = require("@uxf/ui/checkbox-input/constants");
|
|
5
5
|
const form_component_model_1 = require("../utils/form-component-model");
|
|
6
6
|
class CheckboxInputModel extends form_component_model_1.FormComponentModel {
|
|
7
7
|
constructor(page, finder) {
|
|
8
|
-
super(
|
|
8
|
+
super(constants_1.CHECKBOX_INPUT_COMPONENT_NAME, page, finder);
|
|
9
9
|
this.fakeCheckboxLocator = this.locator.locator(".uxf-checkbox");
|
|
10
10
|
}
|
|
11
11
|
async change(value) {
|
package/ui/combobox.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.combobox = exports.ComboboxModel = void 0;
|
|
4
|
-
const
|
|
4
|
+
const constants_1 = require("@uxf/ui/combobox/constants");
|
|
5
5
|
const exact_text_1 = require("../utils/exact-text");
|
|
6
6
|
const form_component_model_1 = require("../utils/form-component-model");
|
|
7
7
|
class ComboboxModel extends form_component_model_1.FormComponentModel {
|
|
8
8
|
constructor(page, finder) {
|
|
9
|
-
super(
|
|
9
|
+
super(constants_1.COMBOBOX_COMPONENT_NAME, page, finder);
|
|
10
10
|
this.inputLocator = this.locator.locator(".uxf-input__element");
|
|
11
11
|
}
|
|
12
12
|
async performChange(value, textFilter) {
|
package/ui/date-picker-input.js
CHANGED
|
@@ -4,12 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.datePickerInput = exports.DatePickerInputModel = void 0;
|
|
7
|
-
const
|
|
7
|
+
const constants_1 = require("@uxf/ui/date-picker-input/constants");
|
|
8
8
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
9
9
|
const form_component_model_1 = require("../utils/form-component-model");
|
|
10
10
|
class DatePickerInputModel extends form_component_model_1.FormComponentModel {
|
|
11
11
|
constructor(page, finder) {
|
|
12
|
-
super(
|
|
12
|
+
super(constants_1.DATE_PICKER_INPUT_COMPONENT_NAME, page, finder);
|
|
13
13
|
this.inputLocator = this.locator.locator(".uxf-input__element");
|
|
14
14
|
}
|
|
15
15
|
async change(value) {
|
|
@@ -4,12 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.datetimePickerInput = exports.DatetimePickerInputModel = void 0;
|
|
7
|
-
const
|
|
7
|
+
const constants_1 = require("@uxf/ui/datetime-picker-input/constants");
|
|
8
8
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
9
9
|
const form_component_model_1 = require("../utils/form-component-model");
|
|
10
10
|
class DatetimePickerInputModel extends form_component_model_1.FormComponentModel {
|
|
11
11
|
constructor(page, finder) {
|
|
12
|
-
super(
|
|
12
|
+
super(constants_1.DATETIME_PICKER_INPUT_COMPONENT_NAME, page, finder);
|
|
13
13
|
this.inputLocator = this.locator.locator(".uxf-input__element");
|
|
14
14
|
}
|
|
15
15
|
async change(value) {
|
package/ui/dropzone.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dropzone = exports.DropzoneModel = void 0;
|
|
4
4
|
const test_1 = require("@playwright/test");
|
|
5
|
-
const
|
|
5
|
+
const constants_1 = require("@uxf/ui/dropzone/constants");
|
|
6
6
|
const form_component_model_1 = require("../utils/form-component-model");
|
|
7
7
|
class DropzoneModel extends form_component_model_1.FormComponentModel {
|
|
8
8
|
constructor(page, finder) {
|
|
9
|
-
super(
|
|
9
|
+
super(constants_1.DROPZONE_COMPONENT_NAME, page, finder);
|
|
10
10
|
this.inputLocator = this.locator.locator("input");
|
|
11
11
|
}
|
|
12
12
|
async change(filesToUpload) {
|
package/ui/flash-messages.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.flashMessages = exports.FlashMessagesModel = void 0;
|
|
4
4
|
const test_1 = require("@playwright/test");
|
|
5
|
-
const
|
|
5
|
+
const constants_1 = require("@uxf/ui/flash-messages/constants");
|
|
6
6
|
const base_model_1 = require("../utils/base-model");
|
|
7
7
|
const exact_text_1 = require("../utils/exact-text");
|
|
8
8
|
class FlashMessagesModel extends base_model_1.BaseModel {
|
|
9
9
|
constructor(page) {
|
|
10
|
-
super(page, page.locator(`[data-component=${
|
|
10
|
+
super(page, page.locator(`[data-component=${constants_1.FLASH_MESSAGES_COMPONENT_NAME}]`));
|
|
11
11
|
}
|
|
12
12
|
flashMessageLocator(textFilter) {
|
|
13
13
|
return this.locator.locator(".uxf-flash-message").filter({ hasText: textFilter });
|
package/ui/multi-combobox.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.multiCombobox = exports.MultiComboboxModel = void 0;
|
|
4
|
-
const
|
|
4
|
+
const constants_1 = require("@uxf/ui/multi-combobox/constants");
|
|
5
5
|
const form_component_model_1 = require("../utils/form-component-model");
|
|
6
6
|
class MultiComboboxModel extends form_component_model_1.FormComponentModel {
|
|
7
7
|
constructor(page, finder) {
|
|
8
|
-
super(
|
|
8
|
+
super(constants_1.MULTI_COMBOBOX_COMPONENT_NAME, page, finder);
|
|
9
9
|
this.buttonLocator = this.locator.locator(".uxf-multi-combobox__button");
|
|
10
10
|
this.inputLocator = this.locator.locator("input");
|
|
11
11
|
}
|
package/ui/multi-select.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.multiSelect = exports.MultiSelectModel = void 0;
|
|
4
|
-
const
|
|
4
|
+
const constants_1 = require("@uxf/ui/multi-select/constants");
|
|
5
5
|
const exact_text_1 = require("../utils/exact-text");
|
|
6
6
|
const form_component_model_1 = require("../utils/form-component-model");
|
|
7
7
|
class MultiSelectModel extends form_component_model_1.FormComponentModel {
|
|
8
8
|
constructor(page, finder) {
|
|
9
|
-
super(
|
|
9
|
+
super(constants_1.MULTI_SELECT_COMPONENT_NAME, page, finder);
|
|
10
10
|
this.buttonLocator = this.locator.locator(".uxf-multi-select__button");
|
|
11
11
|
}
|
|
12
12
|
async performChange(optionTexts, textFilter) {
|
package/ui/radio-group.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.radioGroup = exports.RadioGroupModel = void 0;
|
|
4
|
-
const
|
|
4
|
+
const constants_1 = require("@uxf/ui/radio-group/constants");
|
|
5
5
|
const exact_text_1 = require("../utils/exact-text");
|
|
6
6
|
const form_component_model_1 = require("../utils/form-component-model");
|
|
7
7
|
class RadioGroupModel extends form_component_model_1.FormComponentModel {
|
|
8
8
|
constructor(page, finder) {
|
|
9
|
-
super(
|
|
9
|
+
super(constants_1.RADIO_GROUP_COMPONENT_NAME, page, finder);
|
|
10
10
|
}
|
|
11
11
|
async performChange(textFilter) {
|
|
12
12
|
const option = this.locator.locator(".uxf-radio-group__option").filter({ hasText: textFilter });
|
package/ui/select.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.select = exports.SelectModel = void 0;
|
|
4
|
-
const
|
|
4
|
+
const constants_1 = require("@uxf/ui/select/constants");
|
|
5
5
|
const exact_text_1 = require("../utils/exact-text");
|
|
6
6
|
const form_component_model_1 = require("../utils/form-component-model");
|
|
7
7
|
class SelectModel extends form_component_model_1.FormComponentModel {
|
|
8
8
|
constructor(page, finder) {
|
|
9
|
-
super(
|
|
9
|
+
super(constants_1.SELECT_COMPONENT_NAME, page, finder);
|
|
10
10
|
this.buttonLocator = this.locator.locator("div.uxf-input__element");
|
|
11
11
|
}
|
|
12
12
|
async performChange(textFilter) {
|
package/ui/text-input.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.textInput = exports.TextInputModel = void 0;
|
|
4
|
-
const
|
|
4
|
+
const constants_1 = require("@uxf/ui/text-input/constants");
|
|
5
5
|
const form_component_model_1 = require("../utils/form-component-model");
|
|
6
6
|
class TextInputModel extends form_component_model_1.FormComponentModel {
|
|
7
7
|
constructor(page, finder) {
|
|
8
|
-
super(
|
|
8
|
+
super(constants_1.TEXT_INPUT_COMPONENT_NAME, page, finder);
|
|
9
9
|
this.fakeTextInputLocator = this.locator.locator(":scope > .uxf-form-component__input > .uxf-input > .uxf-input__wrapper input");
|
|
10
10
|
}
|
|
11
11
|
async change(value) {
|
package/ui/textarea.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.textarea = exports.TextareaModel = void 0;
|
|
4
|
-
const
|
|
4
|
+
const constants_1 = require("@uxf/ui/textarea/constants");
|
|
5
5
|
const form_component_model_1 = require("../utils/form-component-model");
|
|
6
6
|
class TextareaModel extends form_component_model_1.FormComponentModel {
|
|
7
7
|
constructor(page, finder) {
|
|
8
|
-
super(
|
|
8
|
+
super(constants_1.TEXTAREA_COMPONENT_NAME, page, finder);
|
|
9
9
|
}
|
|
10
10
|
async change(value) {
|
|
11
11
|
const textarea = this.locator.locator("textarea");
|
package/ui/time-picker-input.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.timePickerInput = exports.TimePickerInputModel = void 0;
|
|
4
|
-
const
|
|
4
|
+
const constants_1 = require("@uxf/ui/time-picker-input/constants");
|
|
5
5
|
const form_component_model_1 = require("../utils/form-component-model");
|
|
6
6
|
class TimePickerInputModel extends form_component_model_1.FormComponentModel {
|
|
7
7
|
constructor(page, finder) {
|
|
8
|
-
super(
|
|
8
|
+
super(constants_1.TIME_PICKER_INPUT_COMPONENT_NAME, page, finder);
|
|
9
9
|
}
|
|
10
10
|
async change(value) {
|
|
11
11
|
return this.locator.locator("input").fill(value);
|
package/ui/toggle.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.toggle = exports.ToggleModel = void 0;
|
|
4
|
-
const
|
|
4
|
+
const constants_1 = require("@uxf/ui/toggle/constants");
|
|
5
5
|
const form_component_model_1 = require("../utils/form-component-model");
|
|
6
6
|
class ToggleModel extends form_component_model_1.FormComponentModel {
|
|
7
7
|
constructor(page, finder) {
|
|
8
|
-
super(
|
|
8
|
+
super(constants_1.TOGGLE_COMPONENT_NAME, page, finder);
|
|
9
9
|
}
|
|
10
10
|
async change(value) {
|
|
11
11
|
const isSelected = await this.locator.locator("button").evaluate((el) => el.classList.contains("is-selected"));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const test_1 = require("@playwright/test");
|
|
4
|
+
const EDITABLE = ".uxf-wysiwyg__editable";
|
|
5
|
+
/**
|
|
6
|
+
* Keyboard shortcuts, which nothing else covers: the toolbar tests click buttons, and a shortcut can be
|
|
7
|
+
* declared and still do nothing. Two ways it failed after the Plate 53 migration, both silent:
|
|
8
|
+
*
|
|
9
|
+
* - a `shortcuts.toggle` carrying only `keys` resolves through the plugin's own toggle transform, which
|
|
10
|
+
* Plate's own marks get from `toPlatePlugin` and a hand-written plugin does not have;
|
|
11
|
+
* - `keys` has to name the key the way the matcher sees it. `mod+shift+.` never fires, because the
|
|
12
|
+
* physical period key with shift held reports `event.key` as `>`. The spelling is `period`.
|
|
13
|
+
*/
|
|
14
|
+
/** Replaces the document with `text` and leaves it selected. */
|
|
15
|
+
async function selectFresh(page, text) {
|
|
16
|
+
await page.locator(EDITABLE).click();
|
|
17
|
+
await page.keyboard.press("ControlOrMeta+a");
|
|
18
|
+
await page.keyboard.type(text);
|
|
19
|
+
await page.keyboard.press("ControlOrMeta+a");
|
|
20
|
+
}
|
|
21
|
+
const MARKS = [
|
|
22
|
+
["bold", "ControlOrMeta+b", "uxf-wysiwyg__element-bold"],
|
|
23
|
+
["italic", "ControlOrMeta+i", "uxf-wysiwyg__element-italic"],
|
|
24
|
+
["underline", "ControlOrMeta+u", "uxf-wysiwyg__element-underline"],
|
|
25
|
+
["code", "ControlOrMeta+e", "uxf-wysiwyg__element-code"],
|
|
26
|
+
["highlight", "ControlOrMeta+Shift+h", "uxf-wysiwyg__element-highlight"],
|
|
27
|
+
];
|
|
28
|
+
test_1.test.describe("wysiwyg hotkeys", () => {
|
|
29
|
+
MARKS.forEach(([name, keys, className]) => {
|
|
30
|
+
(0, test_1.test)(`${keys} toggles ${name}`, async ({ page }) => {
|
|
31
|
+
await page.goto("/examples/wysiwyg/playground");
|
|
32
|
+
await selectFresh(page, "text");
|
|
33
|
+
await page.keyboard.press(keys);
|
|
34
|
+
await (0, test_1.expect)(page.locator(`${EDITABLE} .${className}`)).toHaveCount(1);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
(0, test_1.test)("ControlOrMeta+Shift+Period toggles a blockquote", async ({ page }) => {
|
|
38
|
+
await page.goto("/examples/wysiwyg/playground");
|
|
39
|
+
await selectFresh(page, "citace");
|
|
40
|
+
await page.keyboard.press("ControlOrMeta+Shift+Period");
|
|
41
|
+
await (0, test_1.expect)(page.locator(`${EDITABLE} .uxf-wysiwyg__element-blockquote`)).toHaveCount(1);
|
|
42
|
+
});
|
|
43
|
+
(0, test_1.test)("ControlOrMeta+Enter leaves the current block", async ({ page }) => {
|
|
44
|
+
await page.goto("/examples/wysiwyg/playground");
|
|
45
|
+
await selectFresh(page, "prvni");
|
|
46
|
+
await page.keyboard.press("ArrowRight");
|
|
47
|
+
await page.keyboard.press("ControlOrMeta+Enter");
|
|
48
|
+
await (0, test_1.expect)(page.locator(`${EDITABLE} [data-slate-node="element"]`)).not.toHaveCount(1);
|
|
49
|
+
});
|
|
50
|
+
(0, test_1.test)("ControlOrMeta+K opens the link popover", async ({ page }) => {
|
|
51
|
+
await page.goto("/examples/wysiwyg/playground");
|
|
52
|
+
await selectFresh(page, "odkaz");
|
|
53
|
+
await page.keyboard.press("ControlOrMeta+k");
|
|
54
|
+
await (0, test_1.expect)(page.locator(".uxf-wysiwyg__floating-link-insert__form")).toBeVisible();
|
|
55
|
+
});
|
|
56
|
+
(0, test_1.test)("ControlOrMeta+Z and ControlOrMeta+Shift+Z walk history", async ({ page }) => {
|
|
57
|
+
await page.goto("/examples/wysiwyg/playground");
|
|
58
|
+
await selectFresh(page, "puvodni");
|
|
59
|
+
await page.keyboard.press("End");
|
|
60
|
+
await page.keyboard.type(" pridane");
|
|
61
|
+
await page.keyboard.press("ControlOrMeta+z");
|
|
62
|
+
await (0, test_1.expect)(page.locator(EDITABLE)).not.toContainText("pridane");
|
|
63
|
+
await page.keyboard.press("ControlOrMeta+Shift+z");
|
|
64
|
+
await (0, test_1.expect)(page.locator(EDITABLE)).toContainText("pridane");
|
|
65
|
+
});
|
|
66
|
+
});
|
package/wysiwyg/wysiwyg.e2e.js
CHANGED
|
@@ -7,12 +7,19 @@ const EDITABLE = ".uxf-wysiwyg__editable";
|
|
|
7
7
|
async function openPlayground(page) {
|
|
8
8
|
await page.goto(PLAYGROUND);
|
|
9
9
|
await (0, test_1.expect)(page.locator(EDITABLE)).toBeVisible();
|
|
10
|
+
// The editable is in the DOM before the toolbar is, and the toolbar needs the editor from
|
|
11
|
+
// context - so waiting for a toolbar button is what says the editor is actually interactive.
|
|
12
|
+
// Without it, keystrokes sent under parallel load can land before Plate is listening.
|
|
13
|
+
await (0, test_1.expect)(page.locator(".uxf-wysiwyg__toolbar-button").first()).toBeVisible();
|
|
10
14
|
}
|
|
11
15
|
/** Replaces the document with a single paragraph holding `text`, and leaves it selected. */
|
|
12
16
|
async function typeFresh(page, text) {
|
|
13
17
|
await page.locator(EDITABLE).click();
|
|
14
18
|
await page.keyboard.press("ControlOrMeta+a");
|
|
15
19
|
await page.keyboard.type(text);
|
|
20
|
+
// Confirm the text landed before the test acts on it; a dropped keystroke otherwise surfaces
|
|
21
|
+
// as a confusing failure several steps later.
|
|
22
|
+
await (0, test_1.expect)(page.locator(EDITABLE)).toContainText(text);
|
|
16
23
|
await page.keyboard.press("ControlOrMeta+a");
|
|
17
24
|
}
|
|
18
25
|
function toolbarButton(page, modifier) {
|