dimsum-e2e-tests 3.51.0-next.2 → 3.51.0-next.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/CHANGELOG.md +8 -0
- package/ds-breadcrumb/DSBreadcrumb.axe-core.func.spec.js +21 -6
- package/ds-breadcrumb/DSBreadcrumb.func.spec.js +23 -2
- package/ds-breadcrumb/DSBreadcrumb.visual.spec.js +20 -15
- package/ds-breadcrumb/DSBreadcrumbCO.js +17 -1
- package/ds-button-v3/DSButtonV3CO.js +4 -0
- package/ds-controlled-form/ds-combobox/DSCombobox.func.spec.js +1 -0
- package/ds-controlled-form/ds-combobox/DSCombobox.smoke.spec.js +4 -56
- package/ds-controlled-form/ds-combobox/DSComboboxCO.js +0 -9
- package/ds-controlled-form/ds-combobox/creatable/DSCombobox.keyboard-creatable.func.spec.js +3 -0
- package/ds-controlled-form/ds-combobox/inline/DSCombobox.inline.axe-core.spec.js +0 -1
- package/ds-controlled-form/ds-combobox/inline/DSCombobox.inline.keyboard.func.spec.js +5 -0
- package/ds-controlled-form/ds-combobox/multi-select/DSCombobox.keyboard-multi-select.func.spec.js +6 -68
- package/ds-controlled-form/ds-combobox/multi-select/DSCombobox.mouse-touch-multi-select.func.spec.js +0 -58
- package/ds-controlled-form/ds-combobox/multi-select/DSCombobox.multi.visual.spec.js +0 -16
- package/ds-controlled-form/ds-combobox/multi-select/DSCombobox.ten-thousand-options.func.spec.js +2 -22
- package/ds-controlled-form/ds-combobox/single-select/DSCombobox.keyboard-single-select.func.spec.js +4 -0
- package/ds-controlled-form/ds-controlled-date-range-picker/DSControlledDateRangePicker.axe-core.spec.js +85 -0
- package/ds-controlled-form/ds-controlled-date-range-picker/DSControlledDateRangePicker.functional.spec.js +242 -0
- package/ds-controlled-form/ds-controlled-date-range-picker/DSControlledDateRangePicker.visual.spec.js +115 -0
- package/ds-controlled-form/ds-controlled-date-range-picker/DSControlledDateRangePickerCO.js +54 -2
- package/ds-controlled-form/ds-controlled-inputgroup/DSControlledInputGroupCO.js +4 -0
- package/ds-controlled-form/ds-controlled-inputgroup/autocomplete/DSControlledInputGroup.autocomplete.axe-core.func.spec.js +1 -0
- package/ds-controlled-form/ds-controlled-inputgroup/combobox/DSControlledInputGroup.combobox.axe-core.func.spec.js +1 -1
- package/ds-controlled-form/ds-controlled-large-input-text/read-only/DSLargeInputText.read-only.axe-core.func.spec.js +1 -1
- package/ds-controlled-form/ds-controlled-large-input-text/read-only/DSLargeInputText.read-only.func.spec.js +36 -0
- package/ds-controlled-form/ds-controlled-large-input-text/read-only/DSLargeInputText.read-only.visual.spec.js +12 -1
- package/ds-controlled-form/ds-input-text/DSInputText.func.spec.js +14 -12
- package/ds-controlled-form/react-hook-form/ReactHook.visual.spec.js +1 -0
- package/ds-data-table-async/DSDataTable.smoke.spec.js +4 -0
- package/ds-data-table-async/basic/DSDataTable.usecases.func.spec.js +5 -4
- package/ds-data-table-async/basic/DSDataTable.usecases.visual.spec.js +1 -0
- package/ds-data-table-async/components/RowCO.js +4 -0
- package/ds-data-table-async/dnd/DSDataTable.dnd.visual.spec.js +1 -1
- package/ds-data-table-async/filters/DSDataTable.filters-creatable.func.spec.js +4 -0
- package/ds-data-table-async/filters/DSDataTable.text-filters.func.spec.js +1 -0
- package/ds-data-table-async/select/DSDataTable.select.axe-core.func.spec.js +2 -0
- package/ds-data-table-async/select/DSDataTable.select.func.spec.js +2 -86
- package/ds-data-table-async/select/DSDataTable.select.shift.func.spec.js +126 -0
- package/ds-data-table-async/vissibility/DSDataTable.vissibility.visual.spec.js +6 -0
- package/ds-form-combobox-multi/DSComboboxMultiCO.js +2 -9
- package/ds-form-combobox-multi/aria-disabled/DSComboboxMulti.aria-disabled.visual.spec.js +2 -11
- package/ds-form-combobox-multi/read-only/DSComboboxMulti.read-only.axe-core.func.spec.js +26 -0
- package/ds-form-combobox-multi/read-only/DSComboboxMulti.read-only.visual.spec.js +39 -0
- package/ds-form-combobox-single/DSComboboxSingleCO.js +2 -9
- package/ds-form-combobox-single/read-only/DSComboboxSingle.read-only.axe-core.func.spec.js +26 -0
- package/ds-form-combobox-single/read-only/DSComboboxSingle.read-only.visual.spec.js +39 -0
- package/ds-form-layout-blocks/form-layout-block-item/DSFormLayoutBlockItemCO.js +4 -0
- package/ds-menu-button/DSMenuButtonCO.js +9 -5
- package/ds-menu-button/activable/DSMenuButton.activableMenuItem.func.spec.js +32 -0
- package/ds-menu-button/{basic/DSMenuButton.activableMenuItem.func.spec.js → activable/DSMenuButton.activableMenuItem.keyboardnav.func.spec.js} +1 -26
- package/ds-menu-button/disabled/DSMenuButton.axe-core.disabled.func.spec.js +20 -0
- package/ds-menu-button/disabled/DSMenuButton.disabled.func.spec.js +28 -0
- package/ds-menu-button/leftdecorations/DSMenuButton.axe-core.leftDecor.func.spec.js +20 -0
- package/ds-menu-button/multiselect/DSMenuButton.axe-core.multiselect.func.spec.js +28 -0
- package/ds-menu-button/multiselect/DSMenuButton.multiSelectItem.func.spec.js +34 -0
- package/ds-menu-button/{basic/DSMenuButton.multiSelectItem.func.spec.js → multiselect/DSMenuButton.multiSelectItem.keyboardnav.func.spec.js} +0 -29
- package/ds-menu-button/singleSelect/DSMenuButton.axe-core.singleSelect.func.spec.js +28 -0
- package/ds-menu-button/singleSelect/DSMenuButton.singleSelectItem.func.spec.js +39 -0
- package/ds-menu-button/{basic/DSMenuButton.singleSelectItem.func.spec.js → singleSelect/DSMenuButton.singleSelectItem.keyboardnav.func.spec.js} +11 -42
- package/ds-menu-button/submenu/DSMenuButton.axe-core.subMenu.func.spec.js +20 -0
- package/ds-menu-button/submenu/DSMenuButton.subMenuItem.func.spec.js +42 -0
- package/ds-menu-button/{basic/DSMenuButton.subMenuItem.func.spec.js → submenu/DSMenuButton.subMenuItem.keyboardnav.func.spec.js} +1 -38
- package/ds-pills-v2/DSPills.axe-core.func.spec.js +2 -2
- package/ds-pills-v2/DSPills.func.spec.js +26 -0
- package/ds-pills-v2/DSPills.visual.spec.js +1 -1
- package/ds-pills-v2/DSPillsV2CO.js +19 -1
- package/ds-pills-v2/selection/DSPills.axe-core.func.spec.js +77 -0
- package/ds-pills-v2/selection/DSPills.func.spec.js +155 -0
- package/ds-pills-v2/selection/DSPills.visual.spec.js +72 -0
- package/ds-query-builder/DSQueryBuilder.visual.spec.js +2 -1
- package/ds-query-builder/DSQueryBuilderCO.js +0 -5
- package/ds-shuttle-v2/DSShuttleV2CO.js +2 -4
- package/ds-shuttle-v2/Dnd/DSShuttleV2.DnD.visual.spec.js +0 -5
- package/ds-shuttle-v2/basic/DSShuttleV2.keyboard.func.spec.js +46 -66
- package/ds-shuttle-v2/drillingdown/DSShuttleV2.drilldown.kb.func.spec.js +3 -5
- package/ds-shuttle-v2/filtering/DSShuttleV2.filter.kb.func.spec.js +1 -7
- package/ds-shuttle-v2/globalcheckbox/DSShuttleV2.globalcheckbox.kb.func.spec.js +0 -2
- package/ds-shuttle-v2/items/DSShuttleV2.items.kb.func.spec.js +0 -2
- package/ds-toggle/DSToggle.func.spec.js +21 -18
- package/ds-toggle/DSToggle.visual.spec.js +56 -12
- package/package.json +119 -119
- package/ds-controlled-form/ds-controlled-date-range-picker/DSControlledDateRangePicker.DateInput.visual.spec.js +0 -57
- package/ds-menu-button/DSMenuButton.axe-core.func.spec.js +0 -66
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* eslint-disable max-lines */
|
|
2
|
+
import DSComboboxMultiCO from '../DSComboboxMultiCO';
|
|
3
|
+
import { axeCoreCheck } from '../../helpers';
|
|
4
|
+
|
|
5
|
+
if (
|
|
6
|
+
(!browser.capabilities['ice:options'].isPhone &&
|
|
7
|
+
!browser.capabilities['ice:options'].isTablet &&
|
|
8
|
+
browser.capabilities.browserName === 'chrome') ||
|
|
9
|
+
browser.capabilities.browserName === 'Chrome'
|
|
10
|
+
) {
|
|
11
|
+
describe('PUI-15028 - ComboboxMulti:: readOnly - axe-core test', () => {
|
|
12
|
+
before('loading page', async () => {
|
|
13
|
+
const errorOnGo = await DSComboboxMultiCO.readOnly.go();
|
|
14
|
+
if (errorOnGo) throw errorOnGo;
|
|
15
|
+
});
|
|
16
|
+
// eslint-disable-next-line max-len
|
|
17
|
+
it('01: should display a combobox multi with readOnly and pass axe-core scan', async () => {
|
|
18
|
+
const combobox = await DSComboboxMultiCO.getCombobox();
|
|
19
|
+
await combobox.click();
|
|
20
|
+
const menuList = await DSComboboxMultiCO.getMenuList();
|
|
21
|
+
await menuList.waitForDisplayed();
|
|
22
|
+
const result = await axeCoreCheck();
|
|
23
|
+
expect(result.length).toBe(0);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* eslint-disable max-lines */
|
|
2
|
+
import { Key } from 'webdriverio';
|
|
3
|
+
import DSComboboxMultiCO from '../DSComboboxMultiCO';
|
|
4
|
+
|
|
5
|
+
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
6
|
+
describe('PUI-15026 - ComboboxMulti:: readOnly prop - visual', () => {
|
|
7
|
+
before('loading page', async () => {
|
|
8
|
+
const errorOnGo = await DSComboboxMultiCO.readOnly.go();
|
|
9
|
+
if (errorOnGo) throw errorOnGo;
|
|
10
|
+
});
|
|
11
|
+
it('01: readOnly combobox multi should be focused', async () => {
|
|
12
|
+
await browser.eyesOpen();
|
|
13
|
+
await browser.keys(Key.Tab);
|
|
14
|
+
const snapshot = await browser.eyesCheckSnapshot(
|
|
15
|
+
DSComboboxMultiCO.snapshotPath('combobox-multi-readOnly-focused'),
|
|
16
|
+
);
|
|
17
|
+
await expect(snapshot).toEqual(0);
|
|
18
|
+
});
|
|
19
|
+
it('02: readOnly combobox multi option selected focused', async () => {
|
|
20
|
+
await browser.eyesOpen();
|
|
21
|
+
await browser.keys(Key.Enter);
|
|
22
|
+
await browser.keys(Key.ArrowDown);
|
|
23
|
+
const snapshot = await browser.eyesCheckSnapshot(
|
|
24
|
+
DSComboboxMultiCO.snapshotPath('combobox-multi-readOnly-options-kb-nav'),
|
|
25
|
+
);
|
|
26
|
+
await expect(snapshot).toEqual(0);
|
|
27
|
+
});
|
|
28
|
+
it('03: readOnly combobox multi opened - click', async () => {
|
|
29
|
+
await browser.eyesOpen();
|
|
30
|
+
await browser.keys(Key.Escape);
|
|
31
|
+
const combobox = await DSComboboxMultiCO.getCombobox();
|
|
32
|
+
await combobox.click();
|
|
33
|
+
const snapshot = await browser.eyesCheckSnapshot(
|
|
34
|
+
DSComboboxMultiCO.snapshotPath('combobox-multi-readOnly-combobox-click'),
|
|
35
|
+
);
|
|
36
|
+
await expect(snapshot).toEqual(0);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
}
|
|
@@ -6,6 +6,8 @@ export default class DSComboboxSingleCO extends PageObject {
|
|
|
6
6
|
// STORIES
|
|
7
7
|
static applyAriaDisabled = new Urlbuilder(PATH_E2E_COMBOBOX_SINGLE, 'apply-aria-disabled-test');
|
|
8
8
|
|
|
9
|
+
static readOnly = new Urlbuilder(PATH_E2E_COMBOBOX_SINGLE, 'read-only-test');
|
|
10
|
+
|
|
9
11
|
// COMBOBOX - INPUT
|
|
10
12
|
static async getCombobox() {
|
|
11
13
|
return $('[data-testid="combobox-container"]');
|
|
@@ -43,15 +45,6 @@ export default class DSComboboxSingleCO extends PageObject {
|
|
|
43
45
|
return $('[data-testid="combobox-ally-selected-values"]');
|
|
44
46
|
}
|
|
45
47
|
|
|
46
|
-
// MENU
|
|
47
|
-
static async getSelectAllCheckbox() {
|
|
48
|
-
return $('#select-all-checkbox');
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
static async getSelectedOptionsToggle() {
|
|
52
|
-
return $('[data-testid="combobox-selected-options-toggle"]');
|
|
53
|
-
}
|
|
54
|
-
|
|
55
48
|
static async getMenuList() {
|
|
56
49
|
return $('[data-testid="combobox-menu-list"]');
|
|
57
50
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* eslint-disable max-lines */
|
|
2
|
+
import DSComboboxSingleCO from '../DSComboboxSingleCO';
|
|
3
|
+
import { axeCoreCheck } from '../../helpers';
|
|
4
|
+
|
|
5
|
+
if (
|
|
6
|
+
(!browser.capabilities['ice:options'].isPhone &&
|
|
7
|
+
!browser.capabilities['ice:options'].isTablet &&
|
|
8
|
+
browser.capabilities.browserName === 'chrome') ||
|
|
9
|
+
browser.capabilities.browserName === 'Chrome'
|
|
10
|
+
) {
|
|
11
|
+
describe('PUI-15030 - ComboboxSingle:: readOnly - axe-core test', () => {
|
|
12
|
+
before('loading page', async () => {
|
|
13
|
+
const errorOnGo = await DSComboboxSingleCO.readOnly.go();
|
|
14
|
+
if (errorOnGo) throw errorOnGo;
|
|
15
|
+
});
|
|
16
|
+
// eslint-disable-next-line max-len
|
|
17
|
+
it('01: should display a combobox single with readOnly and pass axe-core scan', async () => {
|
|
18
|
+
const combobox = await DSComboboxSingleCO.getCombobox();
|
|
19
|
+
await combobox.click();
|
|
20
|
+
const menuList = await DSComboboxSingleCO.getMenuList();
|
|
21
|
+
await menuList.waitForDisplayed();
|
|
22
|
+
const result = await axeCoreCheck();
|
|
23
|
+
expect(result.length).toBe(0);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* eslint-disable max-lines */
|
|
2
|
+
import { Key } from 'webdriverio';
|
|
3
|
+
import DSComboboxSingleCO from '../DSComboboxSingleCO';
|
|
4
|
+
|
|
5
|
+
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
6
|
+
describe('PUI-15029 - ComboboxSingle:: readOnly prop - visual', () => {
|
|
7
|
+
before('loading page', async () => {
|
|
8
|
+
const errorOnGo = await DSComboboxSingleCO.readOnly.go();
|
|
9
|
+
if (errorOnGo) throw errorOnGo;
|
|
10
|
+
});
|
|
11
|
+
it('01: readOnly combobox single should be focused', async () => {
|
|
12
|
+
await browser.eyesOpen();
|
|
13
|
+
await browser.keys(Key.Tab);
|
|
14
|
+
const snapshot = await browser.eyesCheckSnapshot(
|
|
15
|
+
DSComboboxSingleCO.snapshotPath('combobox-single-readOnly-focused'),
|
|
16
|
+
);
|
|
17
|
+
await expect(snapshot).toEqual(0);
|
|
18
|
+
});
|
|
19
|
+
it('02: readOnly combobox single option selected focused', async () => {
|
|
20
|
+
await browser.eyesOpen();
|
|
21
|
+
await browser.keys(Key.Enter);
|
|
22
|
+
await browser.keys(Key.ArrowDown);
|
|
23
|
+
const snapshot = await browser.eyesCheckSnapshot(
|
|
24
|
+
DSComboboxSingleCO.snapshotPath('combobox-single-readOnly-options-kb-nav'),
|
|
25
|
+
);
|
|
26
|
+
await expect(snapshot).toEqual(0);
|
|
27
|
+
});
|
|
28
|
+
it('03: readOnly combobox single opened - click', async () => {
|
|
29
|
+
await browser.eyesOpen();
|
|
30
|
+
await browser.keys(Key.Escape);
|
|
31
|
+
const combobox = await DSComboboxSingleCO.getCombobox();
|
|
32
|
+
await combobox.click();
|
|
33
|
+
const snapshot = await browser.eyesCheckSnapshot(
|
|
34
|
+
DSComboboxSingleCO.snapshotPath('combobox-single-readOnly-combobox-click'),
|
|
35
|
+
);
|
|
36
|
+
await expect(snapshot).toEqual(0);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
}
|
|
@@ -92,6 +92,10 @@ export default class DSFormLayoutBlockItemCO extends PageObject {
|
|
|
92
92
|
return $('[data-testid="ds-form-layout-block-item-error-message"]');
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
static async getFeedbackMessage() {
|
|
96
|
+
return $('[data-testid="ds-form-layout-block-item-message"]');
|
|
97
|
+
}
|
|
98
|
+
|
|
95
99
|
static async getBlockContainersByIndex(index = 0) {
|
|
96
100
|
return $$('[data-testid="ds-form-layout-block-item-container"]')[index];
|
|
97
101
|
}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PATH_E2E_MENU_BUTTON } from '../../environments/storybook/paths';
|
|
2
2
|
import { PageObject, Urlbuilder } from '../helpers';
|
|
3
3
|
|
|
4
4
|
export default class DSMenuButtonCO extends PageObject {
|
|
5
5
|
// Current supported examples: POC
|
|
6
|
-
static activableMenuItem = new Urlbuilder(
|
|
6
|
+
static activableMenuItem = new Urlbuilder(PATH_E2E_MENU_BUTTON, 'activable-menu-item');
|
|
7
7
|
|
|
8
|
-
static multipleSelectMenuItem = new Urlbuilder(
|
|
8
|
+
static multipleSelectMenuItem = new Urlbuilder(PATH_E2E_MENU_BUTTON, 'multiple-select-menu-item');
|
|
9
9
|
|
|
10
|
-
static singleSelectMenuItem = new Urlbuilder(
|
|
10
|
+
static singleSelectMenuItem = new Urlbuilder(PATH_E2E_MENU_BUTTON, 'single-select-menu-item');
|
|
11
11
|
|
|
12
|
-
static withSubmenuMenuItem = new Urlbuilder(
|
|
12
|
+
static withSubmenuMenuItem = new Urlbuilder(PATH_E2E_MENU_BUTTON, 'with-submenu-menu-item');
|
|
13
|
+
|
|
14
|
+
static withDisabled = new Urlbuilder(PATH_E2E_MENU_BUTTON, 'disabled-items-test');
|
|
15
|
+
|
|
16
|
+
static withLeftDecorations = new Urlbuilder(PATH_E2E_MENU_BUTTON, 'with-left-decorations-test');
|
|
13
17
|
|
|
14
18
|
static async getMenuRoots() {
|
|
15
19
|
return $$('[data-testid="ds-flyout-menu-root"]');
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* eslint-disable max-statements */
|
|
2
|
+
import { Key } from 'webdriverio';
|
|
3
|
+
import DSMenuButtonCO from '../DSMenuButtonCO';
|
|
4
|
+
import DSButtonV3CO from '../../ds-button-v3/DSButtonV3CO';
|
|
5
|
+
import DSDialog from '../../ds-dialog/DSDialogCO';
|
|
6
|
+
import DSCardV3CO from '../../ds-card-v3/DSCardV3CO';
|
|
7
|
+
|
|
8
|
+
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
9
|
+
describe('PUI-14645 - DSMenuButton:: Activable Menu Item: Basic Mouse - Func', () => {
|
|
10
|
+
before('loading page', async () => {
|
|
11
|
+
const errorOnGo = await DSMenuButtonCO.activableMenuItem.go();
|
|
12
|
+
if (errorOnGo) throw errorOnGo;
|
|
13
|
+
});
|
|
14
|
+
it('01: should trigger first menuItem with MOUSE and have a dialog', async () => {
|
|
15
|
+
const menuTrigger = await DSButtonV3CO.getButtonByLabel('Actions example');
|
|
16
|
+
await menuTrigger.click();
|
|
17
|
+
const menuItem1 = await DSMenuButtonCO.getMenuItemByID('1');
|
|
18
|
+
await menuItem1.click();
|
|
19
|
+
const triggeredDialog = DSDialog.getDialog();
|
|
20
|
+
await expect(triggeredDialog).toBeDisplayed();
|
|
21
|
+
});
|
|
22
|
+
it('02: should trigger third menuItem with MOUSE and have a card', async () => {
|
|
23
|
+
await browser.keys(Key.Escape); // Closes dialog
|
|
24
|
+
const menuTrigger = await DSButtonV3CO.getButtonByLabel('Actions example');
|
|
25
|
+
await menuTrigger.click();
|
|
26
|
+
const menuItem3 = await DSMenuButtonCO.getMenuItemByID('3');
|
|
27
|
+
await menuItem3.click();
|
|
28
|
+
const triggeredCards = (await DSCardV3CO.getCards()).length;
|
|
29
|
+
await expect(triggeredCards).toEqual(2); // One card is already on this story containing the trigger (+1).
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
}
|
|
@@ -1,35 +1,10 @@
|
|
|
1
1
|
/* eslint-disable max-statements */
|
|
2
2
|
import { Key } from 'webdriverio';
|
|
3
3
|
import DSMenuButtonCO from '../DSMenuButtonCO';
|
|
4
|
-
import DSButtonV3CO from '../../ds-button-v3/DSButtonV3CO';
|
|
5
4
|
import DSDialog from '../../ds-dialog/DSDialogCO';
|
|
6
5
|
import DSCardV3CO from '../../ds-card-v3/DSCardV3CO';
|
|
7
6
|
|
|
8
7
|
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
9
|
-
describe('PUI-14645 - DSMenuButton:: Activable Menu Item: Basic Mouse - Func', () => {
|
|
10
|
-
before('loading page', async () => {
|
|
11
|
-
const errorOnGo = await DSMenuButtonCO.activableMenuItem.go();
|
|
12
|
-
if (errorOnGo) throw errorOnGo;
|
|
13
|
-
});
|
|
14
|
-
it('01: should trigger first menuItem with MOUSE and have a dialog', async () => {
|
|
15
|
-
const menuTrigger = await DSButtonV3CO.getButton();
|
|
16
|
-
await menuTrigger.click();
|
|
17
|
-
const menuItem1 = await DSMenuButtonCO.getMenuItemByID('1');
|
|
18
|
-
await menuItem1.click();
|
|
19
|
-
const triggeredDialog = DSDialog.getDialog();
|
|
20
|
-
await expect(triggeredDialog).toBeDisplayed();
|
|
21
|
-
});
|
|
22
|
-
it('02: should trigger third menuItem with MOUSE and have a card', async () => {
|
|
23
|
-
await browser.keys(Key.Escape); // Closes dialog
|
|
24
|
-
const menuTrigger = await DSButtonV3CO.getButton();
|
|
25
|
-
await menuTrigger.click();
|
|
26
|
-
const menuItem3 = await DSMenuButtonCO.getMenuItemByID('3');
|
|
27
|
-
await menuItem3.click();
|
|
28
|
-
const triggeredCards = (await DSCardV3CO.getCards()).length;
|
|
29
|
-
await expect(triggeredCards).toEqual(2); // One card is already on this story containing the trigger (+1).
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
|
|
33
8
|
describe('PUI-14646 - DSMenuButton:: Activable Menu Item: Basic Keyboard - Func', () => {
|
|
34
9
|
before('loading page', async () => {
|
|
35
10
|
const errorOnGo = await DSMenuButtonCO.activableMenuItem.go();
|
|
@@ -42,7 +17,7 @@ if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:o
|
|
|
42
17
|
await browser.keys(Key.ArrowDown);
|
|
43
18
|
await browser.keys(Key.ArrowDown); // Iterated the focustrap
|
|
44
19
|
await browser.keys(Key.Return);
|
|
45
|
-
const triggeredDialog = DSDialog.getDialog();
|
|
20
|
+
const triggeredDialog = await DSDialog.getDialog();
|
|
46
21
|
const menu = await DSMenuButtonCO.getMenuRoot();
|
|
47
22
|
await expect(menu).not.toBeDisplayedInViewport();
|
|
48
23
|
await expect(triggeredDialog).toBeDisplayed();
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { axeCoreCheck } from '../../helpers';
|
|
2
|
+
import DSMenuButtonCO from '../DSMenuButtonCO';
|
|
3
|
+
import DSButtonV3CO from '../../ds-button-v3/DSButtonV3CO';
|
|
4
|
+
|
|
5
|
+
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
6
|
+
describe('PUI-14909 - DSMenuButton:: Disabled - AxeCore', () => {
|
|
7
|
+
before('loading page', async () => {
|
|
8
|
+
const errorOnGo = await DSMenuButtonCO.withDisabled.go();
|
|
9
|
+
if (errorOnGo) throw errorOnGo;
|
|
10
|
+
});
|
|
11
|
+
it('01: should have menu disabled items and pass axe-core scan', async () => {
|
|
12
|
+
const menuTrigger = await DSButtonV3CO.getButton();
|
|
13
|
+
await menuTrigger.click();
|
|
14
|
+
const menu = await DSMenuButtonCO.getMenuFloatingWrapperRoot();
|
|
15
|
+
await menu.waitForDisplayed();
|
|
16
|
+
const result = await axeCoreCheck();
|
|
17
|
+
expect(result.length).toBe(0);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Key } from 'webdriverio';
|
|
2
|
+
import DSMenuButtonCO from '../DSMenuButtonCO';
|
|
3
|
+
import DSButtonV3CO from '../../ds-button-v3/DSButtonV3CO';
|
|
4
|
+
|
|
5
|
+
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
6
|
+
describe('PUI-14910 - DSMenuButton:: Disabled - AxeCore', () => {
|
|
7
|
+
beforeEach('loading page', async () => {
|
|
8
|
+
const errorOnGo = await DSMenuButtonCO.withDisabled.go();
|
|
9
|
+
if (errorOnGo) throw errorOnGo;
|
|
10
|
+
});
|
|
11
|
+
it('01: should trigger a disabled menu item and not close the menu (no action triggered)', async () => {
|
|
12
|
+
const menuTrigger = await DSButtonV3CO.getButton();
|
|
13
|
+
await menuTrigger.click();
|
|
14
|
+
const disabledItem = await DSMenuButtonCO.getMenuItemByID('2');
|
|
15
|
+
await disabledItem.click();
|
|
16
|
+
const menu = await DSMenuButtonCO.getMenuFloatingWrapperRoot();
|
|
17
|
+
await expect(menu).toBeDisplayed();
|
|
18
|
+
});
|
|
19
|
+
it('02: should trigger a disabled menu item with KB and not close the menu (no action triggered)', async () => {
|
|
20
|
+
const menuTrigger = await DSButtonV3CO.getButton();
|
|
21
|
+
await menuTrigger.click();
|
|
22
|
+
await browser.keys(Key.ArrowDown);
|
|
23
|
+
await browser.keys(Key.Space);
|
|
24
|
+
const menu = await DSMenuButtonCO.getMenuFloatingWrapperRoot();
|
|
25
|
+
await expect(menu).toBeDisplayed();
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { axeCoreCheck } from '../../helpers';
|
|
2
|
+
import DSMenuButtonCO from '../DSMenuButtonCO';
|
|
3
|
+
import DSButtonV3CO from '../../ds-button-v3/DSButtonV3CO';
|
|
4
|
+
|
|
5
|
+
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
6
|
+
describe('PUI-14911 - DSMenuButton:: Left decorations - AxeCore', () => {
|
|
7
|
+
before('loading page', async () => {
|
|
8
|
+
const errorOnGo = await DSMenuButtonCO.withLeftDecorations.go();
|
|
9
|
+
if (errorOnGo) throw errorOnGo;
|
|
10
|
+
});
|
|
11
|
+
it('01: should have menu with left decorators and pass axe-core scan', async () => {
|
|
12
|
+
const menuTrigger = await DSButtonV3CO.getButton();
|
|
13
|
+
await menuTrigger.click();
|
|
14
|
+
const menu = await DSMenuButtonCO.getMenuFloatingWrapperRoot();
|
|
15
|
+
await menu.waitForDisplayed();
|
|
16
|
+
const result = await axeCoreCheck();
|
|
17
|
+
expect(result.length).toBe(0);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { axeCoreCheck } from '../../helpers';
|
|
2
|
+
import DSMenuButtonCO from '../DSMenuButtonCO';
|
|
3
|
+
import DSButtonV3CO from '../../ds-button-v3/DSButtonV3CO';
|
|
4
|
+
|
|
5
|
+
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
6
|
+
describe('PUI-14642 - DSMenuButton:: Multi Select Menu Item - AxeCore', () => {
|
|
7
|
+
before('loading page', async () => {
|
|
8
|
+
const errorOnGo = await DSMenuButtonCO.multipleSelectMenuItem.go();
|
|
9
|
+
if (errorOnGo) throw errorOnGo;
|
|
10
|
+
});
|
|
11
|
+
it('01: should have untriggered menubutton and pass axe-core scan', async () => {
|
|
12
|
+
const menuTrigger = await DSButtonV3CO.getButtonByLabel('Multiple selection example');
|
|
13
|
+
await menuTrigger.waitForDisplayed();
|
|
14
|
+
const result = await axeCoreCheck({ selector: "[data-testid='ds-card-v3-root']" });
|
|
15
|
+
expect(result.length).toBe(0);
|
|
16
|
+
});
|
|
17
|
+
it('02: should have multi select menu with multiple opts selected and pass axe-core scan', async () => {
|
|
18
|
+
const menuTrigger = await DSButtonV3CO.getButtonByLabel('Multiple selection example');
|
|
19
|
+
await menuTrigger.click();
|
|
20
|
+
const menuItem1 = await DSMenuButtonCO.getMenuItemOptByIndex('1');
|
|
21
|
+
await menuItem1.click();
|
|
22
|
+
const menuItem2 = await DSMenuButtonCO.getMenuItemOptByIndex('2');
|
|
23
|
+
await menuItem2.click();
|
|
24
|
+
const result = await axeCoreCheck({ selector: "[data-testid='ds-card-v3-root']" });
|
|
25
|
+
expect(result.length).toBe(0);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* eslint-disable max-statements */
|
|
2
|
+
import DSMenuButtonCO from '../DSMenuButtonCO';
|
|
3
|
+
import DSButtonV3CO from '../../ds-button-v3/DSButtonV3CO';
|
|
4
|
+
import DSCardV3CO from '../../ds-card-v3/DSCardV3CO';
|
|
5
|
+
|
|
6
|
+
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
7
|
+
describe('PUI-14647 - DSMenuButton:: Multi Select Menu Item: Mouse - Func', () => {
|
|
8
|
+
before('loading page', async () => {
|
|
9
|
+
const errorOnGo = await DSMenuButtonCO.multipleSelectMenuItem.go();
|
|
10
|
+
if (errorOnGo) throw errorOnGo;
|
|
11
|
+
});
|
|
12
|
+
it('01: should select two items with MOUSE and have two cards (as produced changes)', async () => {
|
|
13
|
+
const menuTrigger = await DSButtonV3CO.getButtonByLabel('Multiple selection example');
|
|
14
|
+
await menuTrigger.click();
|
|
15
|
+
const menuItem1 = await DSMenuButtonCO.getMenuItemOptByIndex('1');
|
|
16
|
+
await menuItem1.click();
|
|
17
|
+
const menuItem2 = await DSMenuButtonCO.getMenuItemOptByIndex('2');
|
|
18
|
+
await menuItem2.click();
|
|
19
|
+
const triggeredCards = (await DSCardV3CO.getCards()).length;
|
|
20
|
+
await expect(triggeredCards).toEqual(3); // One card is already on this story containing the trigger (+1).
|
|
21
|
+
await expect(menuItem1).toHaveAttribute('aria-checked', 'true');
|
|
22
|
+
await expect(menuItem2).toHaveAttribute('aria-checked', 'true');
|
|
23
|
+
});
|
|
24
|
+
it('02: should deselect an item with MOUSE and have one less card (as produced changes)', async () => {
|
|
25
|
+
const menuItem1 = await DSMenuButtonCO.getMenuItemOptByIndex('1');
|
|
26
|
+
await menuItem1.click();
|
|
27
|
+
const menuItem2 = await DSMenuButtonCO.getMenuItemOptByIndex('2');
|
|
28
|
+
const triggeredCards = (await DSCardV3CO.getCards()).length;
|
|
29
|
+
await expect(triggeredCards).toEqual(2); // One card is already on this story containing the trigger (+1).
|
|
30
|
+
await expect(menuItem1).toHaveAttribute('aria-checked', 'false');
|
|
31
|
+
await expect(menuItem2).toHaveAttribute('aria-checked', 'true');
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -1,38 +1,9 @@
|
|
|
1
1
|
/* eslint-disable max-statements */
|
|
2
2
|
import { Key } from 'webdriverio';
|
|
3
3
|
import DSMenuButtonCO from '../DSMenuButtonCO';
|
|
4
|
-
import DSButtonV3CO from '../../ds-button-v3/DSButtonV3CO';
|
|
5
4
|
import DSCardV3CO from '../../ds-card-v3/DSCardV3CO';
|
|
6
5
|
|
|
7
6
|
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
8
|
-
describe('PUI-14647 - DSMenuButton:: Multi Select Menu Item: Mouse - Func', () => {
|
|
9
|
-
before('loading page', async () => {
|
|
10
|
-
const errorOnGo = await DSMenuButtonCO.multipleSelectMenuItem.go();
|
|
11
|
-
if (errorOnGo) throw errorOnGo;
|
|
12
|
-
});
|
|
13
|
-
it('01: should select two items with MOUSE and have two cards (as produced changes)', async () => {
|
|
14
|
-
const menuTrigger = await DSButtonV3CO.getButton();
|
|
15
|
-
await menuTrigger.click();
|
|
16
|
-
const menuItem1 = await DSMenuButtonCO.getMenuItemOptByIndex('1');
|
|
17
|
-
await menuItem1.click();
|
|
18
|
-
const menuItem2 = await DSMenuButtonCO.getMenuItemOptByIndex('2');
|
|
19
|
-
await menuItem2.click();
|
|
20
|
-
const triggeredCards = (await DSCardV3CO.getCards()).length;
|
|
21
|
-
await expect(triggeredCards).toEqual(3); // One card is already on this story containing the trigger (+1).
|
|
22
|
-
await expect(menuItem1).toHaveAttribute('aria-checked', 'true');
|
|
23
|
-
await expect(menuItem2).toHaveAttribute('aria-checked', 'true');
|
|
24
|
-
});
|
|
25
|
-
it('02: should deselect an item with MOUSE and have one less card (as produced changes)', async () => {
|
|
26
|
-
const menuItem1 = await DSMenuButtonCO.getMenuItemOptByIndex('1');
|
|
27
|
-
await menuItem1.click();
|
|
28
|
-
const menuItem2 = await DSMenuButtonCO.getMenuItemOptByIndex('2');
|
|
29
|
-
const triggeredCards = (await DSCardV3CO.getCards()).length;
|
|
30
|
-
await expect(triggeredCards).toEqual(2); // One card is already on this story containing the trigger (+1).
|
|
31
|
-
await expect(menuItem1).toHaveAttribute('aria-checked', 'false');
|
|
32
|
-
await expect(menuItem2).toHaveAttribute('aria-checked', 'true');
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
|
|
36
7
|
describe('PUI-14648 - DSMenuButton:: Multi Select Menu Item: Keyboard - Func', () => {
|
|
37
8
|
before('loading page', async () => {
|
|
38
9
|
const errorOnGo = await DSMenuButtonCO.multipleSelectMenuItem.go();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { axeCoreCheck } from '../../helpers';
|
|
2
|
+
import DSMenuButtonCO from '../DSMenuButtonCO';
|
|
3
|
+
import DSButtonV3CO from '../../ds-button-v3/DSButtonV3CO';
|
|
4
|
+
|
|
5
|
+
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
6
|
+
describe('PUI-14643 - DSMenuButton:: Single Select Menu Item - AxeCore', () => {
|
|
7
|
+
before('loading page', async () => {
|
|
8
|
+
const errorOnGo = await DSMenuButtonCO.singleSelectMenuItem.go();
|
|
9
|
+
if (errorOnGo) throw errorOnGo;
|
|
10
|
+
});
|
|
11
|
+
it('01: should have single menu (unselected) and pass axe-core scan', async () => {
|
|
12
|
+
const menuTrigger = await DSButtonV3CO.getButtonByLabel('(multiple) Single selection example');
|
|
13
|
+
await menuTrigger.click();
|
|
14
|
+
const result = await axeCoreCheck({ selector: "[data-testid='ds-card-v3-root']" });
|
|
15
|
+
expect(result.length).toBe(0);
|
|
16
|
+
});
|
|
17
|
+
it('02: should have single menu (opt selected) and pass axe-core scan', async () => {
|
|
18
|
+
const menuTrigger = await DSButtonV3CO.getButtonByLabel('(multiple) Single selection example');
|
|
19
|
+
await menuTrigger.click();
|
|
20
|
+
const menuItem1 = await DSMenuButtonCO.getMenuItemOptByIndex('1');
|
|
21
|
+
await menuItem1.click();
|
|
22
|
+
const menuItem2 = await DSMenuButtonCO.getMenuItemOptByIndex('2');
|
|
23
|
+
await menuItem2.click();
|
|
24
|
+
const result = await axeCoreCheck({ selector: "[data-testid='ds-card-v3-root']" });
|
|
25
|
+
expect(result.length).toBe(0);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* eslint-disable max-statements */
|
|
2
|
+
import { Key } from 'webdriverio';
|
|
3
|
+
import DSMenuButtonCO from '../DSMenuButtonCO';
|
|
4
|
+
import DSButtonV3CO from '../../ds-button-v3/DSButtonV3CO';
|
|
5
|
+
import DSCardV3CO from '../../ds-card-v3/DSCardV3CO';
|
|
6
|
+
|
|
7
|
+
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
8
|
+
describe('PUI-14650 - DSMenuButton:: Single Select Menu Item: Mouse - Func', () => {
|
|
9
|
+
before('loading page', async () => {
|
|
10
|
+
const errorOnGo = await DSMenuButtonCO.singleSelectMenuItem.go();
|
|
11
|
+
if (errorOnGo) throw errorOnGo;
|
|
12
|
+
});
|
|
13
|
+
it('01: should select two items with MOUSE and have only last opt selected', async () => {
|
|
14
|
+
const menuTrigger = await DSButtonV3CO.getButtonByLabel('(multiple) Single selection example');
|
|
15
|
+
await menuTrigger.click();
|
|
16
|
+
const menuItem1 = await DSMenuButtonCO.getMenuItemOptByIndex('1');
|
|
17
|
+
await menuItem1.click();
|
|
18
|
+
const menuItem2 = await DSMenuButtonCO.getMenuItemOptByIndex('2');
|
|
19
|
+
await menuItem2.click();
|
|
20
|
+
const triggeredCards = (await DSCardV3CO.getCards()).length;
|
|
21
|
+
const cardActiveFromOption = await (await DSCardV3CO.getHByLevel(2)).getText();
|
|
22
|
+
await expect(triggeredCards).toEqual(2); // One card is already on this story containing the trigger (+1).
|
|
23
|
+
await expect(menuItem1).toHaveAttribute('aria-checked', 'false');
|
|
24
|
+
await expect(menuItem2).toHaveAttribute('aria-checked', 'true');
|
|
25
|
+
await expect(cardActiveFromOption).toBe('Option 2');
|
|
26
|
+
});
|
|
27
|
+
it('02: should be able to pick two single options from different sections with MOUSE', async () => {
|
|
28
|
+
const menuItem3 = await DSMenuButtonCO.getMenuItemOptByIndex('3');
|
|
29
|
+
await menuItem3.click();
|
|
30
|
+
const menuItem4 = await DSMenuButtonCO.getMenuItemOptByIndex('4');
|
|
31
|
+
await browser.keys(Key.ArrowDown);
|
|
32
|
+
await browser.keys(Key.Space);
|
|
33
|
+
const menu = await DSMenuButtonCO.getMenuRoot();
|
|
34
|
+
await expect(menu).toBeDisplayedInViewport();
|
|
35
|
+
await expect(menuItem3).toHaveAttribute('aria-checked', 'true');
|
|
36
|
+
await expect(menuItem4).toHaveAttribute('aria-checked', 'true');
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
}
|
|
@@ -1,42 +1,9 @@
|
|
|
1
1
|
/* eslint-disable max-statements */
|
|
2
2
|
import { Key } from 'webdriverio';
|
|
3
3
|
import DSMenuButtonCO from '../DSMenuButtonCO';
|
|
4
|
-
import DSButtonV3CO from '../../ds-button-v3/DSButtonV3CO';
|
|
5
4
|
import DSCardV3CO from '../../ds-card-v3/DSCardV3CO';
|
|
6
5
|
|
|
7
6
|
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
8
|
-
describe('PUI-14650 - DSMenuButton:: Single Select Menu Item: Mouse - Func', () => {
|
|
9
|
-
before('loading page', async () => {
|
|
10
|
-
const errorOnGo = await DSMenuButtonCO.singleSelectMenuItem.go();
|
|
11
|
-
if (errorOnGo) throw errorOnGo;
|
|
12
|
-
});
|
|
13
|
-
it('01: should select two items with MOUSE and have only last opt selected', async () => {
|
|
14
|
-
const menuTrigger = await DSButtonV3CO.getButton();
|
|
15
|
-
await menuTrigger.click();
|
|
16
|
-
const menuItem1 = await DSMenuButtonCO.getMenuItemOptByIndex('1');
|
|
17
|
-
await menuItem1.click();
|
|
18
|
-
const menuItem2 = await DSMenuButtonCO.getMenuItemOptByIndex('2');
|
|
19
|
-
await menuItem2.click();
|
|
20
|
-
const triggeredCards = (await DSCardV3CO.getCards()).length;
|
|
21
|
-
const cardActiveFromOption = await (await DSCardV3CO.getHByLevel(2)).getText();
|
|
22
|
-
await expect(triggeredCards).toEqual(2); // One card is already on this story containing the trigger (+1).
|
|
23
|
-
await expect(menuItem1).toHaveAttribute('aria-checked', 'false');
|
|
24
|
-
await expect(menuItem2).toHaveAttribute('aria-checked', 'true');
|
|
25
|
-
await expect(cardActiveFromOption).toBe('Option 2');
|
|
26
|
-
});
|
|
27
|
-
it('02: should be able to pick two single options from different sections with MOUSE', async () => {
|
|
28
|
-
const menuItem3 = await DSMenuButtonCO.getMenuItemOptByIndex('3');
|
|
29
|
-
await menuItem3.click();
|
|
30
|
-
const menuItem4 = await DSMenuButtonCO.getMenuItemOptByIndex('4');
|
|
31
|
-
await browser.keys(Key.ArrowDown);
|
|
32
|
-
await browser.keys(Key.Space);
|
|
33
|
-
const menu = await DSMenuButtonCO.getMenuRoot();
|
|
34
|
-
await expect(menu).toBeDisplayedInViewport();
|
|
35
|
-
await expect(menuItem3).toHaveAttribute('aria-checked', 'true');
|
|
36
|
-
await expect(menuItem4).toHaveAttribute('aria-checked', 'true');
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
|
|
40
7
|
describe('PUI-14649 - DSMenuButton:: Single Select Menu Item: Keyboard - Func', () => {
|
|
41
8
|
before('loading page', async () => {
|
|
42
9
|
const errorOnGo = await DSMenuButtonCO.singleSelectMenuItem.go();
|
|
@@ -44,38 +11,40 @@ if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:o
|
|
|
44
11
|
});
|
|
45
12
|
it('01: should select two options with KEYBOARD (space) and have only last opt selected', async () => {
|
|
46
13
|
await browser.keys(Key.Tab);
|
|
47
|
-
await browser.keys(Key.
|
|
48
|
-
await
|
|
14
|
+
await browser.keys(Key.Enter);
|
|
15
|
+
const menu = await DSMenuButtonCO.getMenuRoot();
|
|
16
|
+
await menu.waitForDisplayed();
|
|
49
17
|
await browser.keys(Key.ArrowDown);
|
|
50
18
|
await browser.keys(Key.Space);
|
|
51
19
|
const menuItem1 = await DSMenuButtonCO.getMenuItemOptByIndex('1');
|
|
52
20
|
const menuItem2 = await DSMenuButtonCO.getMenuItemOptByIndex('2');
|
|
53
21
|
const menuItem3 = await DSMenuButtonCO.getMenuItemOptByIndex('3');
|
|
54
|
-
const triggeredCards = (await DSCardV3CO.getCards()).length;
|
|
55
|
-
const cardActiveFromOption = await (await DSCardV3CO.getHByLevel(2)).getText();
|
|
56
|
-
await expect(triggeredCards).toEqual(2); // One card is already on this story containing the trigger (+1).
|
|
57
22
|
await expect(menuItem1).toHaveAttribute('aria-checked', 'false');
|
|
58
23
|
await expect(menuItem2).toHaveAttribute('aria-checked', 'true');
|
|
59
24
|
await expect(menuItem3).toHaveAttribute('aria-checked', 'false');
|
|
25
|
+
const triggeredCards = await (await DSCardV3CO.getCards()).length;
|
|
26
|
+
const cardActiveFromOption = await (await DSCardV3CO.getHByLevel(2)).getText();
|
|
27
|
+
await expect(triggeredCards).toEqual(2); // One card is already on this story containing the trigger (+1).
|
|
60
28
|
await expect(cardActiveFromOption).toBe('Option 2');
|
|
61
29
|
});
|
|
62
30
|
it('02: should trigger option with KEYBOARD (return) and have only last opt selected (closed menu)', async () => {
|
|
63
|
-
await browser.keys(Key.
|
|
31
|
+
await browser.keys(Key.ArrowDown);
|
|
64
32
|
await browser.keys(Key.Return);
|
|
65
|
-
const triggeredCards = (await DSCardV3CO.getCards()).length;
|
|
33
|
+
const triggeredCards = await (await DSCardV3CO.getCards()).length;
|
|
66
34
|
const cardsActiveFromOption = await (await DSCardV3CO.getHByLevel(2)).getText();
|
|
67
35
|
const menu = await DSMenuButtonCO.getMenuRoot();
|
|
68
36
|
await expect(menu).not.toBeDisplayedInViewport();
|
|
69
37
|
await expect(triggeredCards).toEqual(2); // One card is already on this story containing the trigger (+1).
|
|
70
|
-
await expect(cardsActiveFromOption).toBe('Option
|
|
38
|
+
await expect(cardsActiveFromOption).toBe('Option 3');
|
|
71
39
|
});
|
|
72
40
|
it('03: should be able to pick two single options from different sections with KEYBOARD', async () => {
|
|
73
|
-
const menuItem1 = await DSMenuButtonCO.getMenuItemOptByIndex('1');
|
|
74
41
|
await browser.keys(Key.Return);
|
|
42
|
+
await browser.keys(Key.Space);
|
|
75
43
|
await browser.keys(Key.ArrowDown);
|
|
76
44
|
await browser.keys(Key.ArrowDown);
|
|
77
45
|
await browser.keys(Key.ArrowDown);
|
|
78
46
|
await browser.keys(Key.Space);
|
|
47
|
+
const menuItem1 = await DSMenuButtonCO.getMenuItemOptByIndex('1');
|
|
79
48
|
const menuItem4 = await DSMenuButtonCO.getMenuItemOptByIndex('4');
|
|
80
49
|
const menu = await DSMenuButtonCO.getMenuRoot();
|
|
81
50
|
await expect(menu).toBeDisplayedInViewport();
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Key } from 'webdriverio';
|
|
2
|
+
import { axeCoreCheck } from '../../helpers';
|
|
3
|
+
import DSMenuButtonCO from '../DSMenuButtonCO';
|
|
4
|
+
import DSButtonV3CO from '../../ds-button-v3/DSButtonV3CO';
|
|
5
|
+
|
|
6
|
+
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
7
|
+
describe('PUI-14644 - DSMenuButton:: Submenu Menu Item && Action Menu Item - AxeCore', () => {
|
|
8
|
+
before('loading page', async () => {
|
|
9
|
+
const errorOnGo = await DSMenuButtonCO.withSubmenuMenuItem.go();
|
|
10
|
+
if (errorOnGo) throw errorOnGo;
|
|
11
|
+
});
|
|
12
|
+
it('01: should have menu with submenus and action menu items and pass axe-core scan', async () => {
|
|
13
|
+
const menuTrigger = await DSButtonV3CO.getButtonByLabel('Submenus example');
|
|
14
|
+
await menuTrigger.click();
|
|
15
|
+
await browser.keys(Key.ArrowRight);
|
|
16
|
+
const result = await axeCoreCheck({ selector: "[data-testid='ds-card-v3-root']" });
|
|
17
|
+
expect(result.length).toBe(0);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
}
|