@ironsource/shared-ui-e2e 2.1.12-rc.4 → 2.1.12-rc.41
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 +1 -1
- package/shared-e2e-commands.js +480 -313
- package/shared-e2e-commands.umd.cjs +1 -1
- package/tests/components/date-range/consts.d.ts +3 -0
- package/tests/components/date-range/date-range-component.d.ts +24 -0
- package/tests/components/date-range/date-range-page.d.ts +17 -0
- package/tests/components/date-range/types.d.ts +23 -0
- package/tests/components/dropdown/base-dropdown.d.ts +4 -1
- package/tests/components/dropdown/dropdown-v4/dropdown-component.d.ts +0 -3
- package/tests/components/dropdown/dropdown-v4/treedropdown-component.d.ts +5 -3
- package/tests/components/dropdown/types.d.ts +2 -0
- package/tests/components/sortablelist/sortable-list-component.d.ts +1 -0
- package/tests/components/sortablelist/sortable-list-page.d.ts +2 -0
- package/tests/components/switch/consts.d.ts +3 -0
- package/tests/components/switch/switch-component.d.ts +13 -0
- package/tests/components/switch/switch-page.d.ts +10 -0
- package/tests/components/switch/types.d.ts +4 -0
- package/tests/index.d.ts +2 -0
- package/tests/testids/index.d.ts +8 -0
- package/tsconfig.tsbuildinfo +1 -1
package/shared-e2e-commands.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
const
|
|
1
|
+
var j = Object.defineProperty;
|
|
2
|
+
var q = (a, t, e) => t in a ? j(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
|
+
var r = (a, t, e) => (q(a, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
var T = /* @__PURE__ */ ((a) => (a.TRIGGER = "ie-trigger", a.CONTENT = "ie-content", a.SEARCH = "ie-search", a.LIST = "ie-list", a.LIST_SELECTED = "ie-list-selected", a.ACTION_CANCEL = "ie-action-cancel", a.ACTION_APPLY = "ie-action-apply", a.SELECT_ALL = "ie-select-all", a.CLEAR_ALL = "ie-clear-all", a))(T || {}), i = /* @__PURE__ */ ((a) => (a.TRIGGER = "dd-trigger", a.WRAPPER = "dd-wrapper", a.BUTTON = "dd-button", a.BUTTON_WRAPPER = "dd-button-wrapper", a.BUTTON_CONTENT = "dd-button-content", a.BUTTON_CONTENT_SUFFIX = "dd-button-content-suffix", a.BUTTON_CLEAR = "dd-button-clear", a.LABEL = "dd-label", a.LIST_CONTAINER = "dd-list-container", a.SEARCH = "dd-search", a.TITLE = "dd-title", a.ACTION_CANCEL = "dd-action-cancel", a.ACTION_APPLY = "dd-action-apply", a.ACTION_CLEAR_ALL = "dd-action-clear-all", a.HELPER_TEXT = "dd-helper-text", a.HELPER_TEXT_ERROR = "dd-helper-text-error", a.SELECT_ALL = "dd-select-all", a.NO_RESULT = "dd-no-result", a))(i || {}), S = /* @__PURE__ */ ((a) => (a.WRAPPER = "banner-wrapper", a.CONTENT = "banner-content", a))(S || {}), d = /* @__PURE__ */ ((a) => (a.WRAPPER = "alert-wrapper", a.TITLE = "alert-title", a.MESSAGE = "alert-message", a.ACTION_BUTTON = "alert-action-button", a.CLOSE_BUTTON = "alert-close-button", a))(d || {}), u = /* @__PURE__ */ ((a) => (a.WRAPPER = "dialog-wrapper", a.HEADER = "dialog-header", a.ACTION_CLOSE = "dialog-action-close", a.HEADER_SECONDARY = "dialog-header-secondary", a.CONTENT = "dialog-content", a.ACTION_BUTTONS_WRAPPER = "dialog-action-buttons-wrapper", a.BACKDROP = "dialog-backdrop", a.SAVE_BUTTON = "dialog-save-button", a.CANCEL_BUTTON = "dialog-cancel-button", a))(u || {}), l = /* @__PURE__ */ ((a) => (a.WRAPPER = "input-wrapper", a.TOOLTIP = "input-tooltip", a.TOOLTIP_WITHOUT_ICON = "input-tooltip-without-icon", a.MANDATORY = "input-mandatory", a.LABEL_CONTAINER = "input-label-container", a.LABEL_TEXT = "input-label-text", a.FIELD = "input-field", a.EXTRA_TEXT = "input-extra-text", a.TOGGLE_PASSWORD = "input-toggle-password-icon", a))(l || {}), v = /* @__PURE__ */ ((a) => (a.WRAPPER = "swicth-wrapper", a.BUTTON = "swicth-button", a.TEXT = "swicth-text", a))(v || {}), C = /* @__PURE__ */ ((a) => (a.WRAPPER = "ta-wrapper", a.LABEL = "ta-label", a.FIELD = "ta-field", a.TEXT = "ta-text", a))(C || {}), D = /* @__PURE__ */ ((a) => (a.CONTAINER = "search-container", a.FIELD = "search-field", a.CLOSE = "search-close", a.CLEAR = "search-clear", a))(D || {}), g = /* @__PURE__ */ ((a) => (a.CONTAINER = "tbl-container", a.TABLE = "tbl-table", a.HEADER = "tbl-header", a.TITLE = "tbl-title", a.HEADER_RIGHT = "tbl-header-right", a.ACTIONS = "tbl-actions", a.SECTIONS = "tbl-sections", a.BODY_WRAPPER = "tbl-body-wrapper", a.EMPTY_STATE = "tbl-empty-state", a.PRE_SEARCH_HEADER = "tbl-pre-search-header", a))(g || {}), P = /* @__PURE__ */ ((a) => (a.TEXT = "tt-text", a.TRIGGER = "tt-trigger", a.HEADER = "tt-header", a))(P || {}), m = /* @__PURE__ */ ((a) => (a.WRAPPER = "dr-wrapper", a.FIELD = "dr-field", a.TRIGGER = "dr-trigger", a.CONTAINER = "dr-container", a.MENU = "dr-menu", a.MESSAGE = "dr-message", a.ACTION_APPLY = "dr-action-apply", a.ACTION_CANCEL = "dr-action-cancel", a))(m || {}), A = /* @__PURE__ */ ((a) => (a.WRAPPER = "tabs-wrapper", a.TAB = "tabs-tab", a))(A || {}), R = /* @__PURE__ */ ((a) => (a.CONTAINER = "field-label-container", a.TEXT = "field-label-text", a.MANDATORY = "field-label-mandatory", a.TOOLTIP = "field-label-help-tooltip", a))(R || {}), E = /* @__PURE__ */ ((a) => (a.CONTAINER = "field-help-text-container", a.TEXT = "field-help-text-text", a.ICON = "field-help-text-icon", a))(E || {}), w = /* @__PURE__ */ ((a) => (a.CONTAINER = "sb-container", a.TITLE = "sb-title", a.MESSAGE = "sb-message", a.CLOSE = "sb-close", a.ICON = "sb-icon", a.ACTION_BUTTON = "sb-action-button", a))(w || {}), I = /* @__PURE__ */ ((a) => (a.TITLE = "form-card-title", a.CONTENT = "form-card-content", a.ACTIONS = "form-card-actions", a.SAVE_BUTTON = "form-card-save-btn", a.CANCEL_BUTTON = "form-card-cancel-btn", a))(I || {}), _ = /* @__PURE__ */ ((a) => (a.TITLE = "ah-title", a.APP_KEY = "ah-app-key", a.APP_PLATFORM = "ah-app-platform", a.AB_ICON = "ah-ab-icon", a))(_ || {}), G = /* @__PURE__ */ ((a) => (a.TEXT = "ic-text", a.COPY_BTN = "ic-copy-btn", a))(G || {}), L = /* @__PURE__ */ ((a) => (a.WRAPPER = "multibar-wrapper", a.CLOSE_BTN = "multibar-close-button", a.MENU = "multibar-menu", a.ACTION = "multibar-action", a))(L || {}), h = /* @__PURE__ */ ((a) => (a.CONTAINER = "sortable-list-container", a.DRAGGABLE_LIST = "sortable-list-draggable-list", a.LOCKED_LIST = "sortable-list-locked-list", a))(h || {});
|
|
5
|
+
const z = (a, t) => {
|
|
6
6
|
const e = new URLSearchParams(a).toString();
|
|
7
7
|
return t.includes("?") ? `${t}${e}` : `${t}?${e}`;
|
|
8
|
-
},
|
|
8
|
+
}, Q = (a, t = {}) => {
|
|
9
9
|
const e = [];
|
|
10
|
-
Object.entries(t).forEach(([
|
|
11
|
-
e.push(`${
|
|
10
|
+
Object.entries(t).forEach(([c, p]) => {
|
|
11
|
+
e.push(`${c}:${p}`);
|
|
12
12
|
});
|
|
13
13
|
const o = {
|
|
14
14
|
id: a,
|
|
15
15
|
viewMode: "story",
|
|
16
16
|
args: e.join(";")
|
|
17
17
|
};
|
|
18
|
-
return
|
|
18
|
+
return z(o, "iframe.html");
|
|
19
19
|
}, n = (a, t) => `${a}-${t}`;
|
|
20
|
-
class
|
|
20
|
+
class it {
|
|
21
21
|
constructor(t) {
|
|
22
|
-
|
|
22
|
+
r(this, "page");
|
|
23
23
|
this.page = t;
|
|
24
24
|
}
|
|
25
25
|
async waitForComponent({ testId: t }) {
|
|
26
|
-
const e = `[data-testid='${t}-${
|
|
26
|
+
const e = `[data-testid='${t}-${S.WRAPPER}']`;
|
|
27
27
|
await this.page.waitForSelector(e);
|
|
28
28
|
}
|
|
29
29
|
getBannerText({ testId: t }) {
|
|
30
|
-
return this.page.getByTestId(n(t,
|
|
30
|
+
return this.page.getByTestId(n(t, S.CONTENT)).textContent();
|
|
31
31
|
}
|
|
32
32
|
hasBannerType({ testId: t, type: e }) {
|
|
33
|
-
return this.page.getByTestId(n(t,
|
|
33
|
+
return this.page.getByTestId(n(t, S.WRAPPER)).locator(`.icon.icon-name--${e}`) !== null;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
class
|
|
36
|
+
class ct {
|
|
37
37
|
constructor(t) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
r(this, "page");
|
|
39
|
+
r(this, "testId");
|
|
40
|
+
r(this, "componentId");
|
|
41
|
+
r(this, "loadedPageSelector");
|
|
42
42
|
this.page = t.page, this.testId = t.testId, this.componentId = t.componentId, this.loadedPageSelector = t.loadedPageSelector;
|
|
43
43
|
}
|
|
44
44
|
async goto(t = {}) {
|
|
@@ -47,16 +47,16 @@ class Z {
|
|
|
47
47
|
...t.additionalComponentParams
|
|
48
48
|
};
|
|
49
49
|
await this.page.goto(
|
|
50
|
-
|
|
50
|
+
Q(
|
|
51
51
|
t.storyId || this.componentId,
|
|
52
52
|
e
|
|
53
53
|
)
|
|
54
54
|
), await this.page.waitForSelector(this.loadedPageSelector);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
class
|
|
57
|
+
class rt {
|
|
58
58
|
constructor(t) {
|
|
59
|
-
|
|
59
|
+
r(this, "page");
|
|
60
60
|
this.page = t;
|
|
61
61
|
}
|
|
62
62
|
async waitForComponent({ testId: t }) {
|
|
@@ -104,97 +104,103 @@ class M {
|
|
|
104
104
|
);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
class
|
|
107
|
+
class Y {
|
|
108
108
|
constructor(t) {
|
|
109
|
-
|
|
109
|
+
r(this, "page");
|
|
110
110
|
this.page = t;
|
|
111
111
|
}
|
|
112
112
|
async waitForComponent({ testId: t }) {
|
|
113
113
|
await this.page.getByTestId(
|
|
114
|
-
n(t,
|
|
114
|
+
n(t, i.WRAPPER)
|
|
115
115
|
);
|
|
116
116
|
}
|
|
117
117
|
async selectDropdownOptionByIndex({
|
|
118
118
|
testId: t,
|
|
119
119
|
index: e
|
|
120
120
|
}) {
|
|
121
|
-
await this.openDropdownComponent({ testId: t }), await this.page.getByTestId(n(t,
|
|
121
|
+
await this.openDropdownComponent({ testId: t }), await this.page.getByTestId(n(t, i.LIST_CONTAINER)).locator("ul > li").nth(e).click();
|
|
122
122
|
}
|
|
123
123
|
getDropdownButtonContent(t) {
|
|
124
|
-
return this.page.getByTestId(n(t,
|
|
124
|
+
return this.page.getByTestId(n(t, i.BUTTON_CONTENT)).textContent();
|
|
125
125
|
}
|
|
126
126
|
async openDropdownComponent({ testId: t }) {
|
|
127
|
-
await this.page.getByTestId(n(t,
|
|
127
|
+
await this.page.getByTestId(n(t, i.TRIGGER)).click({ position: { x: 15, y: 15 } });
|
|
128
128
|
}
|
|
129
129
|
async selectDropdownOptionByName({
|
|
130
130
|
testId: t,
|
|
131
131
|
name: e,
|
|
132
132
|
shouldOpen: o = !0
|
|
133
133
|
}) {
|
|
134
|
-
o && await this.openDropdownComponent({ testId: t }), await this.page.getByTestId(n(t,
|
|
134
|
+
o && await this.openDropdownComponent({ testId: t }), await this.page.getByTestId(n(t, i.LIST_CONTAINER)).locator("ul > li div.text-container", { hasText: e }).click();
|
|
135
|
+
}
|
|
136
|
+
async clearAllOptions({ testId: t }) {
|
|
137
|
+
await this.page.getByTestId(n(t, i.ACTION_CLEAR_ALL)).click();
|
|
135
138
|
}
|
|
136
139
|
async selectMultipleItemsByIndex({ testId: t, itemsToSelect: e }) {
|
|
137
|
-
await this.openDropdownComponent({ testId: t });
|
|
140
|
+
await this.openDropdownComponent({ testId: t }), await this.clearAllOptions({ testId: t });
|
|
138
141
|
for (const o of e)
|
|
139
|
-
await this.page.getByTestId(n(t,
|
|
142
|
+
await this.page.getByTestId(n(t, i.LIST_CONTAINER)).locator("ul > li").nth(o).click();
|
|
140
143
|
}
|
|
141
144
|
async selectMultipleItemsByName({
|
|
142
145
|
testId: t,
|
|
143
|
-
itemsToSelect: e
|
|
146
|
+
itemsToSelect: e,
|
|
147
|
+
shouldClearAll: o
|
|
144
148
|
}) {
|
|
145
|
-
await this.openDropdownComponent({ testId: t })
|
|
146
|
-
|
|
147
|
-
|
|
149
|
+
await this.openDropdownComponent({ testId: t }), o && await this.clearAllOptions({
|
|
150
|
+
testId: t
|
|
151
|
+
});
|
|
152
|
+
for (const s of e)
|
|
153
|
+
await this.page.getByTestId(n(t, i.LIST_CONTAINER)).locator("ul > li span", { hasText: s }).first().click();
|
|
148
154
|
}
|
|
149
155
|
async clickOnApply({ testId: t }) {
|
|
150
|
-
await this.page.getByTestId(n(t,
|
|
156
|
+
await this.page.getByTestId(n(t, i.ACTION_APPLY)).click();
|
|
151
157
|
}
|
|
152
158
|
async clickOnCancel({ testId: t }) {
|
|
153
|
-
await this.page.getByTestId(n(t,
|
|
159
|
+
await this.page.getByTestId(n(t, i.ACTION_CANCEL)).click();
|
|
154
160
|
}
|
|
155
161
|
async isValidationAppear({ testId: t }) {
|
|
156
|
-
return (await this.page.getByTestId(n(t,
|
|
162
|
+
return (await this.page.getByTestId(n(t, i.BUTTON_WRAPPER)).getAttribute("class")).includes("state-error");
|
|
157
163
|
}
|
|
158
164
|
}
|
|
159
|
-
class
|
|
165
|
+
class b {
|
|
160
166
|
constructor(t) {
|
|
161
|
-
|
|
167
|
+
r(this, "page");
|
|
162
168
|
this.page = t;
|
|
163
169
|
}
|
|
164
170
|
getLabelText({ testId: t }) {
|
|
165
|
-
return this.page.getByTestId(n(t,
|
|
171
|
+
return this.page.getByTestId(n(t, R.TEXT)).textContent();
|
|
166
172
|
}
|
|
167
173
|
isMandatory({ testId: t }) {
|
|
168
|
-
return this.page.getByTestId(n(t,
|
|
174
|
+
return this.page.getByTestId(n(t, R.MANDATORY)).isVisible();
|
|
169
175
|
}
|
|
170
176
|
async getHelpIconText({ testId: t }) {
|
|
171
177
|
const e = await this.page.getByTestId(
|
|
172
|
-
n(t,
|
|
178
|
+
n(t, R.TOOLTIP)
|
|
173
179
|
);
|
|
174
180
|
return await e.hover(), e.getAttribute("text");
|
|
175
181
|
}
|
|
176
182
|
}
|
|
177
|
-
class
|
|
183
|
+
class H {
|
|
178
184
|
constructor(t) {
|
|
179
|
-
|
|
185
|
+
r(this, "page");
|
|
180
186
|
this.page = t;
|
|
181
187
|
}
|
|
182
188
|
hasExtraText({ testId: t }) {
|
|
183
|
-
return this.page.getByTestId(n(t,
|
|
189
|
+
return this.page.getByTestId(n(t, E.TEXT)).isVisible();
|
|
184
190
|
}
|
|
185
191
|
getExtraText({ testId: t }) {
|
|
186
|
-
return this.page.getByTestId(n(t,
|
|
192
|
+
return this.page.getByTestId(n(t, E.TEXT)).textContent();
|
|
187
193
|
}
|
|
188
194
|
async hasExtraTextIconType({ testId: t, type: e }) {
|
|
189
|
-
return await (await this.page.getByTestId(n(t,
|
|
195
|
+
return await (await this.page.getByTestId(n(t, E.CONTAINER)).locator(`.icon.icon-name--${e}`)).count() !== 0;
|
|
190
196
|
}
|
|
191
197
|
}
|
|
192
|
-
class
|
|
198
|
+
class Z extends Y {
|
|
193
199
|
constructor(e) {
|
|
194
200
|
super(e);
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
this.fieldLabelComponent = new
|
|
201
|
+
r(this, "fieldLabelComponent");
|
|
202
|
+
r(this, "fieldHelpTextComponent");
|
|
203
|
+
this.fieldLabelComponent = new b(e), this.fieldHelpTextComponent = new H(e);
|
|
198
204
|
}
|
|
199
205
|
getDropdownTitle({ testId: e }) {
|
|
200
206
|
return this.fieldLabelComponent.getLabelText({ testId: e });
|
|
@@ -215,158 +221,155 @@ class X extends G {
|
|
|
215
221
|
return this.fieldHelpTextComponent.hasExtraTextIconType({ testId: e, type: o });
|
|
216
222
|
}
|
|
217
223
|
async getSelectedLabel({ testId: e }) {
|
|
218
|
-
let
|
|
224
|
+
let s = await this.page.getByTestId(n(e, i.BUTTON_CONTENT)).textContent();
|
|
219
225
|
if (await this.page.getByTestId(
|
|
220
|
-
n(e,
|
|
226
|
+
n(e, i.BUTTON_CONTENT_SUFFIX)
|
|
221
227
|
).isVisible({ timeout: 1e3 })) {
|
|
222
|
-
const
|
|
223
|
-
n(e,
|
|
228
|
+
const p = await this.page.getByTestId(
|
|
229
|
+
n(e, i.BUTTON_CONTENT_SUFFIX)
|
|
224
230
|
).textContent();
|
|
225
|
-
|
|
231
|
+
s = `${s}${p}`;
|
|
226
232
|
}
|
|
227
|
-
return
|
|
233
|
+
return s;
|
|
228
234
|
}
|
|
229
235
|
async searchForItem({ testId: e, searchTerm: o }) {
|
|
230
|
-
return await this.openDropdownComponent({ testId: e }), await this.page.getByTestId(n(e,
|
|
236
|
+
return await this.openDropdownComponent({ testId: e }), await this.page.getByTestId(n(e, l.FIELD)).fill(o), this.page.getByTestId(n(e, i.LIST_CONTAINER)).locator("ul > li span").first().textContent();
|
|
231
237
|
}
|
|
232
238
|
async isErrorText({ testId: e }) {
|
|
233
|
-
return await this.page.getByTestId(n(e,
|
|
239
|
+
return await this.page.getByTestId(n(e, E.TEXT)).count() > 0;
|
|
234
240
|
}
|
|
235
241
|
async isDisabled({ testId: e }) {
|
|
236
|
-
return (await this.page.getByTestId(n(e,
|
|
237
|
-
}
|
|
238
|
-
async clearAllOptions({ testId: e }) {
|
|
239
|
-
await this.page.getByTestId(n(e, s.ACTION_CLEAR_ALL)).click();
|
|
242
|
+
return (await this.page.getByTestId(n(e, i.TRIGGER)).locator(".button__container--disabled")).isVisible();
|
|
240
243
|
}
|
|
241
244
|
isSelectAllChecked({ testId: e }) {
|
|
242
|
-
return this.page.getByTestId(n(e,
|
|
245
|
+
return this.page.getByTestId(n(e, i.SELECT_ALL)).locator(".checkbox.input").isChecked();
|
|
243
246
|
}
|
|
244
247
|
isSelectAllIndeterminate({ testId: e }) {
|
|
245
|
-
return this.page.getByTestId(n(e,
|
|
248
|
+
return this.page.getByTestId(n(e, i.SELECT_ALL)).locator(".icon.indeterminate").isVisible();
|
|
246
249
|
}
|
|
247
250
|
async removeChipSelection({ testId: e }) {
|
|
248
|
-
await this.page.getByTestId(n(e,
|
|
251
|
+
await this.page.getByTestId(n(e, i.BUTTON_CLEAR)).click();
|
|
249
252
|
}
|
|
250
253
|
getDropdownOptions({ testId: e }) {
|
|
251
|
-
return this.page.getByTestId(n(e,
|
|
254
|
+
return this.page.getByTestId(n(e, i.LIST_CONTAINER)).locator(".list").allTextContents();
|
|
252
255
|
}
|
|
253
256
|
}
|
|
254
|
-
class
|
|
257
|
+
class lt extends Y {
|
|
255
258
|
constructor(t) {
|
|
256
259
|
super(t);
|
|
257
260
|
}
|
|
258
261
|
getDropdownTitle({ testId: t }) {
|
|
259
|
-
return this.page.getByTestId(n(t,
|
|
262
|
+
return this.page.getByTestId(n(t, i.WRAPPER)).locator("label > span").textContent();
|
|
260
263
|
}
|
|
261
264
|
getSelectedItem({ testId: t }) {
|
|
262
|
-
return this.page.getByTestId(n(t,
|
|
265
|
+
return this.page.getByTestId(n(t, i.TRIGGER)).locator("button > span").textContent();
|
|
263
266
|
}
|
|
264
267
|
async searchForItem({ testId: t, searchTerm: e }) {
|
|
265
|
-
return await this.openDropdownComponent({ testId: t }), await this.page.getByTestId(n(t,
|
|
268
|
+
return await this.openDropdownComponent({ testId: t }), await this.page.getByTestId(n(t, D.FIELD)).fill(e), this.page.getByTestId(n(t, i.LIST_CONTAINER)).locator("ul > li span").first().textContent();
|
|
266
269
|
}
|
|
267
270
|
}
|
|
268
|
-
class
|
|
271
|
+
class pt {
|
|
269
272
|
constructor(t) {
|
|
270
|
-
|
|
273
|
+
r(this, "page");
|
|
271
274
|
this.page = t;
|
|
272
275
|
}
|
|
273
276
|
async waitForComponent({ testId: t }) {
|
|
274
|
-
const e = `[data-testid='${t}-${
|
|
277
|
+
const e = `[data-testid='${t}-${T.TRIGGER}']`;
|
|
275
278
|
await this.page.waitForSelector(e);
|
|
276
279
|
}
|
|
277
280
|
async clickOnApply(t) {
|
|
278
281
|
await this.page.getByTestId(
|
|
279
|
-
n(t,
|
|
282
|
+
n(t, T.ACTION_APPLY)
|
|
280
283
|
).click();
|
|
281
284
|
}
|
|
282
285
|
async clickOnCancel(t) {
|
|
283
286
|
await this.page.getByTestId(
|
|
284
|
-
n(t,
|
|
287
|
+
n(t, T.ACTION_CANCEL)
|
|
285
288
|
).click();
|
|
286
289
|
}
|
|
287
290
|
async openIncludeExcludeComponent(t) {
|
|
288
|
-
await this.page.getByTestId(n(t,
|
|
291
|
+
await this.page.getByTestId(n(t, T.TRIGGER)).click();
|
|
289
292
|
}
|
|
290
293
|
async searchForItem({ testId: t, searchTerm: e }) {
|
|
291
|
-
return await this.openIncludeExcludeComponent(t), await this.page.getByTestId(n(t,
|
|
294
|
+
return await this.openIncludeExcludeComponent(t), await this.page.getByTestId(n(t, T.SEARCH)).locator("input.transparent").fill(e), this.page.getByTestId(n(t, T.LIST)).locator("ul > li .v-popper span").first().textContent();
|
|
292
295
|
}
|
|
293
296
|
async selectItemByName({ testId: t, entityName: e }) {
|
|
294
|
-
await this.openIncludeExcludeComponent(t), await this.page.getByTestId(n(t,
|
|
297
|
+
await this.openIncludeExcludeComponent(t), await this.page.getByTestId(n(t, T.LIST)).locator("ul > li .v-popper span", { hasText: e }).first().click(), await this.clickOnApply(t);
|
|
295
298
|
}
|
|
296
299
|
async selectItemByIndex({ testId: t, index: e, applyChanges: o }) {
|
|
297
|
-
await this.clearAll({ testId: t }), await this.openIncludeExcludeComponent(t), await this.page.getByTestId(n(t,
|
|
300
|
+
await this.clearAll({ testId: t }), await this.openIncludeExcludeComponent(t), await this.page.getByTestId(n(t, T.LIST)).locator(".include-exclude-list ul > li").nth(e).click(), await this.page.waitForSelector("include-exclude-list-header-loading", {
|
|
298
301
|
state: "hidden"
|
|
299
302
|
}), o && await this.clickOnApply(t);
|
|
300
303
|
}
|
|
301
304
|
async selectMultipleItems({ testId: t, itemsToSelect: e }) {
|
|
302
305
|
await this.clearAll({ testId: t }), await this.openIncludeExcludeComponent(t);
|
|
303
306
|
for (const o of e)
|
|
304
|
-
await this.page.getByTestId(n(t,
|
|
307
|
+
await this.page.getByTestId(n(t, T.LIST)).locator(".include-exclude-list ul > li").nth(o).click();
|
|
305
308
|
}
|
|
306
309
|
async unselectItemByName({ testId: t, entityName: e }) {
|
|
307
310
|
await this.openIncludeExcludeComponent(t), await this.page.getByTestId(
|
|
308
|
-
n(t,
|
|
311
|
+
n(t, T.LIST_SELECTED)
|
|
309
312
|
).locator("ul > li", { hasText: e }).locator(".clear-button").click(), await this.clickOnApply(t);
|
|
310
313
|
}
|
|
311
314
|
async unselectByIndex({ testId: t, index: e, applyChanges: o }) {
|
|
312
315
|
await this.page.getByTestId(
|
|
313
|
-
n(t,
|
|
316
|
+
n(t, T.LIST_SELECTED)
|
|
314
317
|
).locator("ul li button").nth(e).click(), o && await this.clickOnApply(t);
|
|
315
318
|
}
|
|
316
319
|
async getSelectedCounter(t) {
|
|
317
320
|
return await this.page.getByTestId(
|
|
318
|
-
n(t,
|
|
321
|
+
n(t, T.LIST_SELECTED)
|
|
319
322
|
).locator(".include-exclude-selected-header-left span").textContent();
|
|
320
323
|
}
|
|
321
324
|
async clearAll({ testId: t }) {
|
|
322
|
-
await this.openIncludeExcludeComponent(t), await this.page.getByTestId(n(t,
|
|
325
|
+
await this.openIncludeExcludeComponent(t), await this.page.getByTestId(n(t, T.CLEAR_ALL)).click(), await this.clickOnApply(t);
|
|
323
326
|
}
|
|
324
327
|
getTriggerText({ testId: t }) {
|
|
325
|
-
return this.page.getByTestId(n(t,
|
|
328
|
+
return this.page.getByTestId(n(t, T.TRIGGER)).locator(".include-exclude-trigger-middle-section .container span").first().textContent();
|
|
326
329
|
}
|
|
327
330
|
getTriggerDescription({ testId: t }) {
|
|
328
|
-
return this.page.getByTestId(n(t,
|
|
331
|
+
return this.page.getByTestId(n(t, T.TRIGGER)).locator("div span.include-exclude-trigger-description").first().textContent();
|
|
329
332
|
}
|
|
330
333
|
async selectAll({ testId: t }) {
|
|
331
|
-
await this.openIncludeExcludeComponent(t), await this.page.getByTestId(n(t,
|
|
334
|
+
await this.openIncludeExcludeComponent(t), await this.page.getByTestId(n(t, T.SELECT_ALL)).click(), await this.clickOnApply(t);
|
|
332
335
|
}
|
|
333
336
|
}
|
|
334
|
-
class
|
|
337
|
+
class J {
|
|
335
338
|
constructor(t) {
|
|
336
|
-
|
|
339
|
+
r(this, "page");
|
|
337
340
|
this.page = t;
|
|
338
341
|
}
|
|
339
342
|
getInputsFieldText({ testId: t }) {
|
|
340
|
-
return this.page.getByTestId(n(t,
|
|
343
|
+
return this.page.getByTestId(n(t, l.FIELD)).inputValue();
|
|
341
344
|
}
|
|
342
345
|
getPlaceholderText({ testId: t }) {
|
|
343
|
-
return this.page.getByTestId(n(t,
|
|
346
|
+
return this.page.getByTestId(n(t, l.FIELD)).getAttribute("placeholder");
|
|
344
347
|
}
|
|
345
348
|
getInputsType({ testId: t }) {
|
|
346
|
-
return this.page.getByTestId(n(t,
|
|
349
|
+
return this.page.getByTestId(n(t, l.FIELD)).getAttribute("type");
|
|
347
350
|
}
|
|
348
351
|
async addInput({ testId: t, text: e }) {
|
|
349
|
-
await this.page.getByTestId(n(t,
|
|
352
|
+
await this.page.getByTestId(n(t, l.FIELD)).type(e);
|
|
350
353
|
}
|
|
351
354
|
async clearInput({ testId: t }) {
|
|
352
|
-
await this.page.getByTestId(n(t,
|
|
355
|
+
await this.page.getByTestId(n(t, l.FIELD)).clear();
|
|
353
356
|
}
|
|
354
357
|
isDisabled({ testId: t }) {
|
|
355
|
-
return this.page.getByTestId(n(t,
|
|
358
|
+
return this.page.getByTestId(n(t, l.FIELD)).isDisabled();
|
|
356
359
|
}
|
|
357
360
|
}
|
|
358
|
-
class
|
|
361
|
+
class gt extends J {
|
|
359
362
|
constructor(e) {
|
|
360
363
|
super(e);
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
this.fieldLabelComponent = new
|
|
364
|
+
r(this, "fieldLabelComponent");
|
|
365
|
+
r(this, "fieldHelpTextComponent");
|
|
366
|
+
this.fieldLabelComponent = new b(e), this.fieldHelpTextComponent = new H(e);
|
|
364
367
|
}
|
|
365
368
|
getInputsLabelText({ testId: e }) {
|
|
366
369
|
return this.fieldLabelComponent.getLabelText({ testId: e });
|
|
367
370
|
}
|
|
368
371
|
async waitForComponent({ testId: e }) {
|
|
369
|
-
const o = `[data-testid='${e}-${
|
|
372
|
+
const o = `[data-testid='${e}-${l.WRAPPER}']`;
|
|
370
373
|
await this.page.waitForSelector(o);
|
|
371
374
|
}
|
|
372
375
|
isInputMandatory({ testId: e }) {
|
|
@@ -379,7 +382,7 @@ class at extends f {
|
|
|
379
382
|
return this.fieldHelpTextComponent.getExtraText({ testId: e });
|
|
380
383
|
}
|
|
381
384
|
async clickOnApplyButton({ testId: e }) {
|
|
382
|
-
await (await this.page.getByTestId(n(e,
|
|
385
|
+
await (await this.page.getByTestId(n(e, l.WRAPPER)).locator(".icon.icon-name--check")).click();
|
|
383
386
|
}
|
|
384
387
|
hasInlineErrorText({
|
|
385
388
|
testId: e,
|
|
@@ -391,26 +394,26 @@ class at extends f {
|
|
|
391
394
|
testId: e,
|
|
392
395
|
inputTestId: o
|
|
393
396
|
}) {
|
|
394
|
-
const
|
|
397
|
+
const s = this.page.getByTestId(
|
|
395
398
|
n(e, o)
|
|
396
399
|
);
|
|
397
|
-
return await
|
|
400
|
+
return await s.hover(), s.getAttribute("text");
|
|
398
401
|
}
|
|
399
402
|
async clickOnShowPassword({ testId: e }) {
|
|
400
403
|
await this.isPasswordHidden({ testId: e }) && await this.clickOnPasswordIcon({ testId: e });
|
|
401
404
|
}
|
|
402
405
|
async clickOnPasswordIcon({ testId: e }) {
|
|
403
|
-
await this.page.getByTestId(n(e,
|
|
406
|
+
await this.page.getByTestId(n(e, l.TOGGLE_PASSWORD)).click();
|
|
404
407
|
}
|
|
405
408
|
async clickOnHidePassword({ testId: e }) {
|
|
406
409
|
await this.isPasswordHidden({ testId: e }) || await this.clickOnPasswordIcon({ testId: e });
|
|
407
410
|
}
|
|
408
411
|
isPasswordHidden({ testId: e }) {
|
|
409
|
-
return this.page.getByTestId(n(e,
|
|
412
|
+
return this.page.getByTestId(n(e, l.TOGGLE_PASSWORD)).locator(".icon.icon-name--eye-slash").isVisible();
|
|
410
413
|
}
|
|
411
414
|
async clearInput({ testId: e }) {
|
|
412
415
|
await (await this.page.getByTestId(
|
|
413
|
-
n(e,
|
|
416
|
+
n(e, l.FIELD)
|
|
414
417
|
)).clear();
|
|
415
418
|
}
|
|
416
419
|
hasExtraTextIconType({ testId: e, type: o }) {
|
|
@@ -418,11 +421,11 @@ class at extends f {
|
|
|
418
421
|
}
|
|
419
422
|
async isDisabled({ testId: e }) {
|
|
420
423
|
return (await this.page.getByTestId(
|
|
421
|
-
n(e,
|
|
424
|
+
n(e, l.FIELD)
|
|
422
425
|
)).isDisabled();
|
|
423
426
|
}
|
|
424
427
|
hasApplyButton({ testId: e }) {
|
|
425
|
-
return this.page.getByTestId(n(e,
|
|
428
|
+
return this.page.getByTestId(n(e, l.WRAPPER)).locator(".icon.icon-name--check").isVisible();
|
|
426
429
|
}
|
|
427
430
|
async getMaxLengthNumber({ testId: e }) {
|
|
428
431
|
return (await this.getFontCaptionText({ testId: e }))[1];
|
|
@@ -431,155 +434,155 @@ class at extends f {
|
|
|
431
434
|
return (await this.getFontCaptionText({ testId: e }))[0];
|
|
432
435
|
}
|
|
433
436
|
async getFontCaptionText({ testId: e }) {
|
|
434
|
-
return (await this.page.getByTestId(n(e,
|
|
437
|
+
return (await this.page.getByTestId(n(e, l.WRAPPER)).locator(".font-caption").textContent()).split("/").map((s) => parseInt(s.trim(), 10));
|
|
435
438
|
}
|
|
436
439
|
getHelpIconText({ testId: e }) {
|
|
437
440
|
return this.fieldLabelComponent.getHelpIconText({ testId: e });
|
|
438
441
|
}
|
|
439
442
|
async isValidationAppear({ testId: e }) {
|
|
440
|
-
return (await this.page.getByTestId(n(e,
|
|
443
|
+
return (await this.page.getByTestId(n(e, l.WRAPPER)).getAttribute("class")).includes("variant-error");
|
|
441
444
|
}
|
|
442
445
|
}
|
|
443
|
-
class
|
|
446
|
+
class Tt {
|
|
444
447
|
constructor(t) {
|
|
445
|
-
|
|
448
|
+
r(this, "page");
|
|
446
449
|
this.page = t;
|
|
447
450
|
}
|
|
448
451
|
async waitForComponent({ testId: t }) {
|
|
449
|
-
const e = `[data-testid='${t}-${
|
|
452
|
+
const e = `[data-testid='${t}-${A.WRAPPER}']`;
|
|
450
453
|
await this.page.waitForSelector(e);
|
|
451
454
|
}
|
|
452
455
|
getSelectedTabText({ testId: t }) {
|
|
453
|
-
return this.page.getByTestId(n(t,
|
|
456
|
+
return this.page.getByTestId(n(t, A.WRAPPER)).locator(".tab-item--active").textContent();
|
|
454
457
|
}
|
|
455
458
|
async selectTab({ testId: t, tabName: e }) {
|
|
456
459
|
const o = await this.getTabIndex({ testId: t, tabName: e });
|
|
457
460
|
await this.page.getByTestId(
|
|
458
|
-
n(t, `${
|
|
461
|
+
n(t, `${A.TAB}-${o + 1}`)
|
|
459
462
|
).click();
|
|
460
463
|
}
|
|
461
464
|
async getTabIndex({ testId: t, tabName: e }) {
|
|
462
|
-
return (await this.page.getByTestId(n(t,
|
|
465
|
+
return (await this.page.getByTestId(n(t, A.WRAPPER)).locator(".tab-item").allTextContents()).indexOf(e);
|
|
463
466
|
}
|
|
464
467
|
async isTabDisabled({ testId: t, tabName: e }) {
|
|
465
468
|
const o = await this.getTabIndex({ testId: t, tabName: e });
|
|
466
|
-
return this.page.getByTestId(n(t, `${
|
|
469
|
+
return this.page.getByTestId(n(t, `${A.TAB}-${o}`)).locator(".tab-item--disabled").isVisible();
|
|
467
470
|
}
|
|
468
471
|
}
|
|
469
|
-
class
|
|
472
|
+
class ht {
|
|
470
473
|
constructor(t) {
|
|
471
|
-
|
|
474
|
+
r(this, "page");
|
|
472
475
|
this.page = t;
|
|
473
476
|
}
|
|
474
477
|
async waitForComponent({ testId: t }) {
|
|
475
|
-
const e = `[data-testid='${t}-${
|
|
478
|
+
const e = `[data-testid='${t}-${P.TRIGGER}']`;
|
|
476
479
|
await this.page.waitForSelector(e);
|
|
477
480
|
}
|
|
478
481
|
getTooltipText({ testId: t }) {
|
|
479
|
-
return this.page.getByTestId(`${t}-${
|
|
482
|
+
return this.page.getByTestId(`${t}-${P.TRIGGER}`).getAttribute("text");
|
|
480
483
|
}
|
|
481
484
|
getTooltipHeaderText({ testId: t }) {
|
|
482
|
-
return this.page.getByTestId(`${t}-${
|
|
485
|
+
return this.page.getByTestId(`${t}-${P.TRIGGER}`).getAttribute("header");
|
|
483
486
|
}
|
|
484
487
|
}
|
|
485
|
-
const
|
|
486
|
-
class
|
|
488
|
+
const x = ".table-row", $ = ".icon-wrapper", V = ".states", f = ".table-head-container", X = ".table-row.loading", M = 1e3;
|
|
489
|
+
class ut {
|
|
487
490
|
constructor(t) {
|
|
488
|
-
|
|
491
|
+
r(this, "page");
|
|
489
492
|
this.page = t;
|
|
490
493
|
}
|
|
491
494
|
async waitForComponent({ testId: t }) {
|
|
492
|
-
const e = `[data-testid='${t}-${
|
|
495
|
+
const e = `[data-testid='${t}-${g.CONTAINER}']`;
|
|
493
496
|
await this.page.waitForSelector(e);
|
|
494
497
|
}
|
|
495
498
|
getTableRowCount({ testId: t }) {
|
|
496
|
-
return this.page.getByTestId(n(t,
|
|
499
|
+
return this.page.getByTestId(n(t, g.BODY_WRAPPER)).locator(x).count();
|
|
497
500
|
}
|
|
498
501
|
async getColumnHeaders({ testId: t }) {
|
|
499
|
-
return this.page.getByTestId(n(t,
|
|
502
|
+
return this.page.getByTestId(n(t, g.TABLE)).locator(f).allTextContents();
|
|
500
503
|
}
|
|
501
504
|
getTableLabel({ testId: t }) {
|
|
502
|
-
return this.page.getByTestId(n(t,
|
|
505
|
+
return this.page.getByTestId(n(t, g.HEADER)).innerText();
|
|
503
506
|
}
|
|
504
507
|
getTableFooter({ testId: t }) {
|
|
505
|
-
return this.page.getByTestId(n(t,
|
|
508
|
+
return this.page.getByTestId(n(t, g.CONTAINER)).locator(".table-footer").innerText();
|
|
506
509
|
}
|
|
507
510
|
async clickOnHeaderByName(t) {
|
|
508
|
-
await this.page.locator(
|
|
511
|
+
await this.page.locator(f, {
|
|
509
512
|
hasText: t
|
|
510
513
|
}).click();
|
|
511
514
|
}
|
|
512
515
|
async searchForItems({ testId: t, searchTerm: e }) {
|
|
513
|
-
await this.clearSearchText({ testId: t }), await this.page.getByTestId(n(t,
|
|
516
|
+
await this.clearSearchText({ testId: t }), await this.page.getByTestId(n(t, l.FIELD)).fill(e);
|
|
514
517
|
}
|
|
515
518
|
async clearSearchText({ testId: t }) {
|
|
516
|
-
await this.page.getByTestId(n(t,
|
|
519
|
+
await this.page.getByTestId(n(t, l.FIELD)).clear(), await this.waitForTableToLoad();
|
|
517
520
|
}
|
|
518
521
|
isArrowVisible({ testId: t, headerName: e }) {
|
|
519
|
-
return this.page.getByTestId(n(t,
|
|
522
|
+
return this.page.getByTestId(n(t, g.TABLE)).locator(f, { hasText: e }).locator(".table-sort-icon").isVisible();
|
|
520
523
|
}
|
|
521
524
|
async scrollDownTableRows({ testId: t }) {
|
|
522
525
|
const e = `[data-testid=${n(
|
|
523
526
|
t,
|
|
524
|
-
|
|
527
|
+
g.TABLE
|
|
525
528
|
)}]`;
|
|
526
529
|
await this.page.focus(e), await this.page.evaluate((o) => {
|
|
527
|
-
const
|
|
528
|
-
|
|
529
|
-
}, e), await this.page.waitForTimeout(
|
|
530
|
+
const s = document.querySelector(o);
|
|
531
|
+
s && (s.scrollTop = s.scrollHeight);
|
|
532
|
+
}, e), await this.page.waitForTimeout(M);
|
|
530
533
|
}
|
|
531
534
|
async waitForTableToLoad() {
|
|
532
|
-
await this.page.waitForSelector(
|
|
535
|
+
await this.page.waitForSelector(X, {
|
|
533
536
|
state: "hidden"
|
|
534
537
|
});
|
|
535
538
|
}
|
|
536
539
|
async waitingForTableLoadingToAppear() {
|
|
537
|
-
await this.page.waitForSelector(
|
|
540
|
+
await this.page.waitForSelector(X);
|
|
538
541
|
}
|
|
539
542
|
async expandRow({ testId: t, rowValue: e }) {
|
|
540
|
-
await this.page.getByTestId(n(t,
|
|
543
|
+
await this.page.getByTestId(n(t, g.BODY_WRAPPER)).locator(x, { hasText: e }).locator($).click();
|
|
541
544
|
}
|
|
542
545
|
isRowExpanded({ testId: t, rowValue: e }) {
|
|
543
|
-
return this.page.getByTestId(n(t,
|
|
546
|
+
return this.page.getByTestId(n(t, g.BODY_WRAPPER)).locator(x, { hasText: e }).locator($).isVisible();
|
|
544
547
|
}
|
|
545
548
|
async getExpandedRowContent({ testId: t, rowValue: e }) {
|
|
546
549
|
return await this.isRowExpanded({
|
|
547
550
|
testId: t,
|
|
548
551
|
rowValue: e
|
|
549
|
-
}) || await this.expandRow({ testId: t, rowValue: e }), this.page.getByTestId(n(t,
|
|
552
|
+
}) || await this.expandRow({ testId: t, rowValue: e }), this.page.getByTestId(n(t, g.BODY_WRAPPER)).locator(x, { hasText: e }).locator($).textContent();
|
|
550
553
|
}
|
|
551
554
|
isEmptyStateVisible({ testId: t }) {
|
|
552
|
-
return this.page.getByTestId(n(t,
|
|
555
|
+
return this.page.getByTestId(n(t, g.TABLE)).locator(".empty-state").isVisible();
|
|
553
556
|
}
|
|
554
557
|
getEmptyStateTitle({ testId: t }) {
|
|
555
|
-
return this.page.getByTestId(n(t,
|
|
558
|
+
return this.page.getByTestId(n(t, g.TABLE)).locator(".font-heading-4.title").textContent();
|
|
556
559
|
}
|
|
557
560
|
getEmptyStateSubtitle({ testId: t }) {
|
|
558
|
-
return this.page.getByTestId(n(t,
|
|
561
|
+
return this.page.getByTestId(n(t, g.TABLE)).locator(".font-body-1.subtitle").textContent();
|
|
559
562
|
}
|
|
560
563
|
async clickOnRowCheckboxByRowValue({ testId: t, rowValue: e }) {
|
|
561
|
-
await this.page.getByTestId(n(t,
|
|
564
|
+
await this.page.getByTestId(n(t, g.TABLE)).locator(x, {
|
|
562
565
|
hasText: e
|
|
563
|
-
}).locator(
|
|
566
|
+
}).locator(V).click();
|
|
564
567
|
}
|
|
565
568
|
getCheckedRowsNumber({ testId: t }) {
|
|
566
|
-
return this.page.getByTestId(n(t,
|
|
569
|
+
return this.page.getByTestId(n(t, g.TABLE)).locator(x).locator(".icon.checked").count();
|
|
567
570
|
}
|
|
568
571
|
async clickOnSelectAllCheckbox({ testId: t }) {
|
|
569
|
-
await this.page.getByTestId(n(t,
|
|
572
|
+
await this.page.getByTestId(n(t, g.TABLE)).locator(V).nth(0).click();
|
|
570
573
|
}
|
|
571
574
|
getTableLocator({ testId: t }) {
|
|
572
575
|
return this.page.getByTestId(
|
|
573
|
-
n(t,
|
|
576
|
+
n(t, g.CONTAINER)
|
|
574
577
|
);
|
|
575
578
|
}
|
|
576
579
|
getColumnContentByHeaderName({ testId: t, headerName: e }) {
|
|
577
580
|
return this.getTableLocator({ testId: t }).locator(e).allTextContents();
|
|
578
581
|
}
|
|
579
582
|
}
|
|
580
|
-
class
|
|
583
|
+
class tt {
|
|
581
584
|
constructor(t) {
|
|
582
|
-
|
|
585
|
+
r(this, "page");
|
|
583
586
|
this.page = t;
|
|
584
587
|
}
|
|
585
588
|
async waitForComponent({ testId: t }) {
|
|
@@ -599,219 +602,219 @@ class K {
|
|
|
599
602
|
return this.page.getByTestId(t).isDisabled();
|
|
600
603
|
}
|
|
601
604
|
}
|
|
602
|
-
class
|
|
605
|
+
class dt {
|
|
603
606
|
constructor(t) {
|
|
604
|
-
|
|
607
|
+
r(this, "page");
|
|
605
608
|
this.page = t;
|
|
606
609
|
}
|
|
607
610
|
async waitForComponent({ testId: t }) {
|
|
608
|
-
const e = `[data-testid='${t}-${
|
|
611
|
+
const e = `[data-testid='${t}-${w.CONTAINER}']`;
|
|
609
612
|
await this.page.waitForSelector(e);
|
|
610
613
|
}
|
|
611
614
|
getSnackbarTitle({ testId: t }) {
|
|
612
|
-
return this.page.getByTestId(n(t,
|
|
615
|
+
return this.page.getByTestId(n(t, w.TITLE)).textContent();
|
|
613
616
|
}
|
|
614
617
|
async closeSnackbar({ testId: t }) {
|
|
615
|
-
await this.page.getByTestId(n(t,
|
|
618
|
+
await this.page.getByTestId(n(t, w.CLOSE)).locator(".icon-name--x").click();
|
|
616
619
|
}
|
|
617
620
|
async waitForSnackbarToBeClosed({ testId: t }) {
|
|
618
|
-
const e = `[data-testid='${t}-${
|
|
621
|
+
const e = `[data-testid='${t}-${w.CONTAINER}']`;
|
|
619
622
|
await this.page.waitForSelector(e, { state: "detached" });
|
|
620
623
|
}
|
|
621
624
|
getSnackbarDescription({ testId: t }) {
|
|
622
|
-
return this.page.getByTestId(n(t,
|
|
625
|
+
return this.page.getByTestId(n(t, w.MESSAGE)).textContent();
|
|
623
626
|
}
|
|
624
627
|
async clickOnActionButton({ testId: t, buttonName: e }) {
|
|
625
628
|
const o = await this.getActionButtonIndex({
|
|
626
629
|
testId: t,
|
|
627
630
|
buttonName: e
|
|
628
|
-
}),
|
|
629
|
-
await this.page.click(
|
|
631
|
+
}), s = `[data-testid='${t}-${w.ACTION_BUTTON}-${o}']`;
|
|
632
|
+
await this.page.click(s);
|
|
630
633
|
}
|
|
631
634
|
async getActionButtonIndex({
|
|
632
635
|
testId: t,
|
|
633
636
|
buttonName: e
|
|
634
637
|
}) {
|
|
635
|
-
return (await this.page.getByTestId(n(t,
|
|
638
|
+
return (await this.page.getByTestId(n(t, w.CONTAINER)).locator(".font-button").allTextContents()).indexOf(e);
|
|
636
639
|
}
|
|
637
640
|
}
|
|
638
|
-
class
|
|
641
|
+
class yt {
|
|
639
642
|
constructor(t) {
|
|
640
|
-
|
|
643
|
+
r(this, "page");
|
|
641
644
|
this.page = t;
|
|
642
645
|
}
|
|
643
646
|
async waitForComponent({ testId: t }) {
|
|
644
|
-
const e = `[data-testid='${t}-${
|
|
647
|
+
const e = `[data-testid='${t}-${L.WRAPPER}']`;
|
|
645
648
|
await this.page.waitForSelector(e);
|
|
646
649
|
}
|
|
647
650
|
async closeMultiBar({ testId: t }) {
|
|
648
|
-
await this.page.getByTestId(n(t,
|
|
651
|
+
await this.page.getByTestId(n(t, L.CLOSE_BTN)).locator(".icon-wrapper").click();
|
|
649
652
|
}
|
|
650
653
|
getMultiBarCountText({ testId: t }) {
|
|
651
|
-
return this.page.getByTestId(n(t,
|
|
654
|
+
return this.page.getByTestId(n(t, L.WRAPPER)).locator(".count-text").textContent();
|
|
652
655
|
}
|
|
653
656
|
async isMultiBarVisible({ testId: t }) {
|
|
654
|
-
return await this.page.waitForTimeout(1e3), this.page.getByTestId(n(t,
|
|
657
|
+
return await this.page.waitForTimeout(1e3), this.page.getByTestId(n(t, L.WRAPPER)).locator(".multi-bar-panel").isVisible();
|
|
655
658
|
}
|
|
656
659
|
async clickOnActionButton({ testId: t, actionButtonId: e }) {
|
|
657
660
|
await this.page.getByTestId(
|
|
658
661
|
n(
|
|
659
662
|
t,
|
|
660
|
-
`${
|
|
663
|
+
`${L.ACTION}-${e}`
|
|
661
664
|
)
|
|
662
665
|
).locator(".start-icon").click();
|
|
663
666
|
}
|
|
664
667
|
}
|
|
665
|
-
class
|
|
668
|
+
class wt {
|
|
666
669
|
constructor(t) {
|
|
667
|
-
|
|
670
|
+
r(this, "page");
|
|
668
671
|
this.page = t;
|
|
669
672
|
}
|
|
670
673
|
async waitForComponent({ testId: t }) {
|
|
671
|
-
const e = `[data-testid='${t}-${
|
|
674
|
+
const e = `[data-testid='${t}-${R.TEXT}']`;
|
|
672
675
|
await this.page.waitForSelector(e);
|
|
673
676
|
}
|
|
674
677
|
getFormRowTitle({ testId: t }) {
|
|
675
|
-
return new
|
|
678
|
+
return new b(this.page).getLabelText({ testId: t });
|
|
676
679
|
}
|
|
677
680
|
isFormRowMandatory({ testId: t }) {
|
|
678
|
-
return new
|
|
681
|
+
return new b(this.page).isMandatory({ testId: t });
|
|
679
682
|
}
|
|
680
683
|
getIconText({ testId: t }) {
|
|
681
|
-
return new
|
|
684
|
+
return new H(this.page).getExtraText({ testId: t });
|
|
682
685
|
}
|
|
683
686
|
}
|
|
684
|
-
class
|
|
687
|
+
class Et {
|
|
685
688
|
constructor(t) {
|
|
686
|
-
|
|
689
|
+
r(this, "page");
|
|
687
690
|
this.page = t;
|
|
688
691
|
}
|
|
689
692
|
async waitForComponent({ testId: t }) {
|
|
690
|
-
const e = `[data-testid='${t}-${
|
|
693
|
+
const e = `[data-testid='${t}-${I.CONTENT}']`;
|
|
691
694
|
await this.page.waitForSelector(e);
|
|
692
695
|
}
|
|
693
696
|
getCardTitle({ testId: t }) {
|
|
694
|
-
return this.page.getByTestId(n(t,
|
|
697
|
+
return this.page.getByTestId(n(t, I.TITLE)).textContent();
|
|
695
698
|
}
|
|
696
699
|
getCardContentText({ testId: t }) {
|
|
697
|
-
return this.page.getByTestId(n(t,
|
|
700
|
+
return this.page.getByTestId(n(t, I.CONTENT)).textContent();
|
|
698
701
|
}
|
|
699
702
|
getCardLabelText({ testId: t }) {
|
|
700
|
-
return new
|
|
703
|
+
return new b(this.page).getLabelText({ testId: t });
|
|
701
704
|
}
|
|
702
705
|
async clickOnSaveButton({ testId: t }) {
|
|
703
|
-
await this.page.getByTestId(n(t,
|
|
706
|
+
await this.page.getByTestId(n(t, I.SAVE_BUTTON)).click();
|
|
704
707
|
}
|
|
705
708
|
async clickOnCancelButton({ testId: t }) {
|
|
706
|
-
await this.page.getByTestId(n(t,
|
|
709
|
+
await this.page.getByTestId(n(t, I.CANCEL_BUTTON)).click();
|
|
707
710
|
}
|
|
708
711
|
isSaveButtonLoading({ testId: t }) {
|
|
709
|
-
return new
|
|
712
|
+
return new tt(this.page).isButtonLoading({ testId: t });
|
|
710
713
|
}
|
|
711
714
|
async clearForm({
|
|
712
715
|
testId: t,
|
|
713
716
|
inputType: e
|
|
714
717
|
}) {
|
|
715
|
-
(await this.page.getByTestId(n(t,
|
|
718
|
+
(await this.page.getByTestId(n(t, I.CONTENT)).locator(
|
|
716
719
|
`[data-testid='ad-units-form-card-form-card-content'] input[type='${e}']`
|
|
717
|
-
).all()).forEach((
|
|
720
|
+
).all()).forEach((s) => s.clear());
|
|
718
721
|
}
|
|
719
722
|
}
|
|
720
|
-
class
|
|
723
|
+
class O extends J {
|
|
721
724
|
constructor(t) {
|
|
722
725
|
super(t);
|
|
723
726
|
}
|
|
724
727
|
async waitForComponent({ testId: t }) {
|
|
725
|
-
const e = `[data-testid='${t}-${
|
|
728
|
+
const e = `[data-testid='${t}-${l.WRAPPER}']`;
|
|
726
729
|
await this.page.waitForSelector(e);
|
|
727
730
|
}
|
|
728
731
|
async isViewOnly({ testId: t }) {
|
|
729
|
-
return await this.page.getByTestId(n(t,
|
|
732
|
+
return await this.page.getByTestId(n(t, l.WRAPPER)).locator(".view-only.input-type").count() > 0;
|
|
730
733
|
}
|
|
731
734
|
getLabel({ testId: t }) {
|
|
732
|
-
return this.page.getByTestId(n(t,
|
|
735
|
+
return this.page.getByTestId(n(t, l.LABEL_TEXT)).textContent();
|
|
733
736
|
}
|
|
734
737
|
isInputMandatory({ testId: t }) {
|
|
735
|
-
return this.page.getByTestId(n(t,
|
|
738
|
+
return this.page.getByTestId(n(t, l.MANDATORY)).isVisible();
|
|
736
739
|
}
|
|
737
740
|
hasInputExtraHelpText({ testId: t }) {
|
|
738
|
-
return this.page.getByTestId(n(t,
|
|
741
|
+
return this.page.getByTestId(n(t, l.EXTRA_TEXT)).isVisible();
|
|
739
742
|
}
|
|
740
743
|
async getHelpIconText({ testId: t }) {
|
|
741
|
-
const e = await this.page.getByTestId(n(t,
|
|
744
|
+
const e = await this.page.getByTestId(n(t, l.LABEL_CONTAINER)).locator(".v-popper.v-popper--theme-default");
|
|
742
745
|
return await e.hover(), e.getAttribute("text");
|
|
743
746
|
}
|
|
744
747
|
getInputExtraText({ testId: t }) {
|
|
745
|
-
return this.page.getByTestId(n(t,
|
|
748
|
+
return this.page.getByTestId(n(t, l.EXTRA_TEXT)).textContent();
|
|
746
749
|
}
|
|
747
750
|
getErrorExtraText({ testId: t }) {
|
|
748
|
-
return this.page.getByTestId(n(t,
|
|
751
|
+
return this.page.getByTestId(n(t, l.EXTRA_TEXT)).locator(".error").textContent();
|
|
749
752
|
}
|
|
750
753
|
async showPassword({ testId: t }) {
|
|
751
754
|
await this.isPasswordHidden({ testId: t }) && await this.clickOnPasswordButton({ testId: t });
|
|
752
755
|
}
|
|
753
756
|
async isPasswordHidden({ testId: t }) {
|
|
754
|
-
return await this.page.getByTestId(n(t,
|
|
757
|
+
return await this.page.getByTestId(n(t, l.WRAPPER)).getAttribute("type") === "password";
|
|
755
758
|
}
|
|
756
759
|
async clickOnPasswordButton({ testId: t }) {
|
|
757
|
-
await (await this.page.getByTestId(n(t,
|
|
760
|
+
await (await this.page.getByTestId(n(t, l.WRAPPER)).locator(".password-visibility")).click();
|
|
758
761
|
}
|
|
759
762
|
}
|
|
760
|
-
class
|
|
763
|
+
class Ct {
|
|
761
764
|
constructor(t) {
|
|
762
|
-
|
|
765
|
+
r(this, "page");
|
|
763
766
|
this.page = t;
|
|
764
767
|
}
|
|
765
768
|
async waitForComponent({ testId: t }) {
|
|
766
|
-
const e = `[data-testid='${t}-${
|
|
769
|
+
const e = `[data-testid='${t}-${D.CONTAINER}']`;
|
|
767
770
|
await this.page.waitForSelector(e);
|
|
768
771
|
}
|
|
769
772
|
async searchInput({ testId: t, searchTerm: e }) {
|
|
770
|
-
await new
|
|
773
|
+
await new O(this.page).addInput({ testId: t, text: e });
|
|
771
774
|
}
|
|
772
775
|
async clearInput({ testId: t }) {
|
|
773
|
-
await new
|
|
776
|
+
await new O(this.page).clearInput({ testId: t });
|
|
774
777
|
}
|
|
775
778
|
async clickOnXButton({ testId: t }) {
|
|
776
|
-
await this.page.getByTestId(n(t,
|
|
779
|
+
await this.page.getByTestId(n(t, D.CLEAR)).locator(".icon-name--x-circle").click();
|
|
777
780
|
}
|
|
778
781
|
isDisabled({ testId: t }) {
|
|
779
|
-
return new
|
|
782
|
+
return new O(this.page).isDisabled({ testId: t });
|
|
780
783
|
}
|
|
781
784
|
getSearchPlaceholder({ testId: t }) {
|
|
782
|
-
return new
|
|
785
|
+
return new O(this.page).getPlaceholderText({ testId: t });
|
|
783
786
|
}
|
|
784
787
|
getSearchInputValue({ testId: t }) {
|
|
785
|
-
return new
|
|
788
|
+
return new O(this.page).getInputsFieldText({ testId: t });
|
|
786
789
|
}
|
|
787
790
|
}
|
|
788
|
-
class
|
|
791
|
+
class et {
|
|
789
792
|
constructor(t) {
|
|
790
|
-
|
|
793
|
+
r(this, "page");
|
|
791
794
|
this.page = t;
|
|
792
795
|
}
|
|
793
796
|
async waitForComponent({ testId: t }) {
|
|
794
|
-
const e = `[data-testid='${t}-${
|
|
797
|
+
const e = `[data-testid='${t}-${G.TEXT}']`;
|
|
795
798
|
await this.page.waitForSelector(e);
|
|
796
799
|
}
|
|
797
800
|
getInlineCopyText({ testId: t }) {
|
|
798
|
-
return this.page.getByTestId(`${t}-${
|
|
801
|
+
return this.page.getByTestId(`${t}-${G.TEXT}`).textContent();
|
|
799
802
|
}
|
|
800
803
|
}
|
|
801
|
-
class
|
|
804
|
+
class mt {
|
|
802
805
|
constructor(t) {
|
|
803
|
-
|
|
806
|
+
r(this, "page");
|
|
804
807
|
this.page = t;
|
|
805
808
|
}
|
|
806
809
|
async waitForComponent({ testId: t }) {
|
|
807
|
-
const e = `[data-testid='${t}-${
|
|
810
|
+
const e = `[data-testid='${t}-${_.TITLE}']`;
|
|
808
811
|
await this.page.waitForSelector(e);
|
|
809
812
|
}
|
|
810
813
|
getHeaderTitle({ testId: t }) {
|
|
811
|
-
return this.page.getByTestId(`${t}-${
|
|
814
|
+
return this.page.getByTestId(`${t}-${_.TITLE}`).textContent();
|
|
812
815
|
}
|
|
813
816
|
getInlineCopyText({ testId: t }) {
|
|
814
|
-
return new
|
|
817
|
+
return new et(this.page).getInlineCopyText({
|
|
815
818
|
testId: t
|
|
816
819
|
});
|
|
817
820
|
}
|
|
@@ -819,12 +822,12 @@ class gt {
|
|
|
819
822
|
testId: t,
|
|
820
823
|
iconName: e
|
|
821
824
|
}) {
|
|
822
|
-
return await this.page.getByTestId(`${t}-${
|
|
825
|
+
return await this.page.getByTestId(`${t}-${_.APP_PLATFORM}`).getAttribute("data-platform") === e;
|
|
823
826
|
}
|
|
824
827
|
}
|
|
825
|
-
class
|
|
828
|
+
class It {
|
|
826
829
|
constructor(t) {
|
|
827
|
-
|
|
830
|
+
r(this, "page");
|
|
828
831
|
this.page = t;
|
|
829
832
|
}
|
|
830
833
|
async waitForComponent({ testId: t }) {
|
|
@@ -855,43 +858,43 @@ class Tt {
|
|
|
855
858
|
return this.page.getByTestId(n(t, d.WRAPPER)).getAttribute("class");
|
|
856
859
|
}
|
|
857
860
|
}
|
|
858
|
-
class
|
|
861
|
+
class at {
|
|
859
862
|
constructor(t) {
|
|
860
|
-
|
|
863
|
+
r(this, "page");
|
|
861
864
|
this.page = t;
|
|
862
865
|
}
|
|
863
866
|
async waitForComponent({ testId: t }) {
|
|
864
|
-
const e = `[data-testid='${t}-${
|
|
867
|
+
const e = `[data-testid='${t}-${C.FIELD}']`;
|
|
865
868
|
await this.page.waitForSelector(e);
|
|
866
869
|
}
|
|
867
870
|
async addInput({ testId: t, text: e }) {
|
|
868
|
-
await this.page.getByTestId(n(t,
|
|
871
|
+
await this.page.getByTestId(n(t, C.FIELD)).type(e);
|
|
869
872
|
}
|
|
870
873
|
async clearInput({ testId: t }) {
|
|
871
|
-
await this.page.getByTestId(n(t,
|
|
874
|
+
await this.page.getByTestId(n(t, C.FIELD)).clear();
|
|
872
875
|
}
|
|
873
876
|
getInput({ testId: t }) {
|
|
874
|
-
return this.page.getByTestId(n(t,
|
|
877
|
+
return this.page.getByTestId(n(t, C.FIELD)).inputValue();
|
|
875
878
|
}
|
|
876
879
|
getPlaceholderText({ testId: t }) {
|
|
877
|
-
return this.page.getByTestId(n(t,
|
|
880
|
+
return this.page.getByTestId(n(t, C.FIELD)).getAttribute("placeholder");
|
|
878
881
|
}
|
|
879
882
|
isDisabled({ testId: t }) {
|
|
880
|
-
return this.page.getByTestId(n(t,
|
|
883
|
+
return this.page.getByTestId(n(t, C.FIELD)).isDisabled();
|
|
881
884
|
}
|
|
882
885
|
}
|
|
883
|
-
class
|
|
886
|
+
class Bt extends at {
|
|
884
887
|
getLabelText({ testId: t }) {
|
|
885
|
-
return this.page.getByTestId(n(t,
|
|
888
|
+
return this.page.getByTestId(n(t, R.TEXT)).textContent();
|
|
886
889
|
}
|
|
887
890
|
hasFieldHelpText({ testId: t }) {
|
|
888
|
-
return this.page.getByTestId(n(t,
|
|
891
|
+
return this.page.getByTestId(n(t, E.CONTAINER)).isVisible();
|
|
889
892
|
}
|
|
890
893
|
getFieldHelpText({ testId: t }) {
|
|
891
|
-
return this.page.getByTestId(n(t,
|
|
894
|
+
return this.page.getByTestId(n(t, E.CONTAINER)).textContent();
|
|
892
895
|
}
|
|
893
896
|
}
|
|
894
|
-
class
|
|
897
|
+
class xt extends Z {
|
|
895
898
|
constructor(t) {
|
|
896
899
|
super(t);
|
|
897
900
|
}
|
|
@@ -914,37 +917,37 @@ class ut extends X {
|
|
|
914
917
|
return this.fieldHelpTextComponent.hasExtraTextIconType({ testId: t, type: e });
|
|
915
918
|
}
|
|
916
919
|
getSelectedLabel({ testId: t }) {
|
|
917
|
-
return this.page.getByTestId(n(t,
|
|
920
|
+
return this.page.getByTestId(n(t, i.BUTTON_CONTENT)).textContent();
|
|
918
921
|
}
|
|
919
922
|
async searchForItem({ testId: t, searchTerm: e }) {
|
|
920
|
-
return await this.openDropdownComponent({ testId: t }), await this.page.getByTestId(n(t,
|
|
923
|
+
return await this.openDropdownComponent({ testId: t }), await this.page.getByTestId(n(t, l.FIELD)).fill(e), this.page.getByTestId(n(t, i.LIST_CONTAINER)).locator("ul > li span").first().textContent();
|
|
921
924
|
}
|
|
922
925
|
async isErrorText({ testId: t }) {
|
|
923
|
-
return await this.page.getByTestId(n(t,
|
|
926
|
+
return await this.page.getByTestId(n(t, E.TEXT)).count() > 0;
|
|
924
927
|
}
|
|
925
928
|
async isDisabled({ testId: t }) {
|
|
926
|
-
return (await this.page.getByTestId(n(t,
|
|
929
|
+
return (await this.page.getByTestId(n(t, i.TRIGGER)).locator(".button__container--disabled")).isVisible();
|
|
927
930
|
}
|
|
928
931
|
async clearAllOptions({ testId: t }) {
|
|
929
|
-
await this.page.getByTestId(n(t,
|
|
932
|
+
await this.page.getByTestId(n(t, i.ACTION_CLEAR_ALL)).click();
|
|
930
933
|
}
|
|
931
934
|
isSelectAllChecked({ testId: t }) {
|
|
932
|
-
return this.page.getByTestId(n(t,
|
|
935
|
+
return this.page.getByTestId(n(t, i.SELECT_ALL)).locator(".checkbox.input").isChecked();
|
|
933
936
|
}
|
|
934
937
|
isSelectAllIndeterminate({ testId: t }) {
|
|
935
|
-
return this.page.getByTestId(n(t,
|
|
938
|
+
return this.page.getByTestId(n(t, i.SELECT_ALL)).locator(".icon.indeterminate").isVisible();
|
|
936
939
|
}
|
|
937
940
|
async removeChipSelection({ testId: t }) {
|
|
938
|
-
await this.page.getByTestId(n(t,
|
|
941
|
+
await this.page.getByTestId(n(t, i.BUTTON_CLEAR)).click();
|
|
939
942
|
}
|
|
940
943
|
getDropdownOptions({ testId: t }) {
|
|
941
|
-
return this.page.getByTestId(n(t,
|
|
944
|
+
return this.page.getByTestId(n(t, i.LIST_CONTAINER)).locator(".list").allTextContents();
|
|
942
945
|
}
|
|
943
946
|
async expandTreeNode({
|
|
944
947
|
testId: t,
|
|
945
948
|
nodeName: e
|
|
946
949
|
}) {
|
|
947
|
-
const o = this.page.getByTestId(n(t,
|
|
950
|
+
const o = this.page.getByTestId(n(t, i.LIST_CONTAINER)).locator(".item--multi", { hasText: e }).locator(".tree-main-arrow-wrapper");
|
|
948
951
|
if (await o.isVisible())
|
|
949
952
|
await o.click();
|
|
950
953
|
else
|
|
@@ -952,179 +955,343 @@ class ut extends X {
|
|
|
952
955
|
}
|
|
953
956
|
async selectTreeDropdownOptionByName({
|
|
954
957
|
testId: t,
|
|
955
|
-
|
|
956
|
-
|
|
958
|
+
node: e,
|
|
959
|
+
item: o,
|
|
960
|
+
shouldExpand: s = !1
|
|
957
961
|
}) {
|
|
958
|
-
await this.openDropdownComponent({ testId: t }),
|
|
959
|
-
const
|
|
960
|
-
if (await
|
|
961
|
-
await
|
|
962
|
+
await this.openDropdownComponent({ testId: t }), s && await this.expandTreeNode({ testId: t, nodeName: e });
|
|
963
|
+
const c = this.page.getByTestId(n(t, i.LIST_CONTAINER)).locator(`text=${o}`);
|
|
964
|
+
if (await c.isVisible())
|
|
965
|
+
await c.click();
|
|
962
966
|
else
|
|
963
|
-
throw new Error(`Option with text "${
|
|
967
|
+
throw new Error(`Option with text "${o}" not found in the dropdown.`);
|
|
964
968
|
}
|
|
965
969
|
async selectMultipleTreeItemsByName({
|
|
966
970
|
testId: t,
|
|
967
|
-
itemsToSelect: e
|
|
971
|
+
itemsToSelect: e,
|
|
972
|
+
node: o
|
|
968
973
|
}) {
|
|
969
974
|
await this.openDropdownComponent({ testId: t });
|
|
970
|
-
for (const
|
|
975
|
+
for (const s of e)
|
|
971
976
|
await this.selectTreeDropdownOptionByName({
|
|
972
977
|
testId: t,
|
|
973
|
-
|
|
978
|
+
node: o,
|
|
979
|
+
item: s,
|
|
974
980
|
shouldExpand: !0
|
|
975
981
|
});
|
|
976
982
|
await this.clickOnApply({ testId: t });
|
|
977
983
|
}
|
|
978
984
|
}
|
|
979
|
-
const
|
|
980
|
-
class
|
|
985
|
+
const nt = ".sortable-item";
|
|
986
|
+
class At {
|
|
981
987
|
constructor(t) {
|
|
982
|
-
|
|
988
|
+
r(this, "page");
|
|
983
989
|
this.page = t;
|
|
984
990
|
}
|
|
985
991
|
async waitForComponent({ testId: t }) {
|
|
986
|
-
const e = `[data-testid='${t}-${
|
|
992
|
+
const e = `[data-testid='${t}-${h.CONTAINER}']`;
|
|
987
993
|
await this.page.waitForSelector(e);
|
|
988
994
|
}
|
|
989
995
|
async isComponentLoaded(t) {
|
|
990
|
-
const e = `[data-testid='${t}-${
|
|
996
|
+
const e = `[data-testid='${t}-${h.CONTAINER}']`;
|
|
991
997
|
return this.page.isVisible(e);
|
|
992
998
|
}
|
|
993
999
|
async getItems(t) {
|
|
994
|
-
return this.page.getByTestId(n(t, "sortable-
|
|
1000
|
+
return this.page.getByTestId(n(t, h.CONTAINER)).locator(".sortable-item").allTextContents();
|
|
995
1001
|
}
|
|
996
1002
|
async sortItem(t, e, o) {
|
|
997
|
-
const
|
|
1003
|
+
const s = await this.page.getByTestId(
|
|
998
1004
|
n(t, "sortable-list-item")
|
|
999
|
-
),
|
|
1000
|
-
await
|
|
1005
|
+
), c = s.nth(e), p = s.nth(o);
|
|
1006
|
+
await c.dragTo(p);
|
|
1001
1007
|
}
|
|
1002
1008
|
async verifyOrder(t, e) {
|
|
1003
|
-
return (await this.getItems(t)).every((
|
|
1009
|
+
return (await this.getItems(t)).every((s, c) => s === e[c]);
|
|
1004
1010
|
}
|
|
1005
1011
|
async getListItemLocator({ testId: t, item: e, modifier: o }) {
|
|
1006
|
-
return this.page.getByTestId(n(t, o)).locator(
|
|
1012
|
+
return this.page.getByTestId(n(t, o)).locator(nt, {
|
|
1007
1013
|
hasText: e
|
|
1008
1014
|
});
|
|
1009
1015
|
}
|
|
1010
1016
|
async selectItem({ testId: t, item: e, isLockedItem: o }) {
|
|
1011
|
-
const
|
|
1017
|
+
const s = o ? h.LOCKED_LIST : h.DRAGGABLE_LIST;
|
|
1012
1018
|
await (await this.getListItemLocator({
|
|
1013
1019
|
testId: t,
|
|
1014
1020
|
item: e,
|
|
1015
|
-
modifier:
|
|
1021
|
+
modifier: s
|
|
1016
1022
|
})).click();
|
|
1017
1023
|
}
|
|
1018
1024
|
async isItemSelected(t) {
|
|
1019
1025
|
return await this.page.locator(".sortable-item--selected", { hasText: t }).count() > 0;
|
|
1020
1026
|
}
|
|
1021
1027
|
async expandItem({ testId: t, item: e, isLockedItem: o }) {
|
|
1022
|
-
const
|
|
1028
|
+
const s = o ? h.LOCKED_LIST : h.DRAGGABLE_LIST;
|
|
1023
1029
|
await (await this.getListItemLocator({
|
|
1024
1030
|
testId: t,
|
|
1025
1031
|
item: e,
|
|
1026
|
-
modifier:
|
|
1032
|
+
modifier: s
|
|
1027
1033
|
})).locator(".expand-icon").click();
|
|
1028
1034
|
}
|
|
1029
1035
|
async selectChildItem({
|
|
1030
1036
|
testId: t,
|
|
1031
1037
|
item: e,
|
|
1032
1038
|
childItem: o,
|
|
1033
|
-
isLockedItem:
|
|
1039
|
+
isLockedItem: s
|
|
1034
1040
|
}) {
|
|
1035
1041
|
await this.expandItem({
|
|
1036
1042
|
testId: t,
|
|
1037
1043
|
item: e,
|
|
1038
|
-
isLockedItem:
|
|
1044
|
+
isLockedItem: s
|
|
1039
1045
|
}), await this.page.locator("ul li span", {
|
|
1040
1046
|
hasText: o
|
|
1041
1047
|
}).click();
|
|
1042
1048
|
}
|
|
1043
1049
|
async isListOpened({ testId: t, item: e, isLockedItem: o }) {
|
|
1044
|
-
const
|
|
1050
|
+
const s = o ? h.LOCKED_LIST : h.DRAGGABLE_LIST;
|
|
1045
1051
|
return await (await this.getListItemLocator({
|
|
1046
1052
|
testId: t,
|
|
1047
1053
|
item: e,
|
|
1048
|
-
modifier:
|
|
1054
|
+
modifier: s
|
|
1049
1055
|
})).locator(".child-list ul").count() > 0;
|
|
1050
1056
|
}
|
|
1051
1057
|
async isChildItemSelected(t) {
|
|
1052
1058
|
return await this.page.locator("ul li span", { hasText: t }).count() > 0;
|
|
1053
1059
|
}
|
|
1054
1060
|
async openItemMenu({ testId: t, item: e, isLockedItem: o }) {
|
|
1055
|
-
const
|
|
1061
|
+
const s = o ? h.LOCKED_LIST : h.DRAGGABLE_LIST;
|
|
1056
1062
|
await (await this.getListItemLocator({
|
|
1057
1063
|
testId: t,
|
|
1058
1064
|
item: e,
|
|
1059
|
-
modifier:
|
|
1065
|
+
modifier: s
|
|
1060
1066
|
})).locator(".item__menu button").click();
|
|
1061
1067
|
}
|
|
1062
1068
|
async selectMenuItem({
|
|
1063
1069
|
testId: t,
|
|
1064
1070
|
item: e,
|
|
1065
1071
|
isLockedItem: o,
|
|
1066
|
-
menuItem:
|
|
1072
|
+
menuItem: s
|
|
1067
1073
|
}) {
|
|
1068
1074
|
await this.openItemMenu({
|
|
1069
1075
|
testId: t,
|
|
1070
1076
|
item: e,
|
|
1071
1077
|
isLockedItem: o
|
|
1072
1078
|
});
|
|
1073
|
-
const
|
|
1074
|
-
await
|
|
1079
|
+
const c = this.page.locator(".dropdown-list-wrapper");
|
|
1080
|
+
await c.locator("ul.list li", { hasText: s }).click(), await c.waitFor({ state: "detached" });
|
|
1075
1081
|
}
|
|
1076
1082
|
async isMenuOpened() {
|
|
1077
1083
|
return await this.page.locator(".dropdown-list-wrapper").count() > 0;
|
|
1078
1084
|
}
|
|
1079
1085
|
async dragAndDrop({ testId: t, item: e, isLockedItem: o }) {
|
|
1080
|
-
const
|
|
1086
|
+
const s = o ? h.LOCKED_LIST : h.DRAGGABLE_LIST, p = await (await this.getListItemLocator({
|
|
1081
1087
|
testId: t,
|
|
1082
1088
|
item: e,
|
|
1083
|
-
modifier:
|
|
1089
|
+
modifier: s
|
|
1084
1090
|
})).locator(".item.drag-allowed").first().boundingBox();
|
|
1085
|
-
if (
|
|
1086
|
-
const
|
|
1087
|
-
await this.page.mouse.move(
|
|
1091
|
+
if (p) {
|
|
1092
|
+
const B = p.x, y = p.y;
|
|
1093
|
+
await this.page.mouse.move(B, y), await this.page.mouse.down(), await this.page.mouse.move(B + 20, y - 20), await this.page.mouse.up();
|
|
1088
1094
|
}
|
|
1089
1095
|
}
|
|
1090
1096
|
async getListOrder() {
|
|
1091
|
-
return (await this.page.locator(".sortable-list-container .item__text span").allInnerTexts()).reduce((e, o,
|
|
1097
|
+
return (await this.page.locator(".sortable-list-container .item__text span").allInnerTexts()).reduce((e, o, s) => (e[s + 1] = o, e), {});
|
|
1092
1098
|
}
|
|
1093
1099
|
async searchForItem({ testId: t, searchTerm: e }) {
|
|
1094
|
-
return await this.page.getByTestId(n(t,
|
|
1100
|
+
return await this.page.getByTestId(n(t, l.FIELD)).fill(e), this.page.getByTestId(n(t, h.CONTAINER)).locator("ul > li span").first().textContent();
|
|
1095
1101
|
}
|
|
1096
1102
|
// returns array of booleans according to the search results in each group
|
|
1097
1103
|
async verifySearchResultDisplayed({ testId: t, item: e }) {
|
|
1098
|
-
const o = [],
|
|
1099
|
-
let
|
|
1100
|
-
for (const
|
|
1101
|
-
|
|
1104
|
+
const o = [], s = await this.page.getByTestId(n(t, h.CONTAINER)).all();
|
|
1105
|
+
let c;
|
|
1106
|
+
for (const p of s)
|
|
1107
|
+
c = await p.locator(".child-list span", { hasText: e }).count(), o.push(c > 0);
|
|
1102
1108
|
return o;
|
|
1103
1109
|
}
|
|
1110
|
+
async getSelectedItem(t) {
|
|
1111
|
+
return this.page.getByTestId(n(t, h.CONTAINER)).locator(".sortable-item--selected").textContent();
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
class Lt {
|
|
1115
|
+
constructor(t) {
|
|
1116
|
+
r(this, "page");
|
|
1117
|
+
this.page = t;
|
|
1118
|
+
}
|
|
1119
|
+
async waitForComponent({ testId: t }) {
|
|
1120
|
+
const e = n(t, v.WRAPPER);
|
|
1121
|
+
await this.page.getByTestId(e).waitFor({ state: "visible" });
|
|
1122
|
+
}
|
|
1123
|
+
async selectView({ view: t, testId: e }) {
|
|
1124
|
+
const o = `[text="${t}"]`;
|
|
1125
|
+
console.log(o);
|
|
1126
|
+
const s = n(e, v.WRAPPER);
|
|
1127
|
+
await (await this.page.getByTestId(s).locator(o)).click();
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
class Rt {
|
|
1131
|
+
constructor(t) {
|
|
1132
|
+
r(this, "page");
|
|
1133
|
+
this.page = t;
|
|
1134
|
+
}
|
|
1135
|
+
async waitForComponent({ testId: t }) {
|
|
1136
|
+
const e = n(t, m.WRAPPER);
|
|
1137
|
+
await this.page.getByTestId(e).waitFor({ state: "visible" });
|
|
1138
|
+
}
|
|
1139
|
+
async openDateRangeComponent(t) {
|
|
1140
|
+
const e = n(t, m.TRIGGER);
|
|
1141
|
+
await (await this.page.getByTestId(e)).click();
|
|
1142
|
+
}
|
|
1143
|
+
async selectDateRangeMenu({
|
|
1144
|
+
testId: t,
|
|
1145
|
+
option: e
|
|
1146
|
+
}) {
|
|
1147
|
+
await this.openDateRangeComponent(t);
|
|
1148
|
+
const o = n(t, m.MENU);
|
|
1149
|
+
await (await this.page.getByTestId(
|
|
1150
|
+
`${o}-${e}`
|
|
1151
|
+
)).click();
|
|
1152
|
+
}
|
|
1153
|
+
// month year should be the calendar month title, like - "May 2024"
|
|
1154
|
+
async selectSpecificDates({
|
|
1155
|
+
testId: t,
|
|
1156
|
+
startMonthYear: e,
|
|
1157
|
+
startDate: o,
|
|
1158
|
+
endMonthYear: s,
|
|
1159
|
+
endDate: c
|
|
1160
|
+
}) {
|
|
1161
|
+
await this.openDateRangeComponent(t);
|
|
1162
|
+
const p = await this.goToStartMonthYear(e);
|
|
1163
|
+
await (await this.getDayElement(
|
|
1164
|
+
p,
|
|
1165
|
+
o
|
|
1166
|
+
)).click();
|
|
1167
|
+
const y = await this.goToEndMonthYear(s);
|
|
1168
|
+
await (await this.getDayElement(y, c)).click();
|
|
1169
|
+
}
|
|
1170
|
+
async getDayElement(t, e) {
|
|
1171
|
+
const o = await t.locator(".date-wrapper").all();
|
|
1172
|
+
for (const s of o)
|
|
1173
|
+
if (await s.textContent() === e)
|
|
1174
|
+
return s;
|
|
1175
|
+
return null;
|
|
1176
|
+
}
|
|
1177
|
+
async goToStartMonthYear(t) {
|
|
1178
|
+
let o = 1;
|
|
1179
|
+
for (; o < 24; ) {
|
|
1180
|
+
const s = await this.page.$$(".month-header span.month-name");
|
|
1181
|
+
for (const p of s)
|
|
1182
|
+
if (await p.textContent() === t)
|
|
1183
|
+
return this.page.locator(".calendar-month", {
|
|
1184
|
+
hasText: t
|
|
1185
|
+
});
|
|
1186
|
+
await (await this.page.locator(".previous")).click(), o++, await this.page.waitForTimeout(500);
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
async goToEndMonthYear(t) {
|
|
1190
|
+
let o = 1;
|
|
1191
|
+
for (; o < 24; ) {
|
|
1192
|
+
const s = await this.page.$$(".month-header span.month-name");
|
|
1193
|
+
for (const p of s)
|
|
1194
|
+
if (await p.textContent() === t)
|
|
1195
|
+
return this.page.locator(".calendar-month", {
|
|
1196
|
+
hasText: t
|
|
1197
|
+
});
|
|
1198
|
+
await (await this.page.locator(".next")).click(), o++, await this.page.waitForTimeout(500);
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
async getSelectedDays() {
|
|
1202
|
+
const t = await this.page.locator("span.start-day.today").count(), e = await this.page.locator("span.selected-day-between").count(), o = await this.page.locator("span.end-day").count();
|
|
1203
|
+
return t + e + o - 1;
|
|
1204
|
+
}
|
|
1205
|
+
async clickOnApply(t) {
|
|
1206
|
+
const e = n(
|
|
1207
|
+
t,
|
|
1208
|
+
m.ACTION_APPLY
|
|
1209
|
+
);
|
|
1210
|
+
await (await this.page.getByTestId(e)).click();
|
|
1211
|
+
}
|
|
1212
|
+
async clickOnCancel(t) {
|
|
1213
|
+
const e = n(
|
|
1214
|
+
t,
|
|
1215
|
+
m.ACTION_CANCEL
|
|
1216
|
+
);
|
|
1217
|
+
await (await this.page.getByTestId(e)).click();
|
|
1218
|
+
}
|
|
1219
|
+
async getDateRangeLabel(t) {
|
|
1220
|
+
const e = n(t, m.TRIGGER);
|
|
1221
|
+
return (await this.page.getByTestId(e)).textContent();
|
|
1222
|
+
}
|
|
1223
|
+
createRangeLabel({
|
|
1224
|
+
startMonthYear: t,
|
|
1225
|
+
startDate: e,
|
|
1226
|
+
endMonthYear: o,
|
|
1227
|
+
endDate: s
|
|
1228
|
+
}) {
|
|
1229
|
+
const c = {
|
|
1230
|
+
January: "Jan",
|
|
1231
|
+
February: "Feb",
|
|
1232
|
+
March: "Mar",
|
|
1233
|
+
April: "Apr",
|
|
1234
|
+
May: "May",
|
|
1235
|
+
June: "Jun",
|
|
1236
|
+
July: "Jul",
|
|
1237
|
+
August: "Aug",
|
|
1238
|
+
September: "Sep",
|
|
1239
|
+
October: "Oct",
|
|
1240
|
+
November: "Nov",
|
|
1241
|
+
December: "Dec"
|
|
1242
|
+
}, [p, B] = t.split(" "), y = c[p], [N, F] = o.split(" "), k = c[N];
|
|
1243
|
+
return `${y} ${e}, ${B} - ${k} ${s}, ${F}`;
|
|
1244
|
+
}
|
|
1245
|
+
calculateDaysBetweenDates(t) {
|
|
1246
|
+
const [e, o] = t.split(" - ");
|
|
1247
|
+
function s(N) {
|
|
1248
|
+
const [F, k] = N.split(", "), [W, K] = F.split(" "), U = {
|
|
1249
|
+
Jan: 0,
|
|
1250
|
+
Feb: 1,
|
|
1251
|
+
Mar: 2,
|
|
1252
|
+
Apr: 3,
|
|
1253
|
+
May: 4,
|
|
1254
|
+
Jun: 5,
|
|
1255
|
+
Jul: 6,
|
|
1256
|
+
Aug: 7,
|
|
1257
|
+
Sep: 8,
|
|
1258
|
+
Oct: 9,
|
|
1259
|
+
Nov: 10,
|
|
1260
|
+
Dec: 11
|
|
1261
|
+
}[W];
|
|
1262
|
+
if (U === void 0)
|
|
1263
|
+
throw new Error(`Invalid month: ${W}`);
|
|
1264
|
+
return new Date(parseInt(k), U, parseInt(K));
|
|
1265
|
+
}
|
|
1266
|
+
const c = s(e), y = (s(o).getTime() - c.getTime()) / (1e3 * 60 * 60 * 24);
|
|
1267
|
+
return Math.floor(y + 1);
|
|
1268
|
+
}
|
|
1104
1269
|
}
|
|
1105
1270
|
export {
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
dt as
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1271
|
+
It as AlertComponent,
|
|
1272
|
+
mt as AppHeaderComponent,
|
|
1273
|
+
it as BannerComponent,
|
|
1274
|
+
tt as ButtonComponent,
|
|
1275
|
+
ct as ComponentBasePage,
|
|
1276
|
+
Rt as DateRangeComponent,
|
|
1277
|
+
rt as DialogComponent,
|
|
1278
|
+
Z as DropdownComponent,
|
|
1279
|
+
lt as DropdownComponentV3,
|
|
1280
|
+
H as FieldHelpTextComponent,
|
|
1281
|
+
b as FieldLabelComponent,
|
|
1282
|
+
Et as FormCardComponent,
|
|
1283
|
+
wt as FormRowComponent,
|
|
1284
|
+
pt as IncludeExcludeComponent,
|
|
1285
|
+
et as InlineCopyComponent,
|
|
1286
|
+
gt as InputsComponent,
|
|
1287
|
+
yt as MultiBarComponent,
|
|
1288
|
+
Ct as SearchComponent,
|
|
1289
|
+
dt as SnackbarComponent,
|
|
1290
|
+
At as SortableListComponent,
|
|
1291
|
+
Lt as SwitchComponent,
|
|
1292
|
+
ut as TableComponent,
|
|
1293
|
+
Tt as TabsComponent,
|
|
1294
|
+
Bt as TextAreaComponent,
|
|
1295
|
+
ht as TooltipComponent,
|
|
1296
|
+
xt as TreeDropdownComponent
|
|
1130
1297
|
};
|