@ironsource/shared-ui-e2e 2.1.12-rc.5 → 2.1.12-rc.51
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 +486 -315
- 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 +5 -2
- 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 +3 -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 +47 -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 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,107 @@ 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
135
|
}
|
|
136
|
-
async
|
|
137
|
-
await this.
|
|
138
|
-
|
|
139
|
-
|
|
136
|
+
async clearAllOptions({ testId: t }) {
|
|
137
|
+
await this.page.getByTestId(n(t, i.ACTION_CLEAR_ALL)).click();
|
|
138
|
+
}
|
|
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();
|
|
140
147
|
}
|
|
141
148
|
async selectMultipleItemsByName({
|
|
142
149
|
testId: t,
|
|
143
|
-
itemsToSelect: e
|
|
150
|
+
itemsToSelect: e,
|
|
151
|
+
shouldClearAll: o
|
|
144
152
|
}) {
|
|
145
|
-
await this.openDropdownComponent({ testId: t })
|
|
146
|
-
|
|
147
|
-
|
|
153
|
+
await this.openDropdownComponent({ testId: t }), o && await this.clearAllOptions({
|
|
154
|
+
testId: t
|
|
155
|
+
});
|
|
156
|
+
for (const s of e)
|
|
157
|
+
await this.page.getByTestId(n(t, i.LIST_CONTAINER)).locator("ul > li span", { hasText: s }).first().click();
|
|
148
158
|
}
|
|
149
159
|
async clickOnApply({ testId: t }) {
|
|
150
|
-
await this.page.getByTestId(n(t,
|
|
160
|
+
await this.page.getByTestId(n(t, i.ACTION_APPLY)).click();
|
|
151
161
|
}
|
|
152
162
|
async clickOnCancel({ testId: t }) {
|
|
153
|
-
await this.page.getByTestId(n(t,
|
|
163
|
+
await this.page.getByTestId(n(t, i.ACTION_CANCEL)).click();
|
|
154
164
|
}
|
|
155
165
|
async isValidationAppear({ testId: t }) {
|
|
156
|
-
return (await this.page.getByTestId(n(t,
|
|
166
|
+
return (await this.page.getByTestId(n(t, i.BUTTON_WRAPPER)).getAttribute("class")).includes("state-error");
|
|
157
167
|
}
|
|
158
168
|
}
|
|
159
|
-
class
|
|
169
|
+
class b {
|
|
160
170
|
constructor(t) {
|
|
161
|
-
|
|
171
|
+
r(this, "page");
|
|
162
172
|
this.page = t;
|
|
163
173
|
}
|
|
164
174
|
getLabelText({ testId: t }) {
|
|
165
|
-
return this.page.getByTestId(n(t,
|
|
175
|
+
return this.page.getByTestId(n(t, R.TEXT)).textContent();
|
|
166
176
|
}
|
|
167
177
|
isMandatory({ testId: t }) {
|
|
168
|
-
return this.page.getByTestId(n(t,
|
|
178
|
+
return this.page.getByTestId(n(t, R.MANDATORY)).isVisible();
|
|
169
179
|
}
|
|
170
180
|
async getHelpIconText({ testId: t }) {
|
|
171
181
|
const e = await this.page.getByTestId(
|
|
172
|
-
n(t,
|
|
182
|
+
n(t, R.TOOLTIP)
|
|
173
183
|
);
|
|
174
184
|
return await e.hover(), e.getAttribute("text");
|
|
175
185
|
}
|
|
176
186
|
}
|
|
177
|
-
class
|
|
187
|
+
class H {
|
|
178
188
|
constructor(t) {
|
|
179
|
-
|
|
189
|
+
r(this, "page");
|
|
180
190
|
this.page = t;
|
|
181
191
|
}
|
|
182
192
|
hasExtraText({ testId: t }) {
|
|
183
|
-
return this.page.getByTestId(n(t,
|
|
193
|
+
return this.page.getByTestId(n(t, E.TEXT)).isVisible();
|
|
184
194
|
}
|
|
185
195
|
getExtraText({ testId: t }) {
|
|
186
|
-
return this.page.getByTestId(n(t,
|
|
196
|
+
return this.page.getByTestId(n(t, E.TEXT)).textContent();
|
|
187
197
|
}
|
|
188
198
|
async hasExtraTextIconType({ testId: t, type: e }) {
|
|
189
|
-
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;
|
|
190
200
|
}
|
|
191
201
|
}
|
|
192
|
-
class
|
|
202
|
+
class Z extends Y {
|
|
193
203
|
constructor(e) {
|
|
194
204
|
super(e);
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
this.fieldLabelComponent = new
|
|
205
|
+
r(this, "fieldLabelComponent");
|
|
206
|
+
r(this, "fieldHelpTextComponent");
|
|
207
|
+
this.fieldLabelComponent = new b(e), this.fieldHelpTextComponent = new H(e);
|
|
198
208
|
}
|
|
199
209
|
getDropdownTitle({ testId: e }) {
|
|
200
210
|
return this.fieldLabelComponent.getLabelText({ testId: e });
|
|
@@ -215,158 +225,155 @@ class X extends G {
|
|
|
215
225
|
return this.fieldHelpTextComponent.hasExtraTextIconType({ testId: e, type: o });
|
|
216
226
|
}
|
|
217
227
|
async getSelectedLabel({ testId: e }) {
|
|
218
|
-
let
|
|
228
|
+
let s = await this.page.getByTestId(n(e, i.BUTTON_CONTENT)).textContent();
|
|
219
229
|
if (await this.page.getByTestId(
|
|
220
|
-
n(e,
|
|
230
|
+
n(e, i.BUTTON_CONTENT_SUFFIX)
|
|
221
231
|
).isVisible({ timeout: 1e3 })) {
|
|
222
|
-
const
|
|
223
|
-
n(e,
|
|
232
|
+
const p = await this.page.getByTestId(
|
|
233
|
+
n(e, i.BUTTON_CONTENT_SUFFIX)
|
|
224
234
|
).textContent();
|
|
225
|
-
|
|
235
|
+
s = `${s}${p}`;
|
|
226
236
|
}
|
|
227
|
-
return
|
|
237
|
+
return s;
|
|
228
238
|
}
|
|
229
239
|
async searchForItem({ testId: e, searchTerm: o }) {
|
|
230
|
-
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();
|
|
231
241
|
}
|
|
232
242
|
async isErrorText({ testId: e }) {
|
|
233
|
-
return await this.page.getByTestId(n(e,
|
|
243
|
+
return await this.page.getByTestId(n(e, E.TEXT)).count() > 0;
|
|
234
244
|
}
|
|
235
245
|
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();
|
|
246
|
+
return (await this.page.getByTestId(n(e, i.TRIGGER)).locator(".button__container--disabled")).isVisible();
|
|
240
247
|
}
|
|
241
248
|
isSelectAllChecked({ testId: e }) {
|
|
242
|
-
return this.page.getByTestId(n(e,
|
|
249
|
+
return this.page.getByTestId(n(e, i.SELECT_ALL)).locator(".checkbox.input").isChecked();
|
|
243
250
|
}
|
|
244
251
|
isSelectAllIndeterminate({ testId: e }) {
|
|
245
|
-
return this.page.getByTestId(n(e,
|
|
252
|
+
return this.page.getByTestId(n(e, i.SELECT_ALL)).locator(".icon.indeterminate").isVisible();
|
|
246
253
|
}
|
|
247
254
|
async removeChipSelection({ testId: e }) {
|
|
248
|
-
await this.page.getByTestId(n(e,
|
|
255
|
+
await this.page.getByTestId(n(e, i.BUTTON_CLEAR)).click();
|
|
249
256
|
}
|
|
250
257
|
getDropdownOptions({ testId: e }) {
|
|
251
|
-
return this.page.getByTestId(n(e,
|
|
258
|
+
return this.page.getByTestId(n(e, i.LIST_CONTAINER)).locator(".list").allTextContents();
|
|
252
259
|
}
|
|
253
260
|
}
|
|
254
|
-
class
|
|
261
|
+
class lt extends Y {
|
|
255
262
|
constructor(t) {
|
|
256
263
|
super(t);
|
|
257
264
|
}
|
|
258
265
|
getDropdownTitle({ testId: t }) {
|
|
259
|
-
return this.page.getByTestId(n(t,
|
|
266
|
+
return this.page.getByTestId(n(t, i.WRAPPER)).locator("label > span").textContent();
|
|
260
267
|
}
|
|
261
268
|
getSelectedItem({ testId: t }) {
|
|
262
|
-
return this.page.getByTestId(n(t,
|
|
269
|
+
return this.page.getByTestId(n(t, i.TRIGGER)).locator("button > span").textContent();
|
|
263
270
|
}
|
|
264
271
|
async searchForItem({ testId: t, searchTerm: e }) {
|
|
265
|
-
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();
|
|
266
273
|
}
|
|
267
274
|
}
|
|
268
|
-
class
|
|
275
|
+
class pt {
|
|
269
276
|
constructor(t) {
|
|
270
|
-
|
|
277
|
+
r(this, "page");
|
|
271
278
|
this.page = t;
|
|
272
279
|
}
|
|
273
280
|
async waitForComponent({ testId: t }) {
|
|
274
|
-
const e = `[data-testid='${t}-${
|
|
281
|
+
const e = `[data-testid='${t}-${T.TRIGGER}']`;
|
|
275
282
|
await this.page.waitForSelector(e);
|
|
276
283
|
}
|
|
277
284
|
async clickOnApply(t) {
|
|
278
285
|
await this.page.getByTestId(
|
|
279
|
-
n(t,
|
|
286
|
+
n(t, T.ACTION_APPLY)
|
|
280
287
|
).click();
|
|
281
288
|
}
|
|
282
289
|
async clickOnCancel(t) {
|
|
283
290
|
await this.page.getByTestId(
|
|
284
|
-
n(t,
|
|
291
|
+
n(t, T.ACTION_CANCEL)
|
|
285
292
|
).click();
|
|
286
293
|
}
|
|
287
294
|
async openIncludeExcludeComponent(t) {
|
|
288
|
-
await this.page.getByTestId(n(t,
|
|
295
|
+
await this.page.getByTestId(n(t, T.TRIGGER)).click();
|
|
289
296
|
}
|
|
290
297
|
async searchForItem({ testId: t, searchTerm: e }) {
|
|
291
|
-
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();
|
|
292
299
|
}
|
|
293
300
|
async selectItemByName({ testId: t, entityName: e }) {
|
|
294
|
-
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);
|
|
295
302
|
}
|
|
296
303
|
async selectItemByIndex({ testId: t, index: e, applyChanges: o }) {
|
|
297
|
-
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", {
|
|
298
305
|
state: "hidden"
|
|
299
306
|
}), o && await this.clickOnApply(t);
|
|
300
307
|
}
|
|
301
308
|
async selectMultipleItems({ testId: t, itemsToSelect: e }) {
|
|
302
309
|
await this.clearAll({ testId: t }), await this.openIncludeExcludeComponent(t);
|
|
303
310
|
for (const o of e)
|
|
304
|
-
await this.page.getByTestId(n(t,
|
|
311
|
+
await this.page.getByTestId(n(t, T.LIST)).locator(".include-exclude-list ul > li").nth(o).click();
|
|
305
312
|
}
|
|
306
313
|
async unselectItemByName({ testId: t, entityName: e }) {
|
|
307
314
|
await this.openIncludeExcludeComponent(t), await this.page.getByTestId(
|
|
308
|
-
n(t,
|
|
315
|
+
n(t, T.LIST_SELECTED)
|
|
309
316
|
).locator("ul > li", { hasText: e }).locator(".clear-button").click(), await this.clickOnApply(t);
|
|
310
317
|
}
|
|
311
318
|
async unselectByIndex({ testId: t, index: e, applyChanges: o }) {
|
|
312
319
|
await this.page.getByTestId(
|
|
313
|
-
n(t,
|
|
320
|
+
n(t, T.LIST_SELECTED)
|
|
314
321
|
).locator("ul li button").nth(e).click(), o && await this.clickOnApply(t);
|
|
315
322
|
}
|
|
316
323
|
async getSelectedCounter(t) {
|
|
317
324
|
return await this.page.getByTestId(
|
|
318
|
-
n(t,
|
|
325
|
+
n(t, T.LIST_SELECTED)
|
|
319
326
|
).locator(".include-exclude-selected-header-left span").textContent();
|
|
320
327
|
}
|
|
321
328
|
async clearAll({ testId: t }) {
|
|
322
|
-
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);
|
|
323
330
|
}
|
|
324
331
|
getTriggerText({ testId: t }) {
|
|
325
|
-
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();
|
|
326
333
|
}
|
|
327
334
|
getTriggerDescription({ testId: t }) {
|
|
328
|
-
return this.page.getByTestId(n(t,
|
|
335
|
+
return this.page.getByTestId(n(t, T.TRIGGER)).locator("div span.include-exclude-trigger-description").first().textContent();
|
|
329
336
|
}
|
|
330
337
|
async selectAll({ testId: t }) {
|
|
331
|
-
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);
|
|
332
339
|
}
|
|
333
340
|
}
|
|
334
|
-
class
|
|
341
|
+
class J {
|
|
335
342
|
constructor(t) {
|
|
336
|
-
|
|
343
|
+
r(this, "page");
|
|
337
344
|
this.page = t;
|
|
338
345
|
}
|
|
339
346
|
getInputsFieldText({ testId: t }) {
|
|
340
|
-
return this.page.getByTestId(n(t,
|
|
347
|
+
return this.page.getByTestId(n(t, l.FIELD)).inputValue();
|
|
341
348
|
}
|
|
342
349
|
getPlaceholderText({ testId: t }) {
|
|
343
|
-
return this.page.getByTestId(n(t,
|
|
350
|
+
return this.page.getByTestId(n(t, l.FIELD)).getAttribute("placeholder");
|
|
344
351
|
}
|
|
345
352
|
getInputsType({ testId: t }) {
|
|
346
|
-
return this.page.getByTestId(n(t,
|
|
353
|
+
return this.page.getByTestId(n(t, l.FIELD)).getAttribute("type");
|
|
347
354
|
}
|
|
348
355
|
async addInput({ testId: t, text: e }) {
|
|
349
|
-
await this.page.getByTestId(n(t,
|
|
356
|
+
await this.page.getByTestId(n(t, l.FIELD)).type(e);
|
|
350
357
|
}
|
|
351
358
|
async clearInput({ testId: t }) {
|
|
352
|
-
await this.page.getByTestId(n(t,
|
|
359
|
+
await this.page.getByTestId(n(t, l.FIELD)).clear();
|
|
353
360
|
}
|
|
354
361
|
isDisabled({ testId: t }) {
|
|
355
|
-
return this.page.getByTestId(n(t,
|
|
362
|
+
return this.page.getByTestId(n(t, l.FIELD)).isDisabled();
|
|
356
363
|
}
|
|
357
364
|
}
|
|
358
|
-
class
|
|
365
|
+
class gt extends J {
|
|
359
366
|
constructor(e) {
|
|
360
367
|
super(e);
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
this.fieldLabelComponent = new
|
|
368
|
+
r(this, "fieldLabelComponent");
|
|
369
|
+
r(this, "fieldHelpTextComponent");
|
|
370
|
+
this.fieldLabelComponent = new b(e), this.fieldHelpTextComponent = new H(e);
|
|
364
371
|
}
|
|
365
372
|
getInputsLabelText({ testId: e }) {
|
|
366
373
|
return this.fieldLabelComponent.getLabelText({ testId: e });
|
|
367
374
|
}
|
|
368
375
|
async waitForComponent({ testId: e }) {
|
|
369
|
-
const o = `[data-testid='${e}-${
|
|
376
|
+
const o = `[data-testid='${e}-${l.WRAPPER}']`;
|
|
370
377
|
await this.page.waitForSelector(o);
|
|
371
378
|
}
|
|
372
379
|
isInputMandatory({ testId: e }) {
|
|
@@ -379,7 +386,7 @@ class at extends f {
|
|
|
379
386
|
return this.fieldHelpTextComponent.getExtraText({ testId: e });
|
|
380
387
|
}
|
|
381
388
|
async clickOnApplyButton({ testId: e }) {
|
|
382
|
-
await (await this.page.getByTestId(n(e,
|
|
389
|
+
await (await this.page.getByTestId(n(e, l.WRAPPER)).locator(".icon.icon-name--check")).click();
|
|
383
390
|
}
|
|
384
391
|
hasInlineErrorText({
|
|
385
392
|
testId: e,
|
|
@@ -391,26 +398,26 @@ class at extends f {
|
|
|
391
398
|
testId: e,
|
|
392
399
|
inputTestId: o
|
|
393
400
|
}) {
|
|
394
|
-
const
|
|
401
|
+
const s = this.page.getByTestId(
|
|
395
402
|
n(e, o)
|
|
396
403
|
);
|
|
397
|
-
return await
|
|
404
|
+
return await s.hover(), s.getAttribute("text");
|
|
398
405
|
}
|
|
399
406
|
async clickOnShowPassword({ testId: e }) {
|
|
400
407
|
await this.isPasswordHidden({ testId: e }) && await this.clickOnPasswordIcon({ testId: e });
|
|
401
408
|
}
|
|
402
409
|
async clickOnPasswordIcon({ testId: e }) {
|
|
403
|
-
await this.page.getByTestId(n(e,
|
|
410
|
+
await this.page.getByTestId(n(e, l.TOGGLE_PASSWORD)).click();
|
|
404
411
|
}
|
|
405
412
|
async clickOnHidePassword({ testId: e }) {
|
|
406
413
|
await this.isPasswordHidden({ testId: e }) || await this.clickOnPasswordIcon({ testId: e });
|
|
407
414
|
}
|
|
408
415
|
isPasswordHidden({ testId: e }) {
|
|
409
|
-
return this.page.getByTestId(n(e,
|
|
416
|
+
return this.page.getByTestId(n(e, l.TOGGLE_PASSWORD)).locator(".icon.icon-name--eye-slash").isVisible();
|
|
410
417
|
}
|
|
411
418
|
async clearInput({ testId: e }) {
|
|
412
419
|
await (await this.page.getByTestId(
|
|
413
|
-
n(e,
|
|
420
|
+
n(e, l.FIELD)
|
|
414
421
|
)).clear();
|
|
415
422
|
}
|
|
416
423
|
hasExtraTextIconType({ testId: e, type: o }) {
|
|
@@ -418,11 +425,11 @@ class at extends f {
|
|
|
418
425
|
}
|
|
419
426
|
async isDisabled({ testId: e }) {
|
|
420
427
|
return (await this.page.getByTestId(
|
|
421
|
-
n(e,
|
|
428
|
+
n(e, l.FIELD)
|
|
422
429
|
)).isDisabled();
|
|
423
430
|
}
|
|
424
431
|
hasApplyButton({ testId: e }) {
|
|
425
|
-
return this.page.getByTestId(n(e,
|
|
432
|
+
return this.page.getByTestId(n(e, l.WRAPPER)).locator(".icon.icon-name--check").isVisible();
|
|
426
433
|
}
|
|
427
434
|
async getMaxLengthNumber({ testId: e }) {
|
|
428
435
|
return (await this.getFontCaptionText({ testId: e }))[1];
|
|
@@ -431,155 +438,155 @@ class at extends f {
|
|
|
431
438
|
return (await this.getFontCaptionText({ testId: e }))[0];
|
|
432
439
|
}
|
|
433
440
|
async getFontCaptionText({ testId: e }) {
|
|
434
|
-
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));
|
|
435
442
|
}
|
|
436
443
|
getHelpIconText({ testId: e }) {
|
|
437
444
|
return this.fieldLabelComponent.getHelpIconText({ testId: e });
|
|
438
445
|
}
|
|
439
446
|
async isValidationAppear({ testId: e }) {
|
|
440
|
-
return (await this.page.getByTestId(n(e,
|
|
447
|
+
return (await this.page.getByTestId(n(e, l.WRAPPER)).getAttribute("class")).includes("variant-error");
|
|
441
448
|
}
|
|
442
449
|
}
|
|
443
|
-
class
|
|
450
|
+
class Tt {
|
|
444
451
|
constructor(t) {
|
|
445
|
-
|
|
452
|
+
r(this, "page");
|
|
446
453
|
this.page = t;
|
|
447
454
|
}
|
|
448
455
|
async waitForComponent({ testId: t }) {
|
|
449
|
-
const e = `[data-testid='${t}-${
|
|
456
|
+
const e = `[data-testid='${t}-${A.WRAPPER}']`;
|
|
450
457
|
await this.page.waitForSelector(e);
|
|
451
458
|
}
|
|
452
459
|
getSelectedTabText({ testId: t }) {
|
|
453
|
-
return this.page.getByTestId(n(t,
|
|
460
|
+
return this.page.getByTestId(n(t, A.WRAPPER)).locator(".tab-item--active").textContent();
|
|
454
461
|
}
|
|
455
462
|
async selectTab({ testId: t, tabName: e }) {
|
|
456
463
|
const o = await this.getTabIndex({ testId: t, tabName: e });
|
|
457
464
|
await this.page.getByTestId(
|
|
458
|
-
n(t, `${
|
|
465
|
+
n(t, `${A.TAB}-${o + 1}`)
|
|
459
466
|
).click();
|
|
460
467
|
}
|
|
461
468
|
async getTabIndex({ testId: t, tabName: e }) {
|
|
462
|
-
return (await this.page.getByTestId(n(t,
|
|
469
|
+
return (await this.page.getByTestId(n(t, A.WRAPPER)).locator(".tab-item").allTextContents()).indexOf(e);
|
|
463
470
|
}
|
|
464
471
|
async isTabDisabled({ testId: t, tabName: e }) {
|
|
465
472
|
const o = await this.getTabIndex({ testId: t, tabName: e });
|
|
466
|
-
return this.page.getByTestId(n(t, `${
|
|
473
|
+
return this.page.getByTestId(n(t, `${A.TAB}-${o}`)).locator(".tab-item--disabled").isVisible();
|
|
467
474
|
}
|
|
468
475
|
}
|
|
469
|
-
class
|
|
476
|
+
class ht {
|
|
470
477
|
constructor(t) {
|
|
471
|
-
|
|
478
|
+
r(this, "page");
|
|
472
479
|
this.page = t;
|
|
473
480
|
}
|
|
474
481
|
async waitForComponent({ testId: t }) {
|
|
475
|
-
const e = `[data-testid='${t}-${
|
|
482
|
+
const e = `[data-testid='${t}-${P.TRIGGER}']`;
|
|
476
483
|
await this.page.waitForSelector(e);
|
|
477
484
|
}
|
|
478
485
|
getTooltipText({ testId: t }) {
|
|
479
|
-
return this.page.getByTestId(`${t}-${
|
|
486
|
+
return this.page.getByTestId(`${t}-${P.TRIGGER}`).getAttribute("text");
|
|
480
487
|
}
|
|
481
488
|
getTooltipHeaderText({ testId: t }) {
|
|
482
|
-
return this.page.getByTestId(`${t}-${
|
|
489
|
+
return this.page.getByTestId(`${t}-${P.TRIGGER}`).getAttribute("header");
|
|
483
490
|
}
|
|
484
491
|
}
|
|
485
|
-
const
|
|
486
|
-
class
|
|
492
|
+
const x = ".table-row", $ = ".icon-wrapper", V = ".states", f = ".table-head-container", X = ".table-row.loading", M = 1e3;
|
|
493
|
+
class ut {
|
|
487
494
|
constructor(t) {
|
|
488
|
-
|
|
495
|
+
r(this, "page");
|
|
489
496
|
this.page = t;
|
|
490
497
|
}
|
|
491
498
|
async waitForComponent({ testId: t }) {
|
|
492
|
-
const e = `[data-testid='${t}-${
|
|
499
|
+
const e = `[data-testid='${t}-${g.CONTAINER}']`;
|
|
493
500
|
await this.page.waitForSelector(e);
|
|
494
501
|
}
|
|
495
502
|
getTableRowCount({ testId: t }) {
|
|
496
|
-
return this.page.getByTestId(n(t,
|
|
503
|
+
return this.page.getByTestId(n(t, g.BODY_WRAPPER)).locator(x).count();
|
|
497
504
|
}
|
|
498
505
|
async getColumnHeaders({ testId: t }) {
|
|
499
|
-
return this.page.getByTestId(n(t,
|
|
506
|
+
return this.page.getByTestId(n(t, g.TABLE)).locator(f).allTextContents();
|
|
500
507
|
}
|
|
501
508
|
getTableLabel({ testId: t }) {
|
|
502
|
-
return this.page.getByTestId(n(t,
|
|
509
|
+
return this.page.getByTestId(n(t, g.HEADER)).innerText();
|
|
503
510
|
}
|
|
504
511
|
getTableFooter({ testId: t }) {
|
|
505
|
-
return this.page.getByTestId(n(t,
|
|
512
|
+
return this.page.getByTestId(n(t, g.CONTAINER)).locator(".table-footer").innerText();
|
|
506
513
|
}
|
|
507
514
|
async clickOnHeaderByName(t) {
|
|
508
|
-
await this.page.locator(
|
|
515
|
+
await this.page.locator(f, {
|
|
509
516
|
hasText: t
|
|
510
517
|
}).click();
|
|
511
518
|
}
|
|
512
519
|
async searchForItems({ testId: t, searchTerm: e }) {
|
|
513
|
-
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);
|
|
514
521
|
}
|
|
515
522
|
async clearSearchText({ testId: t }) {
|
|
516
|
-
await this.page.getByTestId(n(t,
|
|
523
|
+
await this.page.getByTestId(n(t, l.FIELD)).clear(), await this.waitForTableToLoad();
|
|
517
524
|
}
|
|
518
525
|
isArrowVisible({ testId: t, headerName: e }) {
|
|
519
|
-
return this.page.getByTestId(n(t,
|
|
526
|
+
return this.page.getByTestId(n(t, g.TABLE)).locator(f, { hasText: e }).locator(".table-sort-icon").isVisible();
|
|
520
527
|
}
|
|
521
528
|
async scrollDownTableRows({ testId: t }) {
|
|
522
529
|
const e = `[data-testid=${n(
|
|
523
530
|
t,
|
|
524
|
-
|
|
531
|
+
g.TABLE
|
|
525
532
|
)}]`;
|
|
526
533
|
await this.page.focus(e), await this.page.evaluate((o) => {
|
|
527
|
-
const
|
|
528
|
-
|
|
529
|
-
}, e), await this.page.waitForTimeout(
|
|
534
|
+
const s = document.querySelector(o);
|
|
535
|
+
s && (s.scrollTop = s.scrollHeight);
|
|
536
|
+
}, e), await this.page.waitForTimeout(M);
|
|
530
537
|
}
|
|
531
538
|
async waitForTableToLoad() {
|
|
532
|
-
await this.page.waitForSelector(
|
|
539
|
+
await this.page.waitForSelector(X, {
|
|
533
540
|
state: "hidden"
|
|
534
541
|
});
|
|
535
542
|
}
|
|
536
543
|
async waitingForTableLoadingToAppear() {
|
|
537
|
-
await this.page.waitForSelector(
|
|
544
|
+
await this.page.waitForSelector(X);
|
|
538
545
|
}
|
|
539
546
|
async expandRow({ testId: t, rowValue: e }) {
|
|
540
|
-
await this.page.getByTestId(n(t,
|
|
547
|
+
await this.page.getByTestId(n(t, g.BODY_WRAPPER)).locator(x, { hasText: e }).locator($).click();
|
|
541
548
|
}
|
|
542
549
|
isRowExpanded({ testId: t, rowValue: e }) {
|
|
543
|
-
return this.page.getByTestId(n(t,
|
|
550
|
+
return this.page.getByTestId(n(t, g.BODY_WRAPPER)).locator(x, { hasText: e }).locator($).isVisible();
|
|
544
551
|
}
|
|
545
552
|
async getExpandedRowContent({ testId: t, rowValue: e }) {
|
|
546
553
|
return await this.isRowExpanded({
|
|
547
554
|
testId: t,
|
|
548
555
|
rowValue: e
|
|
549
|
-
}) || 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();
|
|
550
557
|
}
|
|
551
558
|
isEmptyStateVisible({ testId: t }) {
|
|
552
|
-
return this.page.getByTestId(n(t,
|
|
559
|
+
return this.page.getByTestId(n(t, g.TABLE)).locator(".empty-state").isVisible();
|
|
553
560
|
}
|
|
554
561
|
getEmptyStateTitle({ testId: t }) {
|
|
555
|
-
return this.page.getByTestId(n(t,
|
|
562
|
+
return this.page.getByTestId(n(t, g.TABLE)).locator(".font-heading-4.title").textContent();
|
|
556
563
|
}
|
|
557
564
|
getEmptyStateSubtitle({ testId: t }) {
|
|
558
|
-
return this.page.getByTestId(n(t,
|
|
565
|
+
return this.page.getByTestId(n(t, g.TABLE)).locator(".font-body-1.subtitle").textContent();
|
|
559
566
|
}
|
|
560
567
|
async clickOnRowCheckboxByRowValue({ testId: t, rowValue: e }) {
|
|
561
|
-
await this.page.getByTestId(n(t,
|
|
568
|
+
await this.page.getByTestId(n(t, g.TABLE)).locator(x, {
|
|
562
569
|
hasText: e
|
|
563
|
-
}).locator(
|
|
570
|
+
}).locator(V).click();
|
|
564
571
|
}
|
|
565
572
|
getCheckedRowsNumber({ testId: t }) {
|
|
566
|
-
return this.page.getByTestId(n(t,
|
|
573
|
+
return this.page.getByTestId(n(t, g.TABLE)).locator(x).locator(".icon.checked").count();
|
|
567
574
|
}
|
|
568
575
|
async clickOnSelectAllCheckbox({ testId: t }) {
|
|
569
|
-
await this.page.getByTestId(n(t,
|
|
576
|
+
await this.page.getByTestId(n(t, g.TABLE)).locator(V).nth(0).click();
|
|
570
577
|
}
|
|
571
578
|
getTableLocator({ testId: t }) {
|
|
572
579
|
return this.page.getByTestId(
|
|
573
|
-
n(t,
|
|
580
|
+
n(t, g.CONTAINER)
|
|
574
581
|
);
|
|
575
582
|
}
|
|
576
583
|
getColumnContentByHeaderName({ testId: t, headerName: e }) {
|
|
577
584
|
return this.getTableLocator({ testId: t }).locator(e).allTextContents();
|
|
578
585
|
}
|
|
579
586
|
}
|
|
580
|
-
class
|
|
587
|
+
class tt {
|
|
581
588
|
constructor(t) {
|
|
582
|
-
|
|
589
|
+
r(this, "page");
|
|
583
590
|
this.page = t;
|
|
584
591
|
}
|
|
585
592
|
async waitForComponent({ testId: t }) {
|
|
@@ -599,219 +606,219 @@ class K {
|
|
|
599
606
|
return this.page.getByTestId(t).isDisabled();
|
|
600
607
|
}
|
|
601
608
|
}
|
|
602
|
-
class
|
|
609
|
+
class dt {
|
|
603
610
|
constructor(t) {
|
|
604
|
-
|
|
611
|
+
r(this, "page");
|
|
605
612
|
this.page = t;
|
|
606
613
|
}
|
|
607
614
|
async waitForComponent({ testId: t }) {
|
|
608
|
-
const e = `[data-testid='${t}-${
|
|
615
|
+
const e = `[data-testid='${t}-${w.CONTAINER}']`;
|
|
609
616
|
await this.page.waitForSelector(e);
|
|
610
617
|
}
|
|
611
618
|
getSnackbarTitle({ testId: t }) {
|
|
612
|
-
return this.page.getByTestId(n(t,
|
|
619
|
+
return this.page.getByTestId(n(t, w.TITLE)).textContent();
|
|
613
620
|
}
|
|
614
621
|
async closeSnackbar({ testId: t }) {
|
|
615
|
-
await this.page.getByTestId(n(t,
|
|
622
|
+
await this.page.getByTestId(n(t, w.CLOSE)).locator(".icon-name--x").click();
|
|
616
623
|
}
|
|
617
624
|
async waitForSnackbarToBeClosed({ testId: t }) {
|
|
618
|
-
const e = `[data-testid='${t}-${
|
|
625
|
+
const e = `[data-testid='${t}-${w.CONTAINER}']`;
|
|
619
626
|
await this.page.waitForSelector(e, { state: "detached" });
|
|
620
627
|
}
|
|
621
628
|
getSnackbarDescription({ testId: t }) {
|
|
622
|
-
return this.page.getByTestId(n(t,
|
|
629
|
+
return this.page.getByTestId(n(t, w.MESSAGE)).textContent();
|
|
623
630
|
}
|
|
624
631
|
async clickOnActionButton({ testId: t, buttonName: e }) {
|
|
625
632
|
const o = await this.getActionButtonIndex({
|
|
626
633
|
testId: t,
|
|
627
634
|
buttonName: e
|
|
628
|
-
}),
|
|
629
|
-
await this.page.click(
|
|
635
|
+
}), s = `[data-testid='${t}-${w.ACTION_BUTTON}-${o}']`;
|
|
636
|
+
await this.page.click(s);
|
|
630
637
|
}
|
|
631
638
|
async getActionButtonIndex({
|
|
632
639
|
testId: t,
|
|
633
640
|
buttonName: e
|
|
634
641
|
}) {
|
|
635
|
-
return (await this.page.getByTestId(n(t,
|
|
642
|
+
return (await this.page.getByTestId(n(t, w.CONTAINER)).locator(".font-button").allTextContents()).indexOf(e);
|
|
636
643
|
}
|
|
637
644
|
}
|
|
638
|
-
class
|
|
645
|
+
class yt {
|
|
639
646
|
constructor(t) {
|
|
640
|
-
|
|
647
|
+
r(this, "page");
|
|
641
648
|
this.page = t;
|
|
642
649
|
}
|
|
643
650
|
async waitForComponent({ testId: t }) {
|
|
644
|
-
const e = `[data-testid='${t}-${
|
|
651
|
+
const e = `[data-testid='${t}-${L.WRAPPER}']`;
|
|
645
652
|
await this.page.waitForSelector(e);
|
|
646
653
|
}
|
|
647
654
|
async closeMultiBar({ testId: t }) {
|
|
648
|
-
await this.page.getByTestId(n(t,
|
|
655
|
+
await this.page.getByTestId(n(t, L.CLOSE_BTN)).locator(".icon-wrapper").click();
|
|
649
656
|
}
|
|
650
657
|
getMultiBarCountText({ testId: t }) {
|
|
651
|
-
return this.page.getByTestId(n(t,
|
|
658
|
+
return this.page.getByTestId(n(t, L.WRAPPER)).locator(".count-text").textContent();
|
|
652
659
|
}
|
|
653
660
|
async isMultiBarVisible({ testId: t }) {
|
|
654
|
-
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();
|
|
655
662
|
}
|
|
656
663
|
async clickOnActionButton({ testId: t, actionButtonId: e }) {
|
|
657
664
|
await this.page.getByTestId(
|
|
658
665
|
n(
|
|
659
666
|
t,
|
|
660
|
-
`${
|
|
667
|
+
`${L.ACTION}-${e}`
|
|
661
668
|
)
|
|
662
669
|
).locator(".start-icon").click();
|
|
663
670
|
}
|
|
664
671
|
}
|
|
665
|
-
class
|
|
672
|
+
class wt {
|
|
666
673
|
constructor(t) {
|
|
667
|
-
|
|
674
|
+
r(this, "page");
|
|
668
675
|
this.page = t;
|
|
669
676
|
}
|
|
670
677
|
async waitForComponent({ testId: t }) {
|
|
671
|
-
const e = `[data-testid='${t}-${
|
|
678
|
+
const e = `[data-testid='${t}-${R.TEXT}']`;
|
|
672
679
|
await this.page.waitForSelector(e);
|
|
673
680
|
}
|
|
674
681
|
getFormRowTitle({ testId: t }) {
|
|
675
|
-
return new
|
|
682
|
+
return new b(this.page).getLabelText({ testId: t });
|
|
676
683
|
}
|
|
677
684
|
isFormRowMandatory({ testId: t }) {
|
|
678
|
-
return new
|
|
685
|
+
return new b(this.page).isMandatory({ testId: t });
|
|
679
686
|
}
|
|
680
687
|
getIconText({ testId: t }) {
|
|
681
|
-
return new
|
|
688
|
+
return new H(this.page).getExtraText({ testId: t });
|
|
682
689
|
}
|
|
683
690
|
}
|
|
684
|
-
class
|
|
691
|
+
class Et {
|
|
685
692
|
constructor(t) {
|
|
686
|
-
|
|
693
|
+
r(this, "page");
|
|
687
694
|
this.page = t;
|
|
688
695
|
}
|
|
689
696
|
async waitForComponent({ testId: t }) {
|
|
690
|
-
const e = `[data-testid='${t}-${
|
|
697
|
+
const e = `[data-testid='${t}-${I.CONTENT}']`;
|
|
691
698
|
await this.page.waitForSelector(e);
|
|
692
699
|
}
|
|
693
700
|
getCardTitle({ testId: t }) {
|
|
694
|
-
return this.page.getByTestId(n(t,
|
|
701
|
+
return this.page.getByTestId(n(t, I.TITLE)).textContent();
|
|
695
702
|
}
|
|
696
703
|
getCardContentText({ testId: t }) {
|
|
697
|
-
return this.page.getByTestId(n(t,
|
|
704
|
+
return this.page.getByTestId(n(t, I.CONTENT)).textContent();
|
|
698
705
|
}
|
|
699
706
|
getCardLabelText({ testId: t }) {
|
|
700
|
-
return new
|
|
707
|
+
return new b(this.page).getLabelText({ testId: t });
|
|
701
708
|
}
|
|
702
709
|
async clickOnSaveButton({ testId: t }) {
|
|
703
|
-
await this.page.getByTestId(n(t,
|
|
710
|
+
await this.page.getByTestId(n(t, I.SAVE_BUTTON)).click();
|
|
704
711
|
}
|
|
705
712
|
async clickOnCancelButton({ testId: t }) {
|
|
706
|
-
await this.page.getByTestId(n(t,
|
|
713
|
+
await this.page.getByTestId(n(t, I.CANCEL_BUTTON)).click();
|
|
707
714
|
}
|
|
708
715
|
isSaveButtonLoading({ testId: t }) {
|
|
709
|
-
return new
|
|
716
|
+
return new tt(this.page).isButtonLoading({ testId: t });
|
|
710
717
|
}
|
|
711
718
|
async clearForm({
|
|
712
719
|
testId: t,
|
|
713
720
|
inputType: e
|
|
714
721
|
}) {
|
|
715
|
-
(await this.page.getByTestId(n(t,
|
|
722
|
+
(await this.page.getByTestId(n(t, I.CONTENT)).locator(
|
|
716
723
|
`[data-testid='ad-units-form-card-form-card-content'] input[type='${e}']`
|
|
717
|
-
).all()).forEach((
|
|
724
|
+
).all()).forEach((s) => s.clear());
|
|
718
725
|
}
|
|
719
726
|
}
|
|
720
|
-
class
|
|
727
|
+
class O extends J {
|
|
721
728
|
constructor(t) {
|
|
722
729
|
super(t);
|
|
723
730
|
}
|
|
724
731
|
async waitForComponent({ testId: t }) {
|
|
725
|
-
const e = `[data-testid='${t}-${
|
|
732
|
+
const e = `[data-testid='${t}-${l.WRAPPER}']`;
|
|
726
733
|
await this.page.waitForSelector(e);
|
|
727
734
|
}
|
|
728
735
|
async isViewOnly({ testId: t }) {
|
|
729
|
-
return await this.page.getByTestId(n(t,
|
|
736
|
+
return await this.page.getByTestId(n(t, l.WRAPPER)).locator(".view-only.input-type").count() > 0;
|
|
730
737
|
}
|
|
731
738
|
getLabel({ testId: t }) {
|
|
732
|
-
return this.page.getByTestId(n(t,
|
|
739
|
+
return this.page.getByTestId(n(t, l.LABEL_TEXT)).textContent();
|
|
733
740
|
}
|
|
734
741
|
isInputMandatory({ testId: t }) {
|
|
735
|
-
return this.page.getByTestId(n(t,
|
|
742
|
+
return this.page.getByTestId(n(t, l.MANDATORY)).isVisible();
|
|
736
743
|
}
|
|
737
744
|
hasInputExtraHelpText({ testId: t }) {
|
|
738
|
-
return this.page.getByTestId(n(t,
|
|
745
|
+
return this.page.getByTestId(n(t, l.EXTRA_TEXT)).isVisible();
|
|
739
746
|
}
|
|
740
747
|
async getHelpIconText({ testId: t }) {
|
|
741
|
-
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");
|
|
742
749
|
return await e.hover(), e.getAttribute("text");
|
|
743
750
|
}
|
|
744
751
|
getInputExtraText({ testId: t }) {
|
|
745
|
-
return this.page.getByTestId(n(t,
|
|
752
|
+
return this.page.getByTestId(n(t, l.EXTRA_TEXT)).textContent();
|
|
746
753
|
}
|
|
747
754
|
getErrorExtraText({ testId: t }) {
|
|
748
|
-
return this.page.getByTestId(n(t,
|
|
755
|
+
return this.page.getByTestId(n(t, l.EXTRA_TEXT)).locator(".error").textContent();
|
|
749
756
|
}
|
|
750
757
|
async showPassword({ testId: t }) {
|
|
751
758
|
await this.isPasswordHidden({ testId: t }) && await this.clickOnPasswordButton({ testId: t });
|
|
752
759
|
}
|
|
753
760
|
async isPasswordHidden({ testId: t }) {
|
|
754
|
-
return await this.page.getByTestId(n(t,
|
|
761
|
+
return await this.page.getByTestId(n(t, l.WRAPPER)).getAttribute("type") === "password";
|
|
755
762
|
}
|
|
756
763
|
async clickOnPasswordButton({ testId: t }) {
|
|
757
|
-
await (await this.page.getByTestId(n(t,
|
|
764
|
+
await (await this.page.getByTestId(n(t, l.WRAPPER)).locator(".password-visibility")).click();
|
|
758
765
|
}
|
|
759
766
|
}
|
|
760
|
-
class
|
|
767
|
+
class Ct {
|
|
761
768
|
constructor(t) {
|
|
762
|
-
|
|
769
|
+
r(this, "page");
|
|
763
770
|
this.page = t;
|
|
764
771
|
}
|
|
765
772
|
async waitForComponent({ testId: t }) {
|
|
766
|
-
const e = `[data-testid='${t}-${
|
|
773
|
+
const e = `[data-testid='${t}-${D.CONTAINER}']`;
|
|
767
774
|
await this.page.waitForSelector(e);
|
|
768
775
|
}
|
|
769
776
|
async searchInput({ testId: t, searchTerm: e }) {
|
|
770
|
-
await new
|
|
777
|
+
await new O(this.page).addInput({ testId: t, text: e });
|
|
771
778
|
}
|
|
772
779
|
async clearInput({ testId: t }) {
|
|
773
|
-
await new
|
|
780
|
+
await new O(this.page).clearInput({ testId: t });
|
|
774
781
|
}
|
|
775
782
|
async clickOnXButton({ testId: t }) {
|
|
776
|
-
await this.page.getByTestId(n(t,
|
|
783
|
+
await this.page.getByTestId(n(t, D.CLEAR)).locator(".icon-name--x-circle").click();
|
|
777
784
|
}
|
|
778
785
|
isDisabled({ testId: t }) {
|
|
779
|
-
return new
|
|
786
|
+
return new O(this.page).isDisabled({ testId: t });
|
|
780
787
|
}
|
|
781
788
|
getSearchPlaceholder({ testId: t }) {
|
|
782
|
-
return new
|
|
789
|
+
return new O(this.page).getPlaceholderText({ testId: t });
|
|
783
790
|
}
|
|
784
791
|
getSearchInputValue({ testId: t }) {
|
|
785
|
-
return new
|
|
792
|
+
return new O(this.page).getInputsFieldText({ testId: t });
|
|
786
793
|
}
|
|
787
794
|
}
|
|
788
|
-
class
|
|
795
|
+
class et {
|
|
789
796
|
constructor(t) {
|
|
790
|
-
|
|
797
|
+
r(this, "page");
|
|
791
798
|
this.page = t;
|
|
792
799
|
}
|
|
793
800
|
async waitForComponent({ testId: t }) {
|
|
794
|
-
const e = `[data-testid='${t}-${
|
|
801
|
+
const e = `[data-testid='${t}-${v.TEXT}']`;
|
|
795
802
|
await this.page.waitForSelector(e);
|
|
796
803
|
}
|
|
797
804
|
getInlineCopyText({ testId: t }) {
|
|
798
|
-
return this.page.getByTestId(`${t}-${
|
|
805
|
+
return this.page.getByTestId(`${t}-${v.TEXT}`).textContent();
|
|
799
806
|
}
|
|
800
807
|
}
|
|
801
|
-
class
|
|
808
|
+
class mt {
|
|
802
809
|
constructor(t) {
|
|
803
|
-
|
|
810
|
+
r(this, "page");
|
|
804
811
|
this.page = t;
|
|
805
812
|
}
|
|
806
813
|
async waitForComponent({ testId: t }) {
|
|
807
|
-
const e = `[data-testid='${t}-${
|
|
814
|
+
const e = `[data-testid='${t}-${_.TITLE}']`;
|
|
808
815
|
await this.page.waitForSelector(e);
|
|
809
816
|
}
|
|
810
817
|
getHeaderTitle({ testId: t }) {
|
|
811
|
-
return this.page.getByTestId(`${t}-${
|
|
818
|
+
return this.page.getByTestId(`${t}-${_.TITLE}`).textContent();
|
|
812
819
|
}
|
|
813
820
|
getInlineCopyText({ testId: t }) {
|
|
814
|
-
return new
|
|
821
|
+
return new et(this.page).getInlineCopyText({
|
|
815
822
|
testId: t
|
|
816
823
|
});
|
|
817
824
|
}
|
|
@@ -819,12 +826,12 @@ class gt {
|
|
|
819
826
|
testId: t,
|
|
820
827
|
iconName: e
|
|
821
828
|
}) {
|
|
822
|
-
return await this.page.getByTestId(`${t}-${
|
|
829
|
+
return await this.page.getByTestId(`${t}-${_.APP_PLATFORM}`).getAttribute("data-platform") === e;
|
|
823
830
|
}
|
|
824
831
|
}
|
|
825
|
-
class
|
|
832
|
+
class It {
|
|
826
833
|
constructor(t) {
|
|
827
|
-
|
|
834
|
+
r(this, "page");
|
|
828
835
|
this.page = t;
|
|
829
836
|
}
|
|
830
837
|
async waitForComponent({ testId: t }) {
|
|
@@ -855,43 +862,43 @@ class Tt {
|
|
|
855
862
|
return this.page.getByTestId(n(t, d.WRAPPER)).getAttribute("class");
|
|
856
863
|
}
|
|
857
864
|
}
|
|
858
|
-
class
|
|
865
|
+
class at {
|
|
859
866
|
constructor(t) {
|
|
860
|
-
|
|
867
|
+
r(this, "page");
|
|
861
868
|
this.page = t;
|
|
862
869
|
}
|
|
863
870
|
async waitForComponent({ testId: t }) {
|
|
864
|
-
const e = `[data-testid='${t}-${
|
|
871
|
+
const e = `[data-testid='${t}-${C.FIELD}']`;
|
|
865
872
|
await this.page.waitForSelector(e);
|
|
866
873
|
}
|
|
867
874
|
async addInput({ testId: t, text: e }) {
|
|
868
|
-
await this.page.getByTestId(n(t,
|
|
875
|
+
await this.page.getByTestId(n(t, C.FIELD)).type(e);
|
|
869
876
|
}
|
|
870
877
|
async clearInput({ testId: t }) {
|
|
871
|
-
await this.page.getByTestId(n(t,
|
|
878
|
+
await this.page.getByTestId(n(t, C.FIELD)).clear();
|
|
872
879
|
}
|
|
873
880
|
getInput({ testId: t }) {
|
|
874
|
-
return this.page.getByTestId(n(t,
|
|
881
|
+
return this.page.getByTestId(n(t, C.FIELD)).inputValue();
|
|
875
882
|
}
|
|
876
883
|
getPlaceholderText({ testId: t }) {
|
|
877
|
-
return this.page.getByTestId(n(t,
|
|
884
|
+
return this.page.getByTestId(n(t, C.FIELD)).getAttribute("placeholder");
|
|
878
885
|
}
|
|
879
886
|
isDisabled({ testId: t }) {
|
|
880
|
-
return this.page.getByTestId(n(t,
|
|
887
|
+
return this.page.getByTestId(n(t, C.FIELD)).isDisabled();
|
|
881
888
|
}
|
|
882
889
|
}
|
|
883
|
-
class
|
|
890
|
+
class Bt extends at {
|
|
884
891
|
getLabelText({ testId: t }) {
|
|
885
|
-
return this.page.getByTestId(n(t,
|
|
892
|
+
return this.page.getByTestId(n(t, R.TEXT)).textContent();
|
|
886
893
|
}
|
|
887
894
|
hasFieldHelpText({ testId: t }) {
|
|
888
|
-
return this.page.getByTestId(n(t,
|
|
895
|
+
return this.page.getByTestId(n(t, E.CONTAINER)).isVisible();
|
|
889
896
|
}
|
|
890
897
|
getFieldHelpText({ testId: t }) {
|
|
891
|
-
return this.page.getByTestId(n(t,
|
|
898
|
+
return this.page.getByTestId(n(t, E.CONTAINER)).textContent();
|
|
892
899
|
}
|
|
893
900
|
}
|
|
894
|
-
class
|
|
901
|
+
class xt extends Z {
|
|
895
902
|
constructor(t) {
|
|
896
903
|
super(t);
|
|
897
904
|
}
|
|
@@ -914,37 +921,37 @@ class ut extends X {
|
|
|
914
921
|
return this.fieldHelpTextComponent.hasExtraTextIconType({ testId: t, type: e });
|
|
915
922
|
}
|
|
916
923
|
getSelectedLabel({ testId: t }) {
|
|
917
|
-
return this.page.getByTestId(n(t,
|
|
924
|
+
return this.page.getByTestId(n(t, i.BUTTON_CONTENT)).textContent();
|
|
918
925
|
}
|
|
919
926
|
async searchForItem({ testId: t, searchTerm: e }) {
|
|
920
|
-
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();
|
|
921
928
|
}
|
|
922
929
|
async isErrorText({ testId: t }) {
|
|
923
|
-
return await this.page.getByTestId(n(t,
|
|
930
|
+
return await this.page.getByTestId(n(t, E.TEXT)).count() > 0;
|
|
924
931
|
}
|
|
925
932
|
async isDisabled({ testId: t }) {
|
|
926
|
-
return (await this.page.getByTestId(n(t,
|
|
933
|
+
return (await this.page.getByTestId(n(t, i.TRIGGER)).locator(".button__container--disabled")).isVisible();
|
|
927
934
|
}
|
|
928
935
|
async clearAllOptions({ testId: t }) {
|
|
929
|
-
await this.page.getByTestId(n(t,
|
|
936
|
+
await this.page.getByTestId(n(t, i.ACTION_CLEAR_ALL)).click();
|
|
930
937
|
}
|
|
931
938
|
isSelectAllChecked({ testId: t }) {
|
|
932
|
-
return this.page.getByTestId(n(t,
|
|
939
|
+
return this.page.getByTestId(n(t, i.SELECT_ALL)).locator(".checkbox.input").isChecked();
|
|
933
940
|
}
|
|
934
941
|
isSelectAllIndeterminate({ testId: t }) {
|
|
935
|
-
return this.page.getByTestId(n(t,
|
|
942
|
+
return this.page.getByTestId(n(t, i.SELECT_ALL)).locator(".icon.indeterminate").isVisible();
|
|
936
943
|
}
|
|
937
944
|
async removeChipSelection({ testId: t }) {
|
|
938
|
-
await this.page.getByTestId(n(t,
|
|
945
|
+
await this.page.getByTestId(n(t, i.BUTTON_CLEAR)).click();
|
|
939
946
|
}
|
|
940
947
|
getDropdownOptions({ testId: t }) {
|
|
941
|
-
return this.page.getByTestId(n(t,
|
|
948
|
+
return this.page.getByTestId(n(t, i.LIST_CONTAINER)).locator(".list").allTextContents();
|
|
942
949
|
}
|
|
943
950
|
async expandTreeNode({
|
|
944
951
|
testId: t,
|
|
945
952
|
nodeName: e
|
|
946
953
|
}) {
|
|
947
|
-
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");
|
|
948
955
|
if (await o.isVisible())
|
|
949
956
|
await o.click();
|
|
950
957
|
else
|
|
@@ -952,179 +959,343 @@ class ut extends X {
|
|
|
952
959
|
}
|
|
953
960
|
async selectTreeDropdownOptionByName({
|
|
954
961
|
testId: t,
|
|
955
|
-
|
|
956
|
-
|
|
962
|
+
node: e,
|
|
963
|
+
item: o,
|
|
964
|
+
shouldExpand: s = !1
|
|
957
965
|
}) {
|
|
958
|
-
await this.openDropdownComponent({ testId: t }),
|
|
959
|
-
const
|
|
960
|
-
if (await
|
|
961
|
-
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();
|
|
962
970
|
else
|
|
963
|
-
throw new Error(`Option with text "${
|
|
971
|
+
throw new Error(`Option with text "${o}" not found in the dropdown.`);
|
|
964
972
|
}
|
|
965
973
|
async selectMultipleTreeItemsByName({
|
|
966
974
|
testId: t,
|
|
967
|
-
itemsToSelect: e
|
|
975
|
+
itemsToSelect: e,
|
|
976
|
+
node: o
|
|
968
977
|
}) {
|
|
969
978
|
await this.openDropdownComponent({ testId: t });
|
|
970
|
-
for (const
|
|
979
|
+
for (const s of e)
|
|
971
980
|
await this.selectTreeDropdownOptionByName({
|
|
972
981
|
testId: t,
|
|
973
|
-
|
|
982
|
+
node: o,
|
|
983
|
+
item: s,
|
|
974
984
|
shouldExpand: !0
|
|
975
985
|
});
|
|
976
986
|
await this.clickOnApply({ testId: t });
|
|
977
987
|
}
|
|
978
988
|
}
|
|
979
|
-
const
|
|
980
|
-
class
|
|
989
|
+
const nt = ".sortable-item";
|
|
990
|
+
class At {
|
|
981
991
|
constructor(t) {
|
|
982
|
-
|
|
992
|
+
r(this, "page");
|
|
983
993
|
this.page = t;
|
|
984
994
|
}
|
|
985
995
|
async waitForComponent({ testId: t }) {
|
|
986
|
-
const e = `[data-testid='${t}-${
|
|
996
|
+
const e = `[data-testid='${t}-${h.CONTAINER}']`;
|
|
987
997
|
await this.page.waitForSelector(e);
|
|
988
998
|
}
|
|
989
999
|
async isComponentLoaded(t) {
|
|
990
|
-
const e = `[data-testid='${t}-${
|
|
1000
|
+
const e = `[data-testid='${t}-${h.CONTAINER}']`;
|
|
991
1001
|
return this.page.isVisible(e);
|
|
992
1002
|
}
|
|
993
1003
|
async getItems(t) {
|
|
994
|
-
return this.page.getByTestId(n(t, "sortable-
|
|
1004
|
+
return this.page.getByTestId(n(t, h.CONTAINER)).locator(".sortable-item").allTextContents();
|
|
995
1005
|
}
|
|
996
1006
|
async sortItem(t, e, o) {
|
|
997
|
-
const
|
|
1007
|
+
const s = await this.page.getByTestId(
|
|
998
1008
|
n(t, "sortable-list-item")
|
|
999
|
-
),
|
|
1000
|
-
await
|
|
1009
|
+
), c = s.nth(e), p = s.nth(o);
|
|
1010
|
+
await c.dragTo(p);
|
|
1001
1011
|
}
|
|
1002
1012
|
async verifyOrder(t, e) {
|
|
1003
|
-
return (await this.getItems(t)).every((
|
|
1013
|
+
return (await this.getItems(t)).every((s, c) => s === e[c]);
|
|
1004
1014
|
}
|
|
1005
1015
|
async getListItemLocator({ testId: t, item: e, modifier: o }) {
|
|
1006
|
-
return this.page.getByTestId(n(t, o)).locator(
|
|
1016
|
+
return this.page.getByTestId(n(t, o)).locator(nt, {
|
|
1007
1017
|
hasText: e
|
|
1008
1018
|
});
|
|
1009
1019
|
}
|
|
1010
1020
|
async selectItem({ testId: t, item: e, isLockedItem: o }) {
|
|
1011
|
-
const
|
|
1021
|
+
const s = o ? h.LOCKED_LIST : h.DRAGGABLE_LIST;
|
|
1012
1022
|
await (await this.getListItemLocator({
|
|
1013
1023
|
testId: t,
|
|
1014
1024
|
item: e,
|
|
1015
|
-
modifier:
|
|
1025
|
+
modifier: s
|
|
1016
1026
|
})).click();
|
|
1017
1027
|
}
|
|
1018
1028
|
async isItemSelected(t) {
|
|
1019
1029
|
return await this.page.locator(".sortable-item--selected", { hasText: t }).count() > 0;
|
|
1020
1030
|
}
|
|
1021
1031
|
async expandItem({ testId: t, item: e, isLockedItem: o }) {
|
|
1022
|
-
const
|
|
1032
|
+
const s = o ? h.LOCKED_LIST : h.DRAGGABLE_LIST;
|
|
1023
1033
|
await (await this.getListItemLocator({
|
|
1024
1034
|
testId: t,
|
|
1025
1035
|
item: e,
|
|
1026
|
-
modifier:
|
|
1036
|
+
modifier: s
|
|
1027
1037
|
})).locator(".expand-icon").click();
|
|
1028
1038
|
}
|
|
1029
1039
|
async selectChildItem({
|
|
1030
1040
|
testId: t,
|
|
1031
1041
|
item: e,
|
|
1032
1042
|
childItem: o,
|
|
1033
|
-
isLockedItem:
|
|
1043
|
+
isLockedItem: s
|
|
1034
1044
|
}) {
|
|
1035
1045
|
await this.expandItem({
|
|
1036
1046
|
testId: t,
|
|
1037
1047
|
item: e,
|
|
1038
|
-
isLockedItem:
|
|
1048
|
+
isLockedItem: s
|
|
1039
1049
|
}), await this.page.locator("ul li span", {
|
|
1040
1050
|
hasText: o
|
|
1041
1051
|
}).click();
|
|
1042
1052
|
}
|
|
1043
1053
|
async isListOpened({ testId: t, item: e, isLockedItem: o }) {
|
|
1044
|
-
const
|
|
1054
|
+
const s = o ? h.LOCKED_LIST : h.DRAGGABLE_LIST;
|
|
1045
1055
|
return await (await this.getListItemLocator({
|
|
1046
1056
|
testId: t,
|
|
1047
1057
|
item: e,
|
|
1048
|
-
modifier:
|
|
1058
|
+
modifier: s
|
|
1049
1059
|
})).locator(".child-list ul").count() > 0;
|
|
1050
1060
|
}
|
|
1051
1061
|
async isChildItemSelected(t) {
|
|
1052
1062
|
return await this.page.locator("ul li span", { hasText: t }).count() > 0;
|
|
1053
1063
|
}
|
|
1054
1064
|
async openItemMenu({ testId: t, item: e, isLockedItem: o }) {
|
|
1055
|
-
const
|
|
1065
|
+
const s = o ? h.LOCKED_LIST : h.DRAGGABLE_LIST;
|
|
1056
1066
|
await (await this.getListItemLocator({
|
|
1057
1067
|
testId: t,
|
|
1058
1068
|
item: e,
|
|
1059
|
-
modifier:
|
|
1069
|
+
modifier: s
|
|
1060
1070
|
})).locator(".item__menu button").click();
|
|
1061
1071
|
}
|
|
1062
1072
|
async selectMenuItem({
|
|
1063
1073
|
testId: t,
|
|
1064
1074
|
item: e,
|
|
1065
1075
|
isLockedItem: o,
|
|
1066
|
-
menuItem:
|
|
1076
|
+
menuItem: s
|
|
1067
1077
|
}) {
|
|
1068
1078
|
await this.openItemMenu({
|
|
1069
1079
|
testId: t,
|
|
1070
1080
|
item: e,
|
|
1071
1081
|
isLockedItem: o
|
|
1072
1082
|
});
|
|
1073
|
-
const
|
|
1074
|
-
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" });
|
|
1075
1085
|
}
|
|
1076
1086
|
async isMenuOpened() {
|
|
1077
1087
|
return await this.page.locator(".dropdown-list-wrapper").count() > 0;
|
|
1078
1088
|
}
|
|
1079
1089
|
async dragAndDrop({ testId: t, item: e, isLockedItem: o }) {
|
|
1080
|
-
const
|
|
1090
|
+
const s = o ? h.LOCKED_LIST : h.DRAGGABLE_LIST, p = await (await this.getListItemLocator({
|
|
1081
1091
|
testId: t,
|
|
1082
1092
|
item: e,
|
|
1083
|
-
modifier:
|
|
1093
|
+
modifier: s
|
|
1084
1094
|
})).locator(".item.drag-allowed").first().boundingBox();
|
|
1085
|
-
if (
|
|
1086
|
-
const
|
|
1087
|
-
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();
|
|
1088
1098
|
}
|
|
1089
1099
|
}
|
|
1090
1100
|
async getListOrder() {
|
|
1091
|
-
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), {});
|
|
1092
1102
|
}
|
|
1093
1103
|
async searchForItem({ testId: t, searchTerm: e }) {
|
|
1094
|
-
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();
|
|
1095
1105
|
}
|
|
1096
1106
|
// returns array of booleans according to the search results in each group
|
|
1097
1107
|
async verifySearchResultDisplayed({ testId: t, item: e }) {
|
|
1098
|
-
const o = [],
|
|
1099
|
-
let
|
|
1100
|
-
for (const
|
|
1101
|
-
|
|
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);
|
|
1102
1112
|
return o;
|
|
1103
1113
|
}
|
|
1114
|
+
async getSelectedItem(t) {
|
|
1115
|
+
return this.page.getByTestId(n(t, h.CONTAINER)).locator(".sortable-item--selected").textContent();
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
class Lt {
|
|
1119
|
+
constructor(t) {
|
|
1120
|
+
r(this, "page");
|
|
1121
|
+
this.page = t;
|
|
1122
|
+
}
|
|
1123
|
+
async waitForComponent({ testId: t }) {
|
|
1124
|
+
const e = n(t, G.WRAPPER);
|
|
1125
|
+
await this.page.getByTestId(e).waitFor({ state: "visible" });
|
|
1126
|
+
}
|
|
1127
|
+
async selectView({ view: t, testId: e }) {
|
|
1128
|
+
const o = `[text="${t}"]`;
|
|
1129
|
+
console.log(o);
|
|
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);
|
|
1272
|
+
}
|
|
1104
1273
|
}
|
|
1105
1274
|
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
|
-
|
|
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
|
|
1130
1301
|
};
|