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