dimsum-e2e-tests 1.0.36 → 1.2.0
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 +18 -0
- package/ds-accordion/DSAccordion.axe-core.func.spec.js +18 -19
- package/ds-accordion/DSAccordion.func.spec.js +3 -3
- package/ds-accordion/DSAccordion.visual.spec.js +7 -0
- package/ds-accordion/DSAccordionCO.js +75 -11
- package/ds-accordion/QA_NOTES.md +105 -0
- package/ds-accordion/aria-disabled/DSAccordion.aria-disabled.axe-core.func.spec.js +25 -0
- package/ds-accordion/aria-disabled/DSAccordion.aria-disabled.visual.spec.js +23 -0
- package/ds-accordion/controlled/DSAccordion.controlled.func.spec.js +23 -0
- package/ds-accordion/header-structure/DSAccordion.header-structure.func.spec.js +65 -0
- package/ds-accordion/input-inside/DSAccordion.input-inside.func.spec.js +19 -0
- package/ds-accordion/role/DSAccordion.role-heading.func.spec.js +21 -0
- package/ds-accordion/scrollable-content/DSAccordion.scrollable-content.visual.spec.js +42 -0
- package/ds-accordion/slots/DSAccordion.slots.axe-core.func.spec.js +25 -0
- package/ds-accordion/slots/DSAccordion.slots.func.spec.js +67 -0
- package/ds-accordion/slots/DSAccordion.slots.visual.spec.js +18 -0
- package/ds-accordion/wrapLabel/DSAccordion.wrap-label.visual.spec.js +20 -0
- package/ds-autocomplete/DSAutocompleteCO.js +3 -3
- package/ds-button-v3/DSButtonV3.aria-diabled.axe-core.func.spec.js +22 -0
- package/ds-button-v3/DSButtonV3.aria-disabled-attribute.func.spec.js +33 -0
- package/ds-button-v3/DSButtonV3.aria-disabled.visual.spec.js +48 -0
- package/ds-button-v3/DSButtonV3.func.spec.js +27 -0
- package/ds-button-v3/DSButtonV3.type-submit.func.spec.js +28 -0
- package/ds-button-v3/DSButtonV3.visual.spec.js +92 -0
- package/ds-button-v3/DSButtonV3CO.js +60 -0
- package/ds-button-v3/theme-font/DSButtonV3.theme-font.func.spec.js +30 -0
- package/ds-controlled-form/ds-controlled-checkbox/Basic/DSControlledCheckbox.axe-core.basic.func.spec.js +4 -4
- package/ds-controlled-form/ds-controlled-checkbox/Basic/DSControlledCheckbox.basic.visual.spec.js +56 -0
- package/ds-controlled-form/ds-controlled-checkbox/DSControlledCheckboxCO.js +57 -2
- package/ds-controlled-form/ds-controlled-checkbox/Disabled/DSControlledCheckbox.axe-core.disabled.func.spec.js +1 -1
- package/ds-controlled-form/ds-controlled-checkbox/Disabled/DSControlledCheckbox.disabled.visual.spec.js +1 -1
- package/ds-controlled-form/ds-controlled-checkbox/HasError/DSControlledCheckbox.axe-core.hasError.func.spec.js +4 -4
- package/ds-controlled-form/ds-controlled-checkbox/HasError/DSControlledCheckbox.has-error.visual.spec.js +71 -1
- package/ds-controlled-form/ds-controlled-checkbox/Mixed/DSControlledCheckbox.axe-core.mixed.func.spec.js +4 -4
- package/ds-controlled-form/ds-controlled-checkbox/Mixed/DSControlledCheckbox.mixed.func.spec.js +19 -37
- package/ds-controlled-form/ds-controlled-checkbox/Mixed/DSControlledCheckbox.mixed.keyboard-nav.func.spec.js +51 -0
- package/ds-controlled-form/ds-controlled-checkbox/Mixed/DSControlledCheckbox.mixed.visual.spec.js +14 -16
- package/ds-controlled-form/ds-controlled-checkbox/ReadOnly/DSControlledCheckbox.axe-core.read-only.func.spec.js +3 -3
- package/ds-controlled-form/ds-controlled-checkbox/ReadOnly/DSControlledCheckbox.read-only.visual.spec.js +1 -1
- package/ds-controlled-form/ds-controlled-checkbox/WithTooltip/DSControlledCheckbox.axe-core.with-tooltip.func.spec.js +1 -1
- package/ds-controlled-form/ds-controlled-checkbox/WithTooltip/DSControlledCheckbox.with-tooltip.visual.spec.js +1 -3
- package/ds-controlled-form/ds-controlled-checkbox/WrapLabel/DSControlledCheckbox.axe-core.wrap-label.func.spec.js +1 -1
- package/ds-controlled-form/ds-controlled-checkbox/WrapLabel/DSControlledCheckbox.wrap-label.visual.spec.js +1 -1
- package/ds-controlled-form/ds-controlled-checkbox/aria-disabled/DSControlledCheckbox.aria-disabled.visual.spec.js +25 -0
- package/ds-controlled-form/ds-controlled-checkbox/aria-disabled/DSControlledCheckbox.axe-core.aria-disabled.func.spec.js +24 -0
- package/ds-controlled-form/ds-controlled-checkbox/slots/DSControlledCheckbox.slots.func.spec.js +78 -0
- package/ds-controlled-form/ds-controlled-checkbox/theme-font/DSControlledCheckbox.theme-font.func.spec.js +30 -0
- package/ds-controlled-form/ds-controlled-inputgroup/DSControlledInputGroupCO.js +7 -21
- package/ds-controlled-form/ds-controlled-inputgroup/autocomplete/DSControlledInputGroup.autocomplete.axe-core.func.spec.js +5 -6
- package/ds-controlled-form/ds-controlled-inputgroup/basic/DSControlledInputGroup.basic.axe-core.func.spec.js +3 -2
- package/ds-controlled-form/ds-controlled-inputgroup/basic/DSControlledInputGroup.basic.visual.spec.js +3 -2
- package/ds-controlled-form/ds-controlled-inputgroup/form-item-layout/DSControlledInputGroup.form-item-layout.axe-core.func.spec.js +2 -1
- package/ds-controlled-form/ds-controlled-inputgroup/form-item-layout/DSControlledInputGroup.form-item-layout.func.spec.js +3 -2
- package/ds-controlled-form/ds-controlled-inputgroup/protected/DSControlledInputGroup.protected.axe-core.func.spec.js +3 -2
- package/ds-controlled-form/ds-controlled-inputgroup/protected/DSControlledInputGroup.protected.func.spec.js +2 -1
- package/ds-controlled-form/ds-controlled-inputgroup/protected/DSControlledInputGroup.protected.visual.spec.js +2 -1
- package/ds-controlled-form/ds-input-text/DSInputText.clearable.keyboard.func.spec.js +2 -2
- package/ds-controlled-form/ds-input-text/DSInputText.func.spec.js +14 -12
- package/ds-controlled-form/ds-input-text/DSInputTextCO.js +31 -8
- package/ds-controlled-form/ds-input-text/aria-disabled/DSInputText.aria-disabled.axe-core.func.spec.js +23 -0
- package/ds-controlled-form/ds-input-text/aria-disabled/DSInputText.aria-disabled.func.spec.js +42 -0
- package/ds-controlled-form/ds-input-text/aria-disabled/DSInputText.aria-disabled.visual.spec.js +28 -0
- package/ds-controlled-form/ds-input-text/placeholder/DSInputText.placeholder.visual.spec.js +15 -0
- package/ds-controlled-form/ds-input-text/read-only/DSInputText.read-only.axe-core.func.spec.js +23 -0
- package/ds-controlled-form/ds-input-text/read-only/DSInputText.read-only.func.spec.js +23 -0
- package/ds-controlled-form/ds-input-text/read-only/DSInputText.read-only.visual.spec.js +28 -0
- package/ds-controlled-form/ds-input-text/slots/DSInputText.slots.axe-core.func.spec.js +23 -0
- package/ds-controlled-form/ds-input-text/slots/DSInputText.slots.func.spec.js +35 -0
- package/ds-controlled-form/ds-input-text/slots/DSInputText.slots.visual.spec.js +19 -0
- package/ds-controlled-form/react-hook-form/ReactHook.func.spec.js +2 -1
- package/ds-controlled-form/react-hook-form/ReactHook.visual.spec.js +2 -1
- package/ds-controlled-form/react-hook-form/ReactHookCO.js +0 -10
- package/ds-controlled-form/useMask/Number/UseNumberMask.axe-core.func.spec.js +48 -0
- package/ds-controlled-form/useMask/Number/UseNumberMask.func.spec.js +37 -36
- package/ds-controlled-form/useMask/Number/UseNumberMask.visual.spec.js +7 -6
- package/ds-controlled-form/useMask/Phone/UsePhoneMask.func.spec.js +9 -8
- package/ds-controlled-form/useMask/Phone/UsePhoneMask.visual.spec.js +4 -3
- package/ds-controlled-form/useMask/ReackHookFormWithMask/ReactHookFormWithMask.func.spec.js +4 -3
- package/ds-controlled-form/useMask/ReackHookFormWithMask/ReactHookFormWithMask.visual.spec.js +5 -4
- package/ds-controlled-form/useMask/RegExp/UseRegExpMask.func.spec.js +6 -5
- package/ds-controlled-form/useMask/SSN/UseSsnMask.func.spec.js +7 -6
- package/ds-controlled-form/useMask/ZipCode/UseZipCodeMask.func.spec.js +6 -5
- package/ds-controlled-form/useMask/useMaskCO.js +1 -11
- package/ds-data-table-async/components/FiltersCOextra.js +1 -1
- package/ds-data-table-async/components/OnRowClickCO.js +1 -1
- package/ds-data-table-async/pagination/DSDataTable.pagination.func.spec.js +3 -2
- package/ds-dialog/components/DialogFormsCO.js +1 -1
- package/ds-dropdownmenu-v2/DSDDMenuV2.axe-core.func.spec.js +2 -15
- package/ds-dropdownmenu-v2/DSDDMenuV2.visual.spec.js +5 -5
- package/ds-dropdownmenu-v2/DSDDMenuV2CO.js +8 -2
- package/ds-dropdownmenu-v2/aria-disabled/DSDDMenuV2.aria-disabled.visual.spec.js +20 -0
- package/ds-dropdownmenu-v2/basic/DSDDMenuV2.basic.func.spec.js +27 -27
- package/ds-dropdownmenu-v2/mandatory-single/DSDDMenuV2.mandatory-single.func.spec.js +4 -4
- package/ds-floating-context/DSFloatingContext.visual.spec.js +46 -0
- package/ds-floating-context/DSFloatingContextCO.js +46 -0
- package/ds-floating-context/placement/DSFloatingContext.placement.visual.spec.js +48 -0
- package/ds-floating-context/slots/DSFloatingContext.slots.axe-core.func.spec.js +23 -0
- package/ds-floating-context/slots/DSFloatingContext.slots.func.spec.js +41 -0
- package/ds-floating-context/slots/DSFloatingContext.slots.visual.spec.js +18 -0
- package/ds-form-layout-blocks/form-layout-block-item/DSFormLayoutBlockItemCO.js +3 -3
- package/ds-hooks/DSHook.usetree.func.spec.js +3 -2
- package/ds-hooks/useFocusTrap/UseFocusTrap.func.spec.js +36 -0
- package/ds-hooks/useFocusTrap/UseFocusTrapCO.js +10 -0
- package/ds-hooks/useKeyboardNavigation/DSHook.useKeyboardNavigation.func.spec.js +145 -0
- package/ds-hooks/useKeyboardNavigation/UseKeyboardNavigationCO.js +33 -0
- package/ds-hooks/useOnBlurOut/UseOnBlurOut.axe-core.func.spec.js +29 -0
- package/ds-hooks/useOnBlurOut/UseOnBlurOut.func.spec.js +83 -0
- package/ds-hooks/useOnBlurOut/UseOnBlurOutCO.js +11 -0
- package/ds-icons/DSIcons.visual.spec.js +45 -0
- package/ds-icons/DSIconsCO.js +30 -0
- package/ds-indeterminate-progress-indicator/DSIndetermintateProgressIndicator.axe-core.func.spec.js +31 -0
- package/ds-menu-item/DSMenuItems.func.spec.js +16 -16
- package/ds-menu-item/DSMenuItems.visual.spec.js +8 -32
- package/ds-menu-item/DSMenuItemsCO.js +4 -0
- package/ds-menu-item/aria-disabled/DSMenuItems.aria-disabled.axe-core.func.spec.js +35 -0
- package/ds-menu-item/aria-disabled/DSMenuItems.aria-disabled.visual.spec.js +68 -0
- package/ds-menu-item/read-only/DSMenuItems.read-only.axe-core.func.spec.js +35 -0
- package/ds-menu-item/read-only/DSMenuItems.read-only.visual.spec.js +66 -0
- package/ds-query-builder/DSQueryBuilderCO.js +1 -1
- package/ds-shuttle-v2/items/DSShuttleV2.items.func.spec.js +4 -2
- package/ds-system/DSSystem.visual.spec.js +19 -0
- package/ds-system/DSSystemCO.js +15 -0
- package/ds-typography/DSTypography.func.spec.js +5 -5
- package/ds-typography/DSTypography.visual.spec.js +50 -48
- package/ds-typography/DSTypographyCO.js +25 -5
- package/ds-typography/theme-font/DSTypography.theme-font.func.spec.js +30 -0
- package/package.json +121 -119
- package/ds-button-v2/DSButtonV2.axe-core.func.spec.js +0 -22
- package/ds-button-v2/DSButtonV2.func.spec.js +0 -139
- package/ds-button-v2/DSButtonV2.visual.spec.js +0 -153
- package/ds-button-v2/DSButtonV2CO.js +0 -43
- package/ds-controlled-form/ds-controlled-checkbox/DSControlledCheckbox.smoke.spec.js +0 -125
- package/ds-indeterminate-progress-indicator/DSIndetermintateProgressIndicator.func.spec.js +0 -17
- /package/ds-typography/{DSTypography.resize.visual.spec.js → DSTypography.resize.skipped.js} +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/* eslint-disable max-lines */
|
|
3
3
|
import { Key } from 'webdriverio';
|
|
4
4
|
import ReactHookCO from './ReactHookCO';
|
|
5
|
+
import DSInputTextCO from '../ds-input-text/DSInputTextCO';
|
|
5
6
|
import { type } from '../../helpers';
|
|
6
7
|
|
|
7
8
|
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
@@ -11,7 +12,7 @@ if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:o
|
|
|
11
12
|
if (errorOnGo) throw errorOnGo;
|
|
12
13
|
});
|
|
13
14
|
it('should correctly change the text input value sending keys', async () => {
|
|
14
|
-
const input = await
|
|
15
|
+
const input = await DSInputTextCO.getInputTextByIndex(0);
|
|
15
16
|
await input.click();
|
|
16
17
|
await type('Lucas caminador de cielos');
|
|
17
18
|
const inputValue = await input.getAttribute('value');
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Key } from 'webdriverio';
|
|
2
2
|
import { type } from '../../helpers';
|
|
3
3
|
import ReactHookCO from './ReactHookCO';
|
|
4
|
+
import DSInputTextCO from '../ds-input-text/DSInputTextCO';
|
|
4
5
|
|
|
5
6
|
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
6
7
|
describe('PUI-8081 - ds-controlled-form: with React Hook', () => {
|
|
@@ -9,7 +10,7 @@ if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:o
|
|
|
9
10
|
if (errorOnGo) throw errorOnGo;
|
|
10
11
|
});
|
|
11
12
|
it('should interact elements, combobox open and checkbox checked', async () => {
|
|
12
|
-
const input = await
|
|
13
|
+
const input = await DSInputTextCO.getInputText();
|
|
13
14
|
await input.click();
|
|
14
15
|
await type('Lucas caminador de cielos');
|
|
15
16
|
await browser.keys(Key.Tab);
|
|
@@ -4,10 +4,6 @@ import { PageObject, Urlbuilder, getElementByIndex } from '../../helpers';
|
|
|
4
4
|
export default class ReactHookCO extends PageObject {
|
|
5
5
|
static basicURL = new Urlbuilder(PATH_E2E_HOOK_FORM, 'on-submit-validation-form');
|
|
6
6
|
|
|
7
|
-
static async getInput() {
|
|
8
|
-
return $('[data-testid="ds-input-text-input"]');
|
|
9
|
-
}
|
|
10
|
-
|
|
11
7
|
static async getCombobox() {
|
|
12
8
|
return $('[data-testid="combobox-controls-wrapper"]');
|
|
13
9
|
}
|
|
@@ -20,12 +16,6 @@ export default class ReactHookCO extends PageObject {
|
|
|
20
16
|
return $('[data-testid="ds-controlled-toggle-checkbox"]');
|
|
21
17
|
}
|
|
22
18
|
|
|
23
|
-
static async getInputs() {
|
|
24
|
-
return $$('[data-testid="ds-input-text-input"]');
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
static getInputByIndex = async (index) => getElementByIndex(this.getInputs, index);
|
|
28
|
-
|
|
29
19
|
static async getMonthInputs() {
|
|
30
20
|
return $$('[data-testid="ds-controlled-date-time-picker-month-input"]');
|
|
31
21
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import UseMaskCO from '../useMaskCO';
|
|
2
|
+
import { axeCoreCheck } from '../../../helpers';
|
|
3
|
+
|
|
4
|
+
if (
|
|
5
|
+
(!browser.capabilities['ice:options'].isPhone &&
|
|
6
|
+
!browser.capabilities['ice:options'].isTablet &&
|
|
7
|
+
browser.capabilities.browserName === 'chrome') ||
|
|
8
|
+
browser.capabilities.browserName === 'Chrome'
|
|
9
|
+
) {
|
|
10
|
+
// Accessibility coverage for the numeric mask stories, added alongside PUI-15648
|
|
11
|
+
// (critical mask information moved out of the placeholder and into the feedback
|
|
12
|
+
// message). The package had no axe-core coverage at all before these describes.
|
|
13
|
+
describe('PUI-18850 - useNumberMask:: Number - AxeCore Test', () => {
|
|
14
|
+
before(async () => {
|
|
15
|
+
const errorOnGo = await UseMaskCO.numberURL.go();
|
|
16
|
+
if (errorOnGo) throw errorOnGo;
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('01: should have no accessibility violations', async () => {
|
|
20
|
+
const result = await axeCoreCheck();
|
|
21
|
+
expect(result.length).toBe(0);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
describe('PUI-18851 - useNumberMask:: Currency - AxeCore Test', () => {
|
|
26
|
+
before(async () => {
|
|
27
|
+
const errorOnGo = await UseMaskCO.currencyURL.go();
|
|
28
|
+
if (errorOnGo) throw errorOnGo;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('01: should have no accessibility violations', async () => {
|
|
32
|
+
const result = await axeCoreCheck();
|
|
33
|
+
expect(result.length).toBe(0);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
describe('PUI-18852 - useNumberMask:: Percent - AxeCore Test', () => {
|
|
38
|
+
before(async () => {
|
|
39
|
+
const errorOnGo = await UseMaskCO.percentURL.go();
|
|
40
|
+
if (errorOnGo) throw errorOnGo;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('01: should have no accessibility violations', async () => {
|
|
44
|
+
const result = await axeCoreCheck();
|
|
45
|
+
expect(result.length).toBe(0);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable max-lines */
|
|
2
2
|
import UseMaskCO from '../useMaskCO';
|
|
3
|
+
import DSInputTextCO from '../../ds-input-text/DSInputTextCO';
|
|
3
4
|
import { type } from '../../../helpers';
|
|
4
5
|
|
|
5
6
|
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
@@ -9,29 +10,29 @@ if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:o
|
|
|
9
10
|
if (errorOnGo) throw errorOnGo;
|
|
10
11
|
});
|
|
11
12
|
it('01: should correctly format the currency input accordingly to the mask', async () => {
|
|
12
|
-
const secondInput = await
|
|
13
|
+
const secondInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
13
14
|
await secondInput.click();
|
|
14
15
|
await type('123a4$bb56.90');
|
|
15
16
|
await expect(secondInput).toHaveValue('$123,456.90');
|
|
16
17
|
});
|
|
17
18
|
it('02: should have initial value', async () => {
|
|
18
|
-
const firstInput = await
|
|
19
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
19
20
|
await expect(firstInput).toHaveValue('$100.50');
|
|
20
21
|
});
|
|
21
22
|
it('03: should correctly clear the input', async () => {
|
|
22
|
-
const firstInput = await
|
|
23
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
23
24
|
await UseMaskCO.clearValue(firstInput);
|
|
24
25
|
await expect(firstInput).toHaveValue('');
|
|
25
26
|
});
|
|
26
27
|
it('04: should correctly format the currency input accordingly to the mask - decimal value', async () => {
|
|
27
|
-
const firstInput = await
|
|
28
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
28
29
|
await firstInput.click();
|
|
29
30
|
await type('.9');
|
|
30
31
|
await expect(firstInput).toHaveValue('$0.9');
|
|
31
32
|
});
|
|
32
33
|
it('05: should correctly clear all the inputs', async () => {
|
|
33
|
-
const firstInput = await
|
|
34
|
-
const secondInput = await
|
|
34
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
35
|
+
const secondInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
35
36
|
await UseMaskCO.clearValue(firstInput);
|
|
36
37
|
await UseMaskCO.clearValue(secondInput);
|
|
37
38
|
await expect(firstInput).toHaveValue('');
|
|
@@ -44,46 +45,46 @@ if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:o
|
|
|
44
45
|
if (errorOnGo) throw errorOnGo;
|
|
45
46
|
});
|
|
46
47
|
it('01: should correctly format the Number input accordingly to the mask', async () => {
|
|
47
|
-
const fifthInput = await
|
|
48
|
+
const fifthInput = await DSInputTextCO.getInputTextByIndex(4);
|
|
48
49
|
await fifthInput.click();
|
|
49
50
|
await type('123a4$bb56');
|
|
50
51
|
await expect(fifthInput).toHaveValue('123,456');
|
|
51
52
|
});
|
|
52
53
|
it('02: should correctly format the Negative Number Allowed input accordingly to the mask', async () => {
|
|
53
|
-
const sixthInput = await
|
|
54
|
+
const sixthInput = await DSInputTextCO.getInputTextByIndex(5);
|
|
54
55
|
await sixthInput.click();
|
|
55
56
|
await type('-123a4$bb-56');
|
|
56
57
|
await expect(sixthInput).toHaveValue('-123,456');
|
|
57
58
|
});
|
|
58
59
|
it('03: should correctly format the Negative Number Allowed input with decimal', async () => {
|
|
59
|
-
const sixthInput = await
|
|
60
|
+
const sixthInput = await DSInputTextCO.getInputTextByIndex(5);
|
|
60
61
|
await UseMaskCO.clearValue(sixthInput);
|
|
61
62
|
await type('-.08');
|
|
62
63
|
await expect(sixthInput).toHaveValue('-0.08');
|
|
63
64
|
});
|
|
64
65
|
it('04: should correctly format the No Thousands Separator input accordingly to the mask', async () => {
|
|
65
|
-
const sevenhtInput = await
|
|
66
|
+
const sevenhtInput = await DSInputTextCO.getInputTextByIndex(6);
|
|
66
67
|
await sevenhtInput.click();
|
|
67
68
|
await type('123a4$bb56');
|
|
68
69
|
await expect(sevenhtInput).toHaveValue('123456');
|
|
69
70
|
});
|
|
70
71
|
it('05: should correctly format the Decimal Required input accordingly to the mask', async () => {
|
|
71
|
-
const eightInput = await
|
|
72
|
+
const eightInput = await DSInputTextCO.getInputTextByIndex(7);
|
|
72
73
|
await eightInput.click();
|
|
73
74
|
await type('123a4$bb56.1');
|
|
74
75
|
await expect(eightInput).toHaveValue('123,456.1');
|
|
75
76
|
});
|
|
76
77
|
it('06: should correctly format the Decimal Required with its decimals completed', async () => {
|
|
77
|
-
const eightInput = await
|
|
78
|
-
const sevenhtInput = await
|
|
78
|
+
const eightInput = await DSInputTextCO.getInputTextByIndex(7);
|
|
79
|
+
const sevenhtInput = await DSInputTextCO.getInputTextByIndex(6);
|
|
79
80
|
await sevenhtInput.click();
|
|
80
81
|
await expect(eightInput).toHaveValue('123,456.100');
|
|
81
82
|
});
|
|
82
83
|
it('07: should correctly clear all the inputs', async () => {
|
|
83
|
-
const fifthInput = await
|
|
84
|
-
const sixthInput = await
|
|
85
|
-
const sevenhtInput = await
|
|
86
|
-
const eightInput = await
|
|
84
|
+
const fifthInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
85
|
+
const sixthInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
86
|
+
const sevenhtInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
87
|
+
const eightInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
87
88
|
await UseMaskCO.clearValue(fifthInput);
|
|
88
89
|
await UseMaskCO.clearValue(sixthInput);
|
|
89
90
|
await UseMaskCO.clearValue(sevenhtInput);
|
|
@@ -100,20 +101,20 @@ if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:o
|
|
|
100
101
|
if (errorOnGo) throw errorOnGo;
|
|
101
102
|
});
|
|
102
103
|
it('01: all initial values should be displayed', async () => {
|
|
103
|
-
const firstInput = await
|
|
104
|
-
const secondInput = await
|
|
105
|
-
const thirdInput = await
|
|
106
|
-
const fourthInput = await
|
|
104
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
105
|
+
const secondInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
106
|
+
const thirdInput = await DSInputTextCO.getInputTextByIndex(2);
|
|
107
|
+
const fourthInput = await DSInputTextCO.getInputTextByIndex(3);
|
|
107
108
|
await expect(firstInput).toHaveValue('20,030');
|
|
108
109
|
await expect(secondInput).toHaveValue('-0.30');
|
|
109
110
|
await expect(thirdInput).toHaveValue('10000000');
|
|
110
111
|
await expect(fourthInput).toHaveValue('1,000.0');
|
|
111
112
|
});
|
|
112
113
|
it('02: should correctly clear all inputs', async () => {
|
|
113
|
-
const firstInput = await
|
|
114
|
-
const secondInput = await
|
|
115
|
-
const thirdInput = await
|
|
116
|
-
const fourthInput = await
|
|
114
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
115
|
+
const secondInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
116
|
+
const thirdInput = await DSInputTextCO.getInputTextByIndex(2);
|
|
117
|
+
const fourthInput = await DSInputTextCO.getInputTextByIndex(3);
|
|
117
118
|
await UseMaskCO.clearValue(firstInput);
|
|
118
119
|
await UseMaskCO.clearValue(secondInput);
|
|
119
120
|
await UseMaskCO.clearValue(thirdInput);
|
|
@@ -124,25 +125,25 @@ if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:o
|
|
|
124
125
|
await expect(fourthInput).toHaveValue('');
|
|
125
126
|
});
|
|
126
127
|
it('03: should correctly format the No decimal allowed input', async () => {
|
|
127
|
-
const firstInput = await
|
|
128
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(4);
|
|
128
129
|
await firstInput.click();
|
|
129
130
|
await type('-123a4$bb56.0');
|
|
130
131
|
await expect(firstInput).toHaveValue('1,234,560');
|
|
131
132
|
});
|
|
132
133
|
it('04: should correctly format the Negative Number Allowed input with decimal', async () => {
|
|
133
|
-
const secondInput = await
|
|
134
|
+
const secondInput = await DSInputTextCO.getInputTextByIndex(5);
|
|
134
135
|
await UseMaskCO.clearValue(secondInput);
|
|
135
136
|
await type('-12345678.09');
|
|
136
137
|
await expect(secondInput).toHaveValue('-12,345,678.09');
|
|
137
138
|
});
|
|
138
139
|
it('05: should correctly format the No Thousands Separator input accordingly to the mask', async () => {
|
|
139
|
-
const thirdInput = await
|
|
140
|
+
const thirdInput = await DSInputTextCO.getInputTextByIndex(6);
|
|
140
141
|
await thirdInput.click();
|
|
141
142
|
await type('-1,23a4$,bb5.6');
|
|
142
143
|
await expect(thirdInput).toHaveValue('-12345.6');
|
|
143
144
|
});
|
|
144
145
|
it('06: should correctly format the Decimal Required input accordingly to the mask', async () => {
|
|
145
|
-
const fourthInput = await
|
|
146
|
+
const fourthInput = await DSInputTextCO.getInputTextByIndex(7);
|
|
146
147
|
await fourthInput.click();
|
|
147
148
|
await type('.323952345');
|
|
148
149
|
await expect(fourthInput).toHaveValue('0.323');
|
|
@@ -154,34 +155,34 @@ if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:o
|
|
|
154
155
|
if (errorOnGo) throw errorOnGo;
|
|
155
156
|
});
|
|
156
157
|
it('01: should correctly format the input accordingly to the mask and add decimal dot', async () => {
|
|
157
|
-
const secondInput = await
|
|
158
|
+
const secondInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
158
159
|
await secondInput.click();
|
|
159
160
|
await type('123a4$bb56');
|
|
160
161
|
await expect(secondInput).toHaveValue('123,456.%');
|
|
161
162
|
});
|
|
162
163
|
it('02: should correctly format the input accordingly to the mask with decimals', async () => {
|
|
163
|
-
const secondInput = await
|
|
164
|
+
const secondInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
164
165
|
await secondInput.click();
|
|
165
166
|
await type('.a25');
|
|
166
167
|
await expect(secondInput).toHaveValue('123,456.25%');
|
|
167
168
|
});
|
|
168
169
|
it('03: should correctly clear inputs', async () => {
|
|
169
|
-
const firstInput = await
|
|
170
|
-
const secondInput = await
|
|
170
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
171
|
+
const secondInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
171
172
|
await UseMaskCO.clearValue(firstInput);
|
|
172
173
|
await UseMaskCO.clearValue(secondInput);
|
|
173
174
|
await expect(firstInput).toHaveValue('');
|
|
174
175
|
await expect(secondInput).toHaveValue('');
|
|
175
176
|
});
|
|
176
177
|
it('04: should correctly format the first input', async () => {
|
|
177
|
-
const firstInput = await
|
|
178
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
178
179
|
await firstInput.click();
|
|
179
180
|
await type('%-$90,242.0010');
|
|
180
181
|
await expect(firstInput).toHaveValue('90,242.00%');
|
|
181
182
|
});
|
|
182
183
|
it('05: should correctly format the second input', async () => {
|
|
183
|
-
const firstInput = await
|
|
184
|
-
const secondInput = await
|
|
184
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
185
|
+
const secondInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
185
186
|
await secondInput.click();
|
|
186
187
|
await type('.30');
|
|
187
188
|
await expect(secondInput).toHaveValue('0.30%');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type } from '../../../helpers';
|
|
2
2
|
import UseMaskCO from '../useMaskCO';
|
|
3
|
+
import DSInputTextCO from '../../ds-input-text/DSInputTextCO';
|
|
3
4
|
|
|
4
5
|
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
5
6
|
describe('PUI-8175: UseNumberMask - visual', () => {
|
|
@@ -8,23 +9,23 @@ if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:o
|
|
|
8
9
|
if (errorOnGo) throw errorOnGo;
|
|
9
10
|
});
|
|
10
11
|
it('01: Input should be correctly formatted according to the specified mask - initial values', async () => {
|
|
11
|
-
const firstInput = await
|
|
12
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
12
13
|
await firstInput.waitForDisplayed();
|
|
13
14
|
const snapshot = await browser.checkSnapshot(UseMaskCO.snapshotPath('useMask-numbers-initial-value'));
|
|
14
15
|
await expect(snapshot).toEqual(0);
|
|
15
16
|
});
|
|
16
17
|
it('02: Input should be correctly formatted according to the specified mask - all inputs completed', async () => {
|
|
17
|
-
const firstInput = await
|
|
18
|
-
const fifthInput = await
|
|
18
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
19
|
+
const fifthInput = await DSInputTextCO.getInputTextByIndex(4);
|
|
19
20
|
await fifthInput.click();
|
|
20
21
|
await type('123a4$bb56');
|
|
21
|
-
const sixthInput = await
|
|
22
|
+
const sixthInput = await DSInputTextCO.getInputTextByIndex(5);
|
|
22
23
|
await sixthInput.click();
|
|
23
24
|
await type('-123a4$bb56');
|
|
24
|
-
const sevenhtInput = await
|
|
25
|
+
const sevenhtInput = await DSInputTextCO.getInputTextByIndex(6);
|
|
25
26
|
await sevenhtInput.click();
|
|
26
27
|
await type('123a4$bb56');
|
|
27
|
-
const eightInput = await
|
|
28
|
+
const eightInput = await DSInputTextCO.getInputTextByIndex(7);
|
|
28
29
|
await eightInput.click();
|
|
29
30
|
await type('123a4$bb56.1');
|
|
30
31
|
await firstInput.click();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type } from '../../../helpers';
|
|
2
2
|
import UseMaskCO from '../useMaskCO';
|
|
3
|
+
import DSInputTextCO from '../../ds-input-text/DSInputTextCO';
|
|
3
4
|
|
|
4
5
|
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
5
6
|
describe('PUI-8170 - usePhoneMask:: Phone', () => {
|
|
@@ -8,22 +9,22 @@ if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:o
|
|
|
8
9
|
if (errorOnGo) throw errorOnGo;
|
|
9
10
|
});
|
|
10
11
|
it('01: should correctly format the National Phone input accordingly to the mask', async () => {
|
|
11
|
-
const input = await
|
|
12
|
+
const input = await DSInputTextCO.getInputTextByIndex(2);
|
|
12
13
|
await input.click();
|
|
13
14
|
await type('123a4$bb5678910');
|
|
14
15
|
await expect(input).toHaveValue('(123) 456 - 7891');
|
|
15
16
|
});
|
|
16
17
|
it('02: should correctly format the International Phone input accordingly to the mask', async () => {
|
|
17
|
-
const input = await
|
|
18
|
+
const input = await DSInputTextCO.getInputTextByIndex(3);
|
|
18
19
|
await input.click();
|
|
19
20
|
await type('123a4$bb5678-910');
|
|
20
21
|
await expect(input).toHaveValue('+1 (123) 456 - 7891');
|
|
21
22
|
});
|
|
22
23
|
it('03: should clear all correctly', async () => {
|
|
23
|
-
const firstInput = await
|
|
24
|
-
const secondInput = await
|
|
25
|
-
const thirdInput = await
|
|
26
|
-
const fourthInput = await
|
|
24
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
25
|
+
const secondInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
26
|
+
const thirdInput = await DSInputTextCO.getInputTextByIndex(2);
|
|
27
|
+
const fourthInput = await DSInputTextCO.getInputTextByIndex(3);
|
|
27
28
|
await UseMaskCO.clearValue(firstInput);
|
|
28
29
|
await UseMaskCO.clearValue(secondInput);
|
|
29
30
|
await UseMaskCO.clearValue(thirdInput);
|
|
@@ -34,13 +35,13 @@ if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:o
|
|
|
34
35
|
await expect(fourthInput).toHaveValue('');
|
|
35
36
|
});
|
|
36
37
|
it('04: should correctly format the National Phone input - initial value', async () => {
|
|
37
|
-
const firstInput = await
|
|
38
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
38
39
|
await firstInput.click();
|
|
39
40
|
await type('((123%a4$bb56-+78910');
|
|
40
41
|
await expect(firstInput).toHaveValue('(123) 456 - 7891');
|
|
41
42
|
});
|
|
42
43
|
it('05: should correctly format the International Phone input - initial value', async () => {
|
|
43
|
-
const secondInput = await
|
|
44
|
+
const secondInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
44
45
|
await secondInput.click();
|
|
45
46
|
await type('(12-+3a4$bb56)78-910');
|
|
46
47
|
await expect(secondInput).toHaveValue('+1 (123) 456 - 7891');
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import UseMaskCO from '../useMaskCO';
|
|
2
|
+
import DSInputTextCO from '../../ds-input-text/DSInputTextCO';
|
|
2
3
|
import { type } from '../../../helpers';
|
|
3
4
|
|
|
4
5
|
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
@@ -9,15 +10,15 @@ if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:o
|
|
|
9
10
|
});
|
|
10
11
|
it('01: Input should be correctly formatted according to the specified mask - initial values', async () => {
|
|
11
12
|
await browser.eyesOpen();
|
|
12
|
-
const thirdInput = await
|
|
13
|
+
const thirdInput = await DSInputTextCO.getInputTextByIndex(2);
|
|
13
14
|
await thirdInput.waitForDisplayed();
|
|
14
15
|
const snapshot = await browser.eyesCheckSnapshot(UseMaskCO.snapshotPath('useMask-phone-initial-value'));
|
|
15
16
|
await expect(snapshot).toEqual(0);
|
|
16
17
|
});
|
|
17
18
|
it('02: should correctly format the International Phone input accordingly to the mask', async () => {
|
|
18
19
|
await browser.eyesOpen();
|
|
19
|
-
const thirdInput = await
|
|
20
|
-
const fourthInput = await
|
|
20
|
+
const thirdInput = await DSInputTextCO.getInputTextByIndex(2);
|
|
21
|
+
const fourthInput = await DSInputTextCO.getInputTextByIndex(3);
|
|
21
22
|
await thirdInput.click();
|
|
22
23
|
await type('((123%a4$bb56-+78910');
|
|
23
24
|
await fourthInput.click();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-lines */
|
|
2
2
|
import { type } from '../../../helpers';
|
|
3
3
|
import UseMaskCO from '../useMaskCO';
|
|
4
|
+
import DSInputTextCO from '../../ds-input-text/DSInputTextCO';
|
|
4
5
|
|
|
5
6
|
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
6
7
|
describe('PUI-9283 - useRegExpMask:: With React Hook Form', () => {
|
|
@@ -9,21 +10,21 @@ if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:o
|
|
|
9
10
|
if (errorOnGo) throw errorOnGo;
|
|
10
11
|
});
|
|
11
12
|
it('01: should correctly format the input accordingly to the percent mask', async () => {
|
|
12
|
-
const input = await
|
|
13
|
+
const input = await DSInputTextCO.getInputTextByIndex(0);
|
|
13
14
|
await input.click();
|
|
14
15
|
await type('123a4$bb56');
|
|
15
16
|
const inputValue = await input.getValue();
|
|
16
17
|
await expect(inputValue).toEqual('123,456%');
|
|
17
18
|
});
|
|
18
19
|
it('02: should correctly format the currency input accordingly to the currency mask', async () => {
|
|
19
|
-
const input = await
|
|
20
|
+
const input = await DSInputTextCO.getInputTextByIndex(1);
|
|
20
21
|
await input.click();
|
|
21
22
|
await type('123a4$bb56');
|
|
22
23
|
const inputValue = await input.getValue();
|
|
23
24
|
await expect(inputValue).toEqual('$123,456');
|
|
24
25
|
});
|
|
25
26
|
it('03: should correctly format the International Phone input accordingly to the mask', async () => {
|
|
26
|
-
const input = await
|
|
27
|
+
const input = await DSInputTextCO.getInputTextByIndex(2);
|
|
27
28
|
await input.click();
|
|
28
29
|
await type('123a4$bb5678-910');
|
|
29
30
|
const inputValue = await input.getValue();
|
package/ds-controlled-form/useMask/ReackHookFormWithMask/ReactHookFormWithMask.visual.spec.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-lines */
|
|
2
2
|
import { type } from '../../../helpers';
|
|
3
3
|
import UseMaskCO from '../useMaskCO';
|
|
4
|
+
import DSInputTextCO from '../../ds-input-text/DSInputTextCO';
|
|
4
5
|
|
|
5
6
|
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
6
7
|
describe('PUI-10170 - useRegExpMask:: With React Hook Form - visual', () => {
|
|
@@ -10,16 +11,16 @@ if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:o
|
|
|
10
11
|
});
|
|
11
12
|
it('01: Should display correctly react hook form with mask - initial values', async () => {
|
|
12
13
|
await browser.eyesOpen();
|
|
13
|
-
const firstInput = await
|
|
14
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
14
15
|
await firstInput.waitForDisplayed();
|
|
15
16
|
const snapshot = await browser.eyesCheckSnapshot(UseMaskCO.snapshotPath('useMask-react-hook-form-initial-value'));
|
|
16
17
|
await expect(snapshot).toEqual(0);
|
|
17
18
|
});
|
|
18
19
|
it('02: Should display correctly react hook form with mask - all completed', async () => {
|
|
19
20
|
await browser.eyesOpen();
|
|
20
|
-
const firstInput = await
|
|
21
|
-
const secondInput = await
|
|
22
|
-
const thirdInput = await
|
|
21
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
22
|
+
const secondInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
23
|
+
const thirdInput = await DSInputTextCO.getInputTextByIndex(2);
|
|
23
24
|
const checkbox = await UseMaskCO.getCheckbox();
|
|
24
25
|
const toggle = await UseMaskCO.getToggle();
|
|
25
26
|
await firstInput.click();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-lines */
|
|
2
2
|
import { type } from '../../../helpers';
|
|
3
3
|
import UseMaskCO from '../useMaskCO';
|
|
4
|
+
import DSInputTextCO from '../../ds-input-text/DSInputTextCO';
|
|
4
5
|
|
|
5
6
|
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
6
7
|
describe('PUI-8171 - useRegExpMask:: RegExp', () => {
|
|
@@ -9,26 +10,26 @@ if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:o
|
|
|
9
10
|
if (errorOnGo) throw errorOnGo;
|
|
10
11
|
});
|
|
11
12
|
it('01: first input should have initial value', async () => {
|
|
12
|
-
const firstInput = await
|
|
13
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
13
14
|
await firstInput.click();
|
|
14
15
|
await expect(firstInput).toHaveValue('+(44) 444-44-44');
|
|
15
16
|
});
|
|
16
17
|
it('02: second input should be correctly formated', async () => {
|
|
17
|
-
const secondInput = await
|
|
18
|
+
const secondInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
18
19
|
await secondInput.click();
|
|
19
20
|
await type('123a4$bb5678-910');
|
|
20
21
|
await expect(secondInput).toHaveValue('+(12) 345-67-89');
|
|
21
22
|
});
|
|
22
23
|
it('03: clear all inputs', async () => {
|
|
23
|
-
const firstInput = await
|
|
24
|
-
const secondInput = await
|
|
24
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
25
|
+
const secondInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
25
26
|
await UseMaskCO.clearValue(firstInput);
|
|
26
27
|
await UseMaskCO.clearValue(secondInput);
|
|
27
28
|
await expect(firstInput).toHaveValue('');
|
|
28
29
|
await expect(secondInput).toHaveValue('');
|
|
29
30
|
});
|
|
30
31
|
it('04: first input should be correctly formated', async () => {
|
|
31
|
-
const firstInput = await
|
|
32
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
32
33
|
await firstInput.click();
|
|
33
34
|
await type('1(()23))a4$bb56&*(}}}{:"><? 78-9106456');
|
|
34
35
|
await expect(firstInput).toHaveValue('+(12) 345-67-89');
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-lines */
|
|
2
2
|
import { type } from '../../../helpers';
|
|
3
3
|
import UseMaskCO from '../useMaskCO';
|
|
4
|
+
import DSInputTextCO from '../../ds-input-text/DSInputTextCO';
|
|
4
5
|
|
|
5
6
|
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
6
7
|
describe('PUI-8172 - useSSNMask -func', () => {
|
|
@@ -9,26 +10,26 @@ if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:o
|
|
|
9
10
|
if (errorOnGo) throw errorOnGo;
|
|
10
11
|
});
|
|
11
12
|
it('01: first input should have initial value', async () => {
|
|
12
|
-
const firstInput = await
|
|
13
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
13
14
|
await firstInput.waitForDisplayed();
|
|
14
15
|
await expect(firstInput).toHaveValue('111-11-1111');
|
|
15
16
|
});
|
|
16
17
|
it('02: should correctly format the SSN input accordingly to the mask - second input', async () => {
|
|
17
|
-
const secondInput = await
|
|
18
|
+
const secondInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
18
19
|
await secondInput.click();
|
|
19
20
|
await type('123a4$bb5678-910');
|
|
20
21
|
await expect(secondInput).toHaveValue('123-45-6789');
|
|
21
22
|
});
|
|
22
23
|
it('03: should correctly clear all inputs', async () => {
|
|
23
|
-
const firstInput = await
|
|
24
|
-
const secondInput = await
|
|
24
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
25
|
+
const secondInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
25
26
|
await UseMaskCO.clearValue(firstInput);
|
|
26
27
|
await UseMaskCO.clearValue(secondInput);
|
|
27
28
|
await expect(firstInput).toHaveValue('');
|
|
28
29
|
await expect(secondInput).toHaveValue('');
|
|
29
30
|
});
|
|
30
31
|
it('04: should correctly format the SSN input accordingly to the mask - first input', async () => {
|
|
31
|
-
const firstInput = await
|
|
32
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
32
33
|
await firstInput.click();
|
|
33
34
|
await type('1-124--+=23a4$bb5678-910');
|
|
34
35
|
await expect(firstInput).toHaveValue('112-42-3456');
|
|
@@ -43,7 +44,7 @@ if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:o
|
|
|
43
44
|
if (errorOnGo) throw errorOnGo;
|
|
44
45
|
});
|
|
45
46
|
it('01: should correctly format the SSN input even when using only zeros - second input', async () => {
|
|
46
|
-
const secondInput = await
|
|
47
|
+
const secondInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
47
48
|
await secondInput.click();
|
|
48
49
|
await type('000000000');
|
|
49
50
|
await expect(secondInput).toHaveValue('000-00-0000');
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-lines */
|
|
2
2
|
import { type } from '../../../helpers';
|
|
3
3
|
import UseMaskCO from '../useMaskCO';
|
|
4
|
+
import DSInputTextCO from '../../ds-input-text/DSInputTextCO';
|
|
4
5
|
|
|
5
6
|
if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:options'].isTablet) {
|
|
6
7
|
describe('PUI-8173 - useZipCodeMask:: ZipCode', () => {
|
|
@@ -9,26 +10,26 @@ if (!browser.capabilities['ice:options'].isPhone && !browser.capabilities['ice:o
|
|
|
9
10
|
if (errorOnGo) throw errorOnGo;
|
|
10
11
|
});
|
|
11
12
|
it('01: first input should have initial value', async () => {
|
|
12
|
-
const firstInput = await
|
|
13
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
13
14
|
await firstInput.waitForDisplayed();
|
|
14
15
|
await expect(firstInput).toHaveValue('11111-1111');
|
|
15
16
|
});
|
|
16
17
|
it('02: should correctly format the ZipCode input accordingly to the mask - second input', async () => {
|
|
17
|
-
const secondInput = await
|
|
18
|
+
const secondInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
18
19
|
await secondInput.click();
|
|
19
20
|
await type('123a4$bb5678-910');
|
|
20
21
|
await expect(secondInput).toHaveValue('12345-6789');
|
|
21
22
|
});
|
|
22
23
|
it('03: should correctly clear all inputs', async () => {
|
|
23
|
-
const firstInput = await
|
|
24
|
-
const secondInput = await
|
|
24
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(0);
|
|
25
|
+
const secondInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
25
26
|
await UseMaskCO.clearValue(firstInput);
|
|
26
27
|
await UseMaskCO.clearValue(secondInput);
|
|
27
28
|
await expect(firstInput).toHaveValue('');
|
|
28
29
|
await expect(secondInput).toHaveValue('');
|
|
29
30
|
});
|
|
30
31
|
it('04: should correctly format the ZipCode input accordingly to the mask - first input', async () => {
|
|
31
|
-
const firstInput = await
|
|
32
|
+
const firstInput = await DSInputTextCO.getInputTextByIndex(1);
|
|
32
33
|
await firstInput.click();
|
|
33
34
|
await type('1-124--+=23a4$bb5678-910');
|
|
34
35
|
await expect(firstInput).toHaveValue('11242-3456');
|