@ironsource/shared-ui-e2e 2.1.1-rc.3 → 2.1.1-test.4
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 +17 -18
- package/shared-e2e-commands.js +638 -0
- package/shared-e2e-commands.umd.cjs +2 -0
- package/tests/components/autocompleteDropdown/autocompleteDropdown-component.d.ts +16 -0
- package/tests/components/autocompleteDropdown/autocompleteDropdown-page.d.ts +16 -0
- package/tests/components/autocompleteDropdown/consts.d.ts +4 -0
- package/tests/components/autocompleteDropdown/types.d.ts +25 -0
- package/tests/components/banner/banner-component.d.ts +13 -0
- package/tests/components/banner/banner-page.d.ts +10 -0
- package/tests/components/banner/consts.d.ts +6 -0
- package/tests/components/banner/types.d.ts +4 -0
- package/tests/components/base-page/component-base-page.d.ts +10 -0
- package/tests/components/base-page/types.d.ts +11 -0
- package/tests/components/dialog/consts.d.ts +4 -0
- package/tests/components/dialog/dialog-component.d.ts +32 -0
- package/tests/components/dialog/dialog-page.d.ts +19 -0
- package/tests/components/dropdown/base-dropdown.d.ts +22 -0
- package/tests/components/dropdown/dropdown-v3/consts.d.ts +3 -0
- package/tests/components/dropdown/dropdown-v3/dropdown-component.d.ts +17 -0
- package/tests/components/dropdown/dropdown-v3/dropdown-page.d.ts +18 -0
- package/tests/components/dropdown/dropdown-v4/consts.d.ts +3 -0
- package/tests/components/dropdown/dropdown-v4/dropdown-component.d.ts +51 -0
- package/tests/components/dropdown/dropdown-v4/dropdown-page.d.ts +24 -0
- package/tests/components/dropdown/types.d.ts +16 -0
- package/tests/components/fieldHelpText/field-help-text-component.d.ts +12 -0
- package/tests/components/fieldHelpText/types.d.ts +4 -0
- package/tests/components/fieldLabel/field-label-component.d.ts +14 -0
- package/tests/components/includeExclude/consts.d.ts +3 -0
- package/tests/components/includeExclude/include-exclude-component.d.ts +31 -0
- package/tests/components/includeExclude/include-exclude-page.d.ts +21 -0
- package/tests/components/includeExclude/types.d.ts +18 -0
- package/tests/components/inputs/base-input.d.ts +22 -0
- package/tests/components/inputs/input-v3/consts.d.ts +13 -0
- package/tests/components/inputs/input-v3/input-component.d.ts +38 -0
- package/tests/components/inputs/input-v3/input-page.d.ts +25 -0
- package/tests/components/inputs/input-v4/consts.d.ts +3 -0
- package/tests/components/inputs/input-v4/inputs-component.d.ts +66 -0
- package/tests/components/inputs/input-v4/inputs-page.d.ts +32 -0
- package/tests/components/inputs/inputs-v3/checkbox/checkbox-component.d.ts +20 -0
- package/tests/components/inputs/inputs-v3/checkbox/checkbox-page.d.ts +12 -0
- package/tests/components/inputs/inputs-v3/checkbox/consts.d.ts +5 -0
- package/tests/components/inputs/inputs-v3/radio/consts.d.ts +6 -0
- package/tests/components/inputs/inputs-v3/radio/radio-component.d.ts +19 -0
- package/tests/components/inputs/inputs-v3/radio/radio-page.d.ts +15 -0
- package/tests/components/inputs/inputs-v3/radio/types.d.ts +4 -0
- package/tests/components/inputs/inputs-v3/switch/consts.d.ts +3 -0
- package/tests/components/inputs/inputs-v3/switch/switch-component.d.ts +14 -0
- package/tests/components/inputs/inputs-v3/switch/switch-page.d.ts +11 -0
- package/tests/components/inputs/inputs-v3/switch/types.d.ts +4 -0
- package/tests/components/inputs/inputs-v3/text-area/consts.d.ts +8 -0
- package/tests/components/inputs/inputs-v3/text-area/text-area-component.d.ts +37 -0
- package/tests/components/inputs/inputs-v3/text-area/text-area-page.d.ts +20 -0
- package/tests/components/inputs/inputs-v3/text-area/types.d.ts +4 -0
- package/tests/components/inputs/types.d.ts +4 -0
- package/tests/components/table/consts.d.ts +6 -0
- package/tests/components/table/table-component.d.ts +70 -0
- package/tests/components/table/table-page.d.ts +35 -0
- package/tests/components/table/types.d.ts +8 -0
- package/tests/components/tabs/consts.d.ts +3 -0
- package/tests/components/tabs/tabs-component.d.ts +15 -0
- package/tests/components/tabs/tabs-page.d.ts +15 -0
- package/tests/components/tabs/types.d.ts +4 -0
- package/tests/components/tooltip/consts.d.ts +3 -0
- package/tests/components/tooltip/tooltip-component.d.ts +14 -0
- package/tests/components/tooltip/tooltip-page.d.ts +13 -0
- package/tests/global/types.d.ts +3 -0
- package/tests/global/utils.d.ts +4 -0
- package/tests/index.d.ts +13 -0
- package/tests/testids/index.d.ts +197 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/vite.config.d.ts +2 -0
- package/components/banner/banner-component.ts +0 -21
- package/components/base-page/component-base-page.ts +0 -25
- package/components/dialog/dialog-component.ts +0 -49
- package/components/dropdown/base-dropdown.ts +0 -44
- package/components/dropdown/dropdown-v3/dropdown-component.ts +0 -20
- package/components/dropdown/dropdown-v4/dropdown-component.ts +0 -57
- package/components/fieldHelpText/field-help-text-component.ts +0 -20
- package/components/fieldLabel/field-label-component.ts +0 -23
- package/components/includeExclude/include-exclude-component.ts +0 -71
- package/components/inputs/base-input.ts +0 -29
- package/components/inputs/input-v4/inputs-component.ts +0 -84
- package/components/table/table-component.ts +0 -184
- package/components/tabs/tabs-component.ts +0 -31
- package/components/tooltip/tooltip-component.ts +0 -20
- package/global/utils.ts +0 -20
- package/index.ts +0 -26
- package/testids/index.ts +0 -14
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { DropdownTestIdModifiers as o, InputTestIdModifiers as i } from "../../../testids/index.ts";
|
|
2
|
-
import { getTestId as t } from "../../../global/utils.ts";
|
|
3
|
-
import { BaseDropdownComponent as r } from "../base-dropdown.ts";
|
|
4
|
-
import { FieldLabelComponent as s } from "../../fieldLabel/field-label-component.ts";
|
|
5
|
-
import { FieldHelpTextComponent as a } from "../../fieldHelpText/field-help-text-component.ts";
|
|
6
|
-
class g extends r {
|
|
7
|
-
fieldLabelComponent;
|
|
8
|
-
fieldHelpTextComponent;
|
|
9
|
-
constructor(e) {
|
|
10
|
-
super(e), this.fieldLabelComponent = new s(e), this.fieldHelpTextComponent = new a(e);
|
|
11
|
-
}
|
|
12
|
-
getDropdownTitle({ testId: e }) {
|
|
13
|
-
return this.fieldLabelComponent.getLabelText({ testId: e });
|
|
14
|
-
}
|
|
15
|
-
isMandatory({ testId: e }) {
|
|
16
|
-
return this.fieldLabelComponent.isMandatory({ testId: e });
|
|
17
|
-
}
|
|
18
|
-
getHelpIconText({ testId: e }) {
|
|
19
|
-
return this.fieldLabelComponent.getHelpIconText({ testId: e });
|
|
20
|
-
}
|
|
21
|
-
hasExtraText({ testId: e }) {
|
|
22
|
-
return this.fieldHelpTextComponent.hasExtraText({ testId: e });
|
|
23
|
-
}
|
|
24
|
-
getExtraText({ testId: e }) {
|
|
25
|
-
return this.fieldHelpTextComponent.getExtraText({ testId: e });
|
|
26
|
-
}
|
|
27
|
-
hasExtraTextIconType({ testId: e, type: n }) {
|
|
28
|
-
return this.fieldHelpTextComponent.hasExtraTextIconType({ testId: e, type: n });
|
|
29
|
-
}
|
|
30
|
-
getSelectedLabel({ testId: e }) {
|
|
31
|
-
return this.page.getByTestId(t(e, o.BUTTON_CONTENT)).textContent();
|
|
32
|
-
}
|
|
33
|
-
async searchForItem({ testId: e, searchTerm: n }) {
|
|
34
|
-
return await this.openDropdownComponent({ testId: e }), await this.page.getByTestId(t(e, i.FIELD)).fill(n), this.page.getByTestId(t(e, o.LIST_CONTAINER)).locator("ul > li span").first().textContent();
|
|
35
|
-
}
|
|
36
|
-
isErrorText({ testId: e }) {
|
|
37
|
-
return this.page.getByTestId(t(e, o.TRIGGER)).locator(".state-error").isVisible();
|
|
38
|
-
}
|
|
39
|
-
async isDisabled({ testId: e }) {
|
|
40
|
-
return (await this.page.getByTestId(t(e, o.TRIGGER)).locator(".button__container--disabled")).isVisible();
|
|
41
|
-
}
|
|
42
|
-
async clearAllOptions({ testId: e }) {
|
|
43
|
-
await this.page.getByTestId(t(e, o.ACTION_CLEAR_ALL)).click();
|
|
44
|
-
}
|
|
45
|
-
isSelectAllChecked({ testId: e }) {
|
|
46
|
-
return this.page.getByTestId(t(e, o.SELECT_ALL)).locator(".checkbox.input").isChecked();
|
|
47
|
-
}
|
|
48
|
-
isSelectAllIndeterminate({ testId: e }) {
|
|
49
|
-
return this.page.getByTestId(t(e, o.SELECT_ALL)).locator(".icon.indeterminate").isVisible();
|
|
50
|
-
}
|
|
51
|
-
async removeChipSelection({ testId: e }) {
|
|
52
|
-
await this.page.getByTestId(t(e, o.BUTTON_CLEAR)).click();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
export {
|
|
56
|
-
g as DropdownComponent
|
|
57
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { getTestId as e } from "../../global/utils.ts";
|
|
2
|
-
import { FieldHelpTextTestIdModifiers as o } from "../../testids/index.ts";
|
|
3
|
-
class n {
|
|
4
|
-
page;
|
|
5
|
-
constructor(t) {
|
|
6
|
-
this.page = t;
|
|
7
|
-
}
|
|
8
|
-
hasExtraText({ testId: t }) {
|
|
9
|
-
return this.page.getByTestId(e(t, o.TEXT)).isVisible();
|
|
10
|
-
}
|
|
11
|
-
getExtraText({ testId: t }) {
|
|
12
|
-
return this.page.getByTestId(e(t, o.TEXT)).textContent();
|
|
13
|
-
}
|
|
14
|
-
async hasExtraTextIconType({ testId: t, type: a }) {
|
|
15
|
-
return await (await this.page.getByTestId(e(t, o.CONTAINER)).locator(`.icon.icon-name--${a}`)).count() !== 0;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export {
|
|
19
|
-
n as FieldHelpTextComponent
|
|
20
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { getTestId as e } from "../../global/utils.ts";
|
|
2
|
-
import { FieldLabelTestIdModifiers as r } from "../../testids/index.ts";
|
|
3
|
-
class n {
|
|
4
|
-
page;
|
|
5
|
-
constructor(t) {
|
|
6
|
-
this.page = t;
|
|
7
|
-
}
|
|
8
|
-
getLabelText({ testId: t }) {
|
|
9
|
-
return this.page.getByTestId(e(t, r.TEXT)).textContent();
|
|
10
|
-
}
|
|
11
|
-
isMandatory({ testId: t }) {
|
|
12
|
-
return this.page.getByTestId(e(t, r.MANDATORY)).isVisible();
|
|
13
|
-
}
|
|
14
|
-
async getHelpIconText({ testId: t }) {
|
|
15
|
-
const s = await this.page.getByTestId(
|
|
16
|
-
e(t, r.TOOLTIP)
|
|
17
|
-
);
|
|
18
|
-
return await s.hover(), s.getAttribute("text");
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
export {
|
|
22
|
-
n as FieldLabelComponent
|
|
23
|
-
};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { IncludeExcludeTestIdModifiers as t } from "../../testids/index.ts";
|
|
2
|
-
import { getTestId as a } from "../../global/utils.ts";
|
|
3
|
-
class s {
|
|
4
|
-
page;
|
|
5
|
-
constructor(e) {
|
|
6
|
-
this.page = e;
|
|
7
|
-
}
|
|
8
|
-
async waitForComponent({ testId: e }) {
|
|
9
|
-
const i = `[data-testid='${e}-${t.TRIGGER}']`;
|
|
10
|
-
await this.page.waitForSelector(i);
|
|
11
|
-
}
|
|
12
|
-
async clickOnApply(e) {
|
|
13
|
-
await this.page.getByTestId(
|
|
14
|
-
a(e, t.ACTION_APPLY)
|
|
15
|
-
).click();
|
|
16
|
-
}
|
|
17
|
-
async clickOnCancel(e) {
|
|
18
|
-
await this.page.getByTestId(
|
|
19
|
-
a(e, t.ACTION_CANCEL)
|
|
20
|
-
).click();
|
|
21
|
-
}
|
|
22
|
-
async openIncludeExcludeComponent(e) {
|
|
23
|
-
await this.page.getByTestId(a(e, t.TRIGGER)).click();
|
|
24
|
-
}
|
|
25
|
-
async searchForItem({ testId: e, searchTerm: i }) {
|
|
26
|
-
return await this.openIncludeExcludeComponent(e), await this.page.getByTestId(a(e, t.SEARCH)).locator("input.transparent").fill(i), this.page.getByTestId(a(e, t.LIST)).locator("ul > li .v-popper span").first().textContent();
|
|
27
|
-
}
|
|
28
|
-
async selectItemByName({ testId: e, entityName: i }) {
|
|
29
|
-
await this.openIncludeExcludeComponent(e), await this.page.getByTestId(a(e, t.LIST)).locator("ul > li .v-popper span", { hasText: i }).first().click(), await this.clickOnApply(e);
|
|
30
|
-
}
|
|
31
|
-
async selectItemByIndex({ testId: e, index: i, applyChanges: c }) {
|
|
32
|
-
await this.clearAll({ testId: e }), await this.openIncludeExcludeComponent(e), await this.page.getByTestId(a(e, t.LIST)).locator(".include-exclude-list ul > li").nth(i).click(), await this.page.waitForSelector("include-exclude-list-header-loading", {
|
|
33
|
-
state: "hidden"
|
|
34
|
-
}), c && await this.clickOnApply(e);
|
|
35
|
-
}
|
|
36
|
-
async selectMultipleItems({ testId: e, itemsToSelect: i }) {
|
|
37
|
-
await this.clearAll({ testId: e }), await this.openIncludeExcludeComponent(e);
|
|
38
|
-
for (const c of i)
|
|
39
|
-
await this.page.getByTestId(a(e, t.LIST)).locator(".include-exclude-list ul > li").nth(c).click();
|
|
40
|
-
}
|
|
41
|
-
async unselectItemByName({ testId: e, entityName: i }) {
|
|
42
|
-
await this.openIncludeExcludeComponent(e), await this.page.getByTestId(
|
|
43
|
-
a(e, t.LIST_SELECTED)
|
|
44
|
-
).locator("ul > li", { hasText: i }).locator(".clear-button").click(), await this.clickOnApply(e);
|
|
45
|
-
}
|
|
46
|
-
async unselectByIndex({ testId: e, index: i, applyChanges: c }) {
|
|
47
|
-
await this.page.getByTestId(
|
|
48
|
-
a(e, t.LIST_SELECTED)
|
|
49
|
-
).locator("ul li button").nth(i).click(), c && await this.clickOnApply(e);
|
|
50
|
-
}
|
|
51
|
-
async getSelectedCounter(e) {
|
|
52
|
-
return await this.page.getByTestId(
|
|
53
|
-
a(e, t.LIST_SELECTED)
|
|
54
|
-
).locator(".include-exclude-selected-header-left span").textContent();
|
|
55
|
-
}
|
|
56
|
-
async clearAll({ testId: e }) {
|
|
57
|
-
await this.openIncludeExcludeComponent(e), await this.page.getByTestId(a(e, t.CLEAR_ALL)).click(), await this.clickOnApply(e);
|
|
58
|
-
}
|
|
59
|
-
getTriggerText({ testId: e }) {
|
|
60
|
-
return this.page.getByTestId(a(e, t.TRIGGER)).locator(".include-exclude-trigger-middle-section .container span").first().textContent();
|
|
61
|
-
}
|
|
62
|
-
getTriggerDescription({ testId: e }) {
|
|
63
|
-
return this.page.getByTestId(a(e, t.TRIGGER)).locator("div span.include-exclude-trigger-description").first().textContent();
|
|
64
|
-
}
|
|
65
|
-
async selectAll({ testId: e }) {
|
|
66
|
-
await this.openIncludeExcludeComponent(e), await this.page.getByTestId(a(e, t.SELECT_ALL)).click(), await this.clickOnApply(e);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
export {
|
|
70
|
-
s as IncludeExcludeComponent
|
|
71
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { InputTestIdModifiers as e } from "../../testids/index.ts";
|
|
2
|
-
import { getTestId as s } from "../../global/utils.ts";
|
|
3
|
-
class g {
|
|
4
|
-
page;
|
|
5
|
-
constructor(t) {
|
|
6
|
-
this.page = t;
|
|
7
|
-
}
|
|
8
|
-
getInputsFieldText({ testId: t }) {
|
|
9
|
-
return this.page.getByTestId(s(t, e.FIELD)).inputValue();
|
|
10
|
-
}
|
|
11
|
-
getPlaceholderText({ testId: t }) {
|
|
12
|
-
return this.page.getByTestId(s(t, e.FIELD)).getAttribute("placeholder");
|
|
13
|
-
}
|
|
14
|
-
getInputsType({ testId: t }) {
|
|
15
|
-
return this.page.getByTestId(s(t, e.FIELD)).getAttribute("type");
|
|
16
|
-
}
|
|
17
|
-
async addInput({ testId: t, text: a }) {
|
|
18
|
-
await this.page.getByTestId(s(t, e.FIELD)).type(a);
|
|
19
|
-
}
|
|
20
|
-
async clearInput({ testId: t }) {
|
|
21
|
-
await this.page.getByTestId(s(t, e.FIELD)).clear();
|
|
22
|
-
}
|
|
23
|
-
isDisabled({ testId: t }) {
|
|
24
|
-
return this.page.getByTestId(s(t, e.FIELD)).isDisabled();
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
export {
|
|
28
|
-
g as BaseInputComponent
|
|
29
|
-
};
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { InputTestIdModifiers as n } from "../../../testids/index.ts";
|
|
2
|
-
import { getTestId as i } from "../../../global/utils.ts";
|
|
3
|
-
import { BaseInputComponent as a } from "../base-input.ts";
|
|
4
|
-
import { FieldLabelComponent as s } from "../../fieldLabel/field-label-component.ts";
|
|
5
|
-
import { FieldHelpTextComponent as r } from "../../fieldHelpText/field-help-text-component.ts";
|
|
6
|
-
class h extends a {
|
|
7
|
-
fieldLabelComponent;
|
|
8
|
-
fieldHelpTextComponent;
|
|
9
|
-
constructor(t) {
|
|
10
|
-
super(t), this.fieldLabelComponent = new s(t), this.fieldHelpTextComponent = new r(t);
|
|
11
|
-
}
|
|
12
|
-
getInputsLabelText({ testId: t }) {
|
|
13
|
-
return this.fieldLabelComponent.getLabelText({ testId: t });
|
|
14
|
-
}
|
|
15
|
-
async waitForComponent({ testId: t }) {
|
|
16
|
-
const e = `[data-testid='${t}-${n.WRAPPER}']`;
|
|
17
|
-
await this.page.waitForSelector(e);
|
|
18
|
-
}
|
|
19
|
-
isInputMandatory({ testId: t }) {
|
|
20
|
-
return this.fieldLabelComponent.isMandatory({ testId: t });
|
|
21
|
-
}
|
|
22
|
-
hasInputExtraText({ testId: t }) {
|
|
23
|
-
return this.fieldHelpTextComponent.hasExtraText({ testId: t });
|
|
24
|
-
}
|
|
25
|
-
getInputExtraText({ testId: t }) {
|
|
26
|
-
return this.fieldHelpTextComponent.getExtraText({ testId: t });
|
|
27
|
-
}
|
|
28
|
-
async clickOnApplyButton({ testId: t }) {
|
|
29
|
-
await (await this.page.getByTestId(i(t, n.WRAPPER)).locator(".icon.icon-name--check")).click();
|
|
30
|
-
}
|
|
31
|
-
hasInlineErrorText({ testId: t }) {
|
|
32
|
-
return this.page.getByTestId(i(t, n.TOOLTIP)).isVisible();
|
|
33
|
-
}
|
|
34
|
-
async getInlineErrorText({ testId: t }) {
|
|
35
|
-
const e = await this.page.getByTestId(
|
|
36
|
-
i(t, n.TOOLTIP)
|
|
37
|
-
);
|
|
38
|
-
return await e.hover(), e.getAttribute("text");
|
|
39
|
-
}
|
|
40
|
-
async clickOnShowPassword({ testId: t }) {
|
|
41
|
-
await this.isPasswordHidden({ testId: t }) && await this.clickOnPasswordIcon({ testId: t });
|
|
42
|
-
}
|
|
43
|
-
async clickOnPasswordIcon({ testId: t }) {
|
|
44
|
-
await this.page.getByTestId(i(t, n.TOGGLE_PASSWORD)).click();
|
|
45
|
-
}
|
|
46
|
-
async clickOnHidePassword({ testId: t }) {
|
|
47
|
-
await this.isPasswordHidden({ testId: t }) || await this.clickOnPasswordIcon({ testId: t });
|
|
48
|
-
}
|
|
49
|
-
isPasswordHidden({ testId: t }) {
|
|
50
|
-
return this.page.getByTestId(i(t, n.TOGGLE_PASSWORD)).locator(".icon.icon-name--eye-slash").isVisible();
|
|
51
|
-
}
|
|
52
|
-
async clearInput({ testId: t }) {
|
|
53
|
-
const e = await this.page.getByTestId(
|
|
54
|
-
i(t, n.FIELD)
|
|
55
|
-
);
|
|
56
|
-
await e.click({ clickCount: 2 }), await e.type("");
|
|
57
|
-
}
|
|
58
|
-
hasExtraTextIconType({ testId: t, type: e }) {
|
|
59
|
-
return this.fieldHelpTextComponent.hasExtraTextIconType({ testId: t, type: e });
|
|
60
|
-
}
|
|
61
|
-
async isDisabled({ testId: t }) {
|
|
62
|
-
return (await this.page.getByTestId(
|
|
63
|
-
i(t, n.FIELD)
|
|
64
|
-
)).isDisabled();
|
|
65
|
-
}
|
|
66
|
-
hasApplyButton({ testId: t }) {
|
|
67
|
-
return this.page.getByTestId(i(t, n.WRAPPER)).locator(".icon.icon-name--check").isVisible();
|
|
68
|
-
}
|
|
69
|
-
async getMaxLengthNumber({ testId: t }) {
|
|
70
|
-
return (await this.getFontCaptionText({ testId: t }))[1];
|
|
71
|
-
}
|
|
72
|
-
async getActualNumberLength({ testId: t }) {
|
|
73
|
-
return (await this.getFontCaptionText({ testId: t }))[0];
|
|
74
|
-
}
|
|
75
|
-
async getFontCaptionText({ testId: t }) {
|
|
76
|
-
return (await this.page.getByTestId(i(t, n.WRAPPER)).locator(".font-caption").textContent()).split("/").map((o) => parseInt(o.trim(), 10));
|
|
77
|
-
}
|
|
78
|
-
getHelpIconText({ testId: t }) {
|
|
79
|
-
return this.fieldLabelComponent.getHelpIconText({ testId: t });
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
export {
|
|
83
|
-
h as InputsComponent
|
|
84
|
-
};
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import { TableTestIdModifiers as o, InputTestIdModifiers as s } from "../../testids/index.ts";
|
|
2
|
-
import { getTestId as n } from "../../global/utils.ts";
|
|
3
|
-
class h {
|
|
4
|
-
page;
|
|
5
|
-
constructor(e) {
|
|
6
|
-
this.page = e;
|
|
7
|
-
}
|
|
8
|
-
async waitForComponent({ testId: e }) {
|
|
9
|
-
const t = `[data-testid='${e}-${o.CONTAINER}']`;
|
|
10
|
-
await this.page.waitForSelector(t);
|
|
11
|
-
}
|
|
12
|
-
getTableRowCount({ testId: e }) {
|
|
13
|
-
return this.page.getByTestId(n(e, o.BODY_WRAPPER)).locator(".table-row").count();
|
|
14
|
-
}
|
|
15
|
-
getTableRowContentByIndex({
|
|
16
|
-
testId: e,
|
|
17
|
-
index: t
|
|
18
|
-
}) {
|
|
19
|
-
return this.page.getByTestId(`${e}-${o.BODY_WRAPPER}`).locator(".table-row").nth(t).innerText();
|
|
20
|
-
}
|
|
21
|
-
async getTableRowByRowValue({
|
|
22
|
-
testId: e,
|
|
23
|
-
rowHeader: t,
|
|
24
|
-
rowValue: a
|
|
25
|
-
}) {
|
|
26
|
-
const r = await this.getRowIndexByRowValue({
|
|
27
|
-
testId: e,
|
|
28
|
-
rowHeader: t,
|
|
29
|
-
rowValue: a
|
|
30
|
-
});
|
|
31
|
-
return this.getTableRowContentByIndex({ testId: e, index: r });
|
|
32
|
-
}
|
|
33
|
-
async getRowIndexByRowValue({
|
|
34
|
-
testId: e,
|
|
35
|
-
rowHeader: t,
|
|
36
|
-
rowValue: a
|
|
37
|
-
}) {
|
|
38
|
-
return (await this.getColumnValuesByHeader({
|
|
39
|
-
testId: e,
|
|
40
|
-
header: t
|
|
41
|
-
})).indexOf(a);
|
|
42
|
-
}
|
|
43
|
-
async getColumnValuesByHeader({
|
|
44
|
-
header: e,
|
|
45
|
-
testId: t
|
|
46
|
-
}) {
|
|
47
|
-
const a = await this.getColumnIndexByHeader({
|
|
48
|
-
testId: t,
|
|
49
|
-
header: e
|
|
50
|
-
});
|
|
51
|
-
return this.getColumnValuesByIndex({ testId: t, index: a });
|
|
52
|
-
}
|
|
53
|
-
async getColumnIndexByHeader({
|
|
54
|
-
header: e,
|
|
55
|
-
testId: t
|
|
56
|
-
}) {
|
|
57
|
-
return (await this.getColumnHeaders({ testId: t })).indexOf(e);
|
|
58
|
-
}
|
|
59
|
-
async getColumnValuesByIndex({
|
|
60
|
-
index: e,
|
|
61
|
-
testId: t
|
|
62
|
-
}) {
|
|
63
|
-
const a = [], r = await this.getTableRowCount({ testId: t });
|
|
64
|
-
for (let i = 0; i < r; i++) {
|
|
65
|
-
const l = (await this.getTableRowContentByIndex({
|
|
66
|
-
testId: t,
|
|
67
|
-
index: i
|
|
68
|
-
})).split(`
|
|
69
|
-
`)[e];
|
|
70
|
-
a.push(l);
|
|
71
|
-
}
|
|
72
|
-
return a;
|
|
73
|
-
}
|
|
74
|
-
async getColumnHeaders({ testId: e }) {
|
|
75
|
-
return this.page.getByTestId(n(e, o.TABLE)).locator(".table-head-container").allTextContents();
|
|
76
|
-
}
|
|
77
|
-
getTableLabel({ testId: e }) {
|
|
78
|
-
return this.page.getByTestId(n(e, o.HEADER)).innerText();
|
|
79
|
-
}
|
|
80
|
-
getTableFooter({ testId: e }) {
|
|
81
|
-
return this.page.getByTestId(n(e, o.CONTAINER)).locator(".table-footer").innerText();
|
|
82
|
-
}
|
|
83
|
-
async clickOnSortByHeaderName({ testId: e, headerName: t }) {
|
|
84
|
-
await this.clickOnHeaderByName({ testId: e, headerName: t });
|
|
85
|
-
}
|
|
86
|
-
async clickOnHeaderByName({ testId: e, headerName: t }) {
|
|
87
|
-
const a = await this.getColumnIndexByHeader({
|
|
88
|
-
testId: e,
|
|
89
|
-
header: t
|
|
90
|
-
});
|
|
91
|
-
await this.page.getByTestId(n(e, o.TABLE)).locator(".table-head-container").nth(a).click();
|
|
92
|
-
}
|
|
93
|
-
// not sure if I should have an instance of input component and call its function
|
|
94
|
-
async searchForItems({ testId: e, searchTerm: t }) {
|
|
95
|
-
await this.clearSearchText({ testId: e }), await this.page.getByTestId(n(e, s.FIELD)).fill(t);
|
|
96
|
-
}
|
|
97
|
-
async clearSearchText({ testId: e }) {
|
|
98
|
-
await this.page.getByTestId(n(e, s.FIELD)).clear();
|
|
99
|
-
}
|
|
100
|
-
async isArrowVisible({ testId: e, headerName: t }) {
|
|
101
|
-
const a = await this.getColumnIndexByHeader({
|
|
102
|
-
header: t,
|
|
103
|
-
testId: e
|
|
104
|
-
});
|
|
105
|
-
return this.page.getByTestId(n(e, o.TABLE)).locator(".table-head-container").nth(a).locator(".table-sort-icon").isVisible();
|
|
106
|
-
}
|
|
107
|
-
async scrollDownTableRows({ testId: e }) {
|
|
108
|
-
const t = `[data-testid=${n(
|
|
109
|
-
e,
|
|
110
|
-
o.TABLE
|
|
111
|
-
)}]`;
|
|
112
|
-
await this.page.focus(t), await this.page.evaluate((a) => {
|
|
113
|
-
const r = document.querySelector(a);
|
|
114
|
-
r && (r.scrollTop = r.scrollHeight);
|
|
115
|
-
}, t), await this.waitForTableToLoad();
|
|
116
|
-
}
|
|
117
|
-
async waitForTableToLoad() {
|
|
118
|
-
await this.page.waitForSelector(".table-row.loading", {
|
|
119
|
-
state: "hidden"
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
async expandRow({
|
|
123
|
-
testId: e,
|
|
124
|
-
headerName: t,
|
|
125
|
-
rowValue: a
|
|
126
|
-
}) {
|
|
127
|
-
const r = await this.getRowIndexByRowValue({
|
|
128
|
-
testId: e,
|
|
129
|
-
rowHeader: t,
|
|
130
|
-
rowValue: a
|
|
131
|
-
});
|
|
132
|
-
await this.page.getByTestId(n(e, o.BODY_WRAPPER)).locator(".table-row").nth(r).locator(".icon-wrapper").click();
|
|
133
|
-
}
|
|
134
|
-
async isRowExpanded({ testId: e, headerName: t, rowValue: a }) {
|
|
135
|
-
const r = await this.getRowIndexByRowValue({
|
|
136
|
-
testId: e,
|
|
137
|
-
rowHeader: t,
|
|
138
|
-
rowValue: a
|
|
139
|
-
});
|
|
140
|
-
return this.page.getByTestId(n(e, o.BODY_WRAPPER)).locator(".table-row").nth(r).locator(".icon-wrapper").isVisible();
|
|
141
|
-
}
|
|
142
|
-
async getExpandedRowContent({ testId: e, headerName: t, rowValue: a }) {
|
|
143
|
-
await this.isRowExpanded({
|
|
144
|
-
testId: e,
|
|
145
|
-
headerName: t,
|
|
146
|
-
rowValue: a
|
|
147
|
-
}) || await this.expandRow({ testId: e, headerName: t, rowValue: a });
|
|
148
|
-
const i = await this.getRowIndexByRowValue({
|
|
149
|
-
testId: e,
|
|
150
|
-
rowHeader: t,
|
|
151
|
-
rowValue: a
|
|
152
|
-
});
|
|
153
|
-
return this.page.getByTestId(n(e, o.BODY_WRAPPER)).locator(".table-row").nth(i).locator(".icon-wrapper").textContent();
|
|
154
|
-
}
|
|
155
|
-
isEmptyStateVisible({ testId: e }) {
|
|
156
|
-
return this.page.getByTestId(n(e, o.TABLE)).locator(".empty-state").isVisible();
|
|
157
|
-
}
|
|
158
|
-
getEmptyStateTitle({ testId: e }) {
|
|
159
|
-
return this.page.getByTestId(n(e, o.TABLE)).locator(".font-heading-4.title").textContent();
|
|
160
|
-
}
|
|
161
|
-
getEmptyStateSubtitle({ testId: e }) {
|
|
162
|
-
return this.page.getByTestId(n(e, o.TABLE)).locator(".font-body-1.subtitle").textContent();
|
|
163
|
-
}
|
|
164
|
-
async clickOnRowCheckboxByIndex({ testId: e, index: t }) {
|
|
165
|
-
await this.page.getByTestId(n(e, o.BODY_WRAPPER)).locator(".table-row").nth(t).locator(".states").click();
|
|
166
|
-
}
|
|
167
|
-
async clickOnRowCheckboxByRowValue({ testId: e, rowHeader: t, rowValue: a }) {
|
|
168
|
-
const r = await this.getRowIndexByRowValue({
|
|
169
|
-
testId: e,
|
|
170
|
-
rowHeader: t,
|
|
171
|
-
rowValue: a
|
|
172
|
-
});
|
|
173
|
-
await this.clickOnRowCheckboxByIndex({ testId: e, index: r });
|
|
174
|
-
}
|
|
175
|
-
getCheckedRowsNumber({ testId: e }) {
|
|
176
|
-
return this.page.getByTestId(n(e, o.TABLE)).locator(".table-row").locator(".icon.checked").count();
|
|
177
|
-
}
|
|
178
|
-
async clickOnSelectAllCheckbox({ testId: e }) {
|
|
179
|
-
await this.page.getByTestId(n(e, o.TABLE)).locator(".states").nth(0).click();
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
export {
|
|
183
|
-
h as TableComponent
|
|
184
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { TabsTestIdModifiers as a } from "../../testids/index.ts";
|
|
2
|
-
import { getTestId as i } from "../../global/utils.ts";
|
|
3
|
-
class r {
|
|
4
|
-
page;
|
|
5
|
-
constructor(t) {
|
|
6
|
-
this.page = t;
|
|
7
|
-
}
|
|
8
|
-
async waitForComponent({ testId: t }) {
|
|
9
|
-
const e = `[data-testid='${t}-${a.WRAPPER}']`;
|
|
10
|
-
await this.page.waitForSelector(e);
|
|
11
|
-
}
|
|
12
|
-
getSelectedTabText({ testId: t }) {
|
|
13
|
-
return this.page.getByTestId(i(t, a.WRAPPER)).locator(".tab-item--active").textContent();
|
|
14
|
-
}
|
|
15
|
-
async selectTab({ testId: t, tabName: e }) {
|
|
16
|
-
const s = await this.getTabIndex({ testId: t, tabName: e });
|
|
17
|
-
await this.page.getByTestId(
|
|
18
|
-
i(t, `${a.TAB}-${s + 1}`)
|
|
19
|
-
).click();
|
|
20
|
-
}
|
|
21
|
-
async getTabIndex({ testId: t, tabName: e }) {
|
|
22
|
-
return (await this.page.getByTestId(i(t, a.WRAPPER)).locator(".tab-item").allTextContents()).indexOf(e);
|
|
23
|
-
}
|
|
24
|
-
async isTabDisabled({ testId: t, tabName: e }) {
|
|
25
|
-
const s = await this.getTabIndex({ testId: t, tabName: e });
|
|
26
|
-
return this.page.getByTestId(i(t, `${a.TAB}-${s}`)).locator(".tab-item--disabled").isVisible();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
export {
|
|
30
|
-
r as TabsComponent
|
|
31
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { TooltipTestIdModifiers as e } from "../../testids/index.ts";
|
|
2
|
-
class i {
|
|
3
|
-
page;
|
|
4
|
-
constructor(t) {
|
|
5
|
-
this.page = t;
|
|
6
|
-
}
|
|
7
|
-
async waitForComponent({ testId: t }) {
|
|
8
|
-
const o = `[data-testid='${t}-${e.TRIGGER}']`;
|
|
9
|
-
await this.page.waitForSelector(o);
|
|
10
|
-
}
|
|
11
|
-
getTooltipText({ testId: t }) {
|
|
12
|
-
return this.page.getByTestId(`${t}-${e.TRIGGER}`).getAttribute("text");
|
|
13
|
-
}
|
|
14
|
-
getTooltipHeaderText({ testId: t }) {
|
|
15
|
-
return this.page.getByTestId(`${t}-${e.TRIGGER}`).getAttribute("header");
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export {
|
|
19
|
-
i as TooltipComponent
|
|
20
|
-
};
|
package/global/utils.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const n = (o, t) => {
|
|
2
|
-
const r = new URLSearchParams(o).toString();
|
|
3
|
-
return t.includes("?") ? `${t}${r}` : `${t}?${r}`;
|
|
4
|
-
}, i = (o, t = {}) => {
|
|
5
|
-
const r = [];
|
|
6
|
-
Object.entries(t).forEach(([a, e]) => {
|
|
7
|
-
r.push(`${a}:${e}`);
|
|
8
|
-
});
|
|
9
|
-
const s = {
|
|
10
|
-
id: o,
|
|
11
|
-
viewMode: "story",
|
|
12
|
-
args: r.join(";")
|
|
13
|
-
};
|
|
14
|
-
return n(s, "iframe.html");
|
|
15
|
-
}, d = (o, t) => `${o}-${t}`;
|
|
16
|
-
export {
|
|
17
|
-
n as addPropsToUrl,
|
|
18
|
-
i as createStoryBookComponentPath,
|
|
19
|
-
d as getTestId
|
|
20
|
-
};
|
package/index.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { BannerComponent as n } from "./components/banner/banner-component.ts";
|
|
2
|
-
import { ComponentBasePage as r } from "./components/base-page/component-base-page.ts";
|
|
3
|
-
import { DialogComponent as m } from "./components/dialog/dialog-component.ts";
|
|
4
|
-
import { DropdownComponent as f } from "./components/dropdown/dropdown-v4/dropdown-component.ts";
|
|
5
|
-
import { DropdownComponentV3 as l } from "./components/dropdown/dropdown-v3/dropdown-component.ts";
|
|
6
|
-
import { FieldHelpTextComponent as d } from "./components/fieldHelpText/field-help-text-component.ts";
|
|
7
|
-
import { FieldLabelComponent as T } from "./components/fieldLabel/field-label-component.ts";
|
|
8
|
-
import { IncludeExcludeComponent as s } from "./components/includeExclude/include-exclude-component.ts";
|
|
9
|
-
import { InputsComponent as D } from "./components/inputs/input-v4/inputs-component.ts";
|
|
10
|
-
import { TabsComponent as g } from "./components/tabs/tabs-component.ts";
|
|
11
|
-
import { TooltipComponent as B } from "./components/tooltip/tooltip-component.ts";
|
|
12
|
-
import { TableComponent as I } from "./components/table/table-component.ts";
|
|
13
|
-
export {
|
|
14
|
-
n as BannerComponent,
|
|
15
|
-
r as ComponentBasePage,
|
|
16
|
-
m as DialogComponent,
|
|
17
|
-
f as DropdownComponent,
|
|
18
|
-
l as DropdownComponentV3,
|
|
19
|
-
d as FieldHelpTextComponent,
|
|
20
|
-
T as FieldLabelComponent,
|
|
21
|
-
s as IncludeExcludeComponent,
|
|
22
|
-
D as InputsComponent,
|
|
23
|
-
I as TableComponent,
|
|
24
|
-
g as TabsComponent,
|
|
25
|
-
B as TooltipComponent
|
|
26
|
-
};
|
package/testids/index.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var a = /* @__PURE__ */ ((E) => (E.TRIGGER = "ie-trigger", E.CONTENT = "ie-content", E.SEARCH = "ie-search", E.LIST = "ie-list", E.LIST_SELECTED = "ie-list-selected", E.ACTION_CANCEL = "ie-action-cancel", E.ACTION_APPLY = "ie-action-apply", E.SELECT_ALL = "ie-select-all", E.CLEAR_ALL = "ie-clear-all", E))(a || {}), A = /* @__PURE__ */ ((E) => (E.TRIGGER = "dd-trigger", E.WRAPPER = "dd-wrapper", E.BUTTON = "dd-button", E.BUTTON_WRAPPER = "dd-button-wrapper", E.BUTTON_CONTENT = "dd-button-content", E.BUTTON_CLEAR = "dd-button-clear", E.LABEL = "dd-label", E.LIST_CONTAINER = "dd-list-container", E.SEARCH = "dd-search", E.TITLE = "dd-title", E.ACTION_CANCEL = "dd-action-cancel", E.ACTION_APPLY = "dd-action-apply", E.ACTION_CLEAR_ALL = "dd-action-clear-all", E.HELPER_TEXT = "dd-helper-text", E.HELPER_TEXT_ERROR = "dd-helper-text-error", E.SELECT_ALL = "dd-select-all", E.NO_RESULT = "dd-no-result", E))(A || {}), t = /* @__PURE__ */ ((E) => (E.WRAPPER = "banner-wrapper", E.CONTENT = "banner-content", E))(t || {}), R = /* @__PURE__ */ ((E) => (E.WRAPPER = "dialog-wrapper", E.HEADER = "dialog-header", E.ACTION_CLOSE = "dialog-action-close", E.HEADER_SECONDARY = "dialog-header-secondary", E.CONTENT = "dialog-content", E.ACTION_BUTTONS_WRAPPER = "dialog-action-buttons-wrapper", E.BACKDROP = "dialog-backdrop", E.SAVE_BUTTON = "dialog-save-button", E.CANCEL_BUTTON = "dialog-cancel-button", E))(R || {}), N = /* @__PURE__ */ ((E) => (E.WRAPPER = "input-wrapper", E.TOOLTIP = "input-tooltip", E.MANDATORY = "input-mandatory", E.LABEL_CONTAINER = "input-label-container", E.LABEL_TEXT = "input-label-text", E.FIELD = "input-field", E.EXTRA_TEXT = "input-extra-text", E.TOGGLE_PASSWORD = "input-toggle-password-icon", E))(N || {}), O = /* @__PURE__ */ ((E) => (E.CONTAINER = "search-container", E.FIELD = "search-field", E.CLOSE = "search-close", E.CLEAR = "search-clear", E))(O || {}), C = /* @__PURE__ */ ((E) => (E.CONTAINER = "tbl-container", E.TABLE = "tbl-table", E.HEADER = "tbl-header", E.TITLE = "tbl-title", E.HEADER_RIGHT = "tbl-header-right", E.ACTIONS = "tbl-actions", E.SECTIONS = "tbl-sections", E.BODY_WRAPPER = "tbl-body-wrapper", E.EMPTY_STATE = "tbl-empty-state", E))(C || {}), L = /* @__PURE__ */ ((E) => (E.TEXT = "tt-text", E.TRIGGER = "tt-trigger", E.HEADER = "tt-header", E))(L || {}), l = /* @__PURE__ */ ((E) => (E.WRAPPER = "tabs-wrapper", E.TAB = "tabs-tab", E))(l || {}), n = /* @__PURE__ */ ((E) => (E.CONTAINER = "field-label-container", E.TEXT = "field-label-text", E.MANDATORY = "field-label-mandatory", E.TOOLTIP = "field-label-help-tooltip", E))(n || {}), _ = /* @__PURE__ */ ((E) => (E.CONTAINER = "field-help-text-container", E.TEXT = "field-help-text-text", E.ICON = "field-help-text-icon", E))(_ || {});
|
|
2
|
-
export {
|
|
3
|
-
t as BannerTestIdModifiers,
|
|
4
|
-
R as DialogTestIdModifiers,
|
|
5
|
-
A as DropdownTestIdModifiers,
|
|
6
|
-
_ as FieldHelpTextTestIdModifiers,
|
|
7
|
-
n as FieldLabelTestIdModifiers,
|
|
8
|
-
a as IncludeExcludeTestIdModifiers,
|
|
9
|
-
N as InputTestIdModifiers,
|
|
10
|
-
O as SearchTestIdModifiers,
|
|
11
|
-
C as TableTestIdModifiers,
|
|
12
|
-
l as TabsTestIdModifiers,
|
|
13
|
-
L as TooltipTestIdModifiers
|
|
14
|
-
};
|