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