@elastic/eui-test-helpers 1.5.0 → 1.6.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/README.md +4 -0
- package/lib/cjs/components/accordion/selectors.d.ts +15 -0
- package/lib/cjs/components/accordion/selectors.js +29 -0
- package/lib/cjs/components/flyout/selectors.d.ts +10 -0
- package/lib/cjs/components/flyout/selectors.js +24 -0
- package/lib/cjs/components/modal/selectors.d.ts +11 -0
- package/lib/cjs/components/modal/selectors.js +25 -0
- package/lib/cjs/components/popover/selectors.d.ts +11 -0
- package/lib/cjs/components/popover/selectors.js +25 -0
- package/lib/cjs/index.d.ts +4 -0
- package/lib/cjs/index.js +30 -2
- package/lib/cjs/playwright/components/accordion/object.d.ts +16 -0
- package/lib/cjs/playwright/components/accordion/object.js +39 -0
- package/lib/cjs/playwright/components/combo_box/object.d.ts +9 -2
- package/lib/cjs/playwright/components/combo_box/object.js +23 -3
- package/lib/cjs/playwright/components/flyout/object.d.ts +17 -0
- package/lib/cjs/playwright/components/flyout/object.js +37 -0
- package/lib/cjs/playwright/components/modal/object.d.ts +15 -0
- package/lib/cjs/playwright/components/modal/object.js +35 -0
- package/lib/cjs/playwright/components/popover/object.d.ts +26 -0
- package/lib/cjs/playwright/components/popover/object.js +72 -0
- package/lib/cjs/storybook.d.ts +1 -1
- package/lib/cjs/storybook.js +1 -1
- package/lib/esm/components/accordion/selectors.d.ts +15 -0
- package/lib/esm/components/accordion/selectors.js +23 -0
- package/lib/esm/components/accordion/selectors.js.map +1 -0
- package/lib/esm/components/flyout/selectors.d.ts +10 -0
- package/lib/esm/components/flyout/selectors.js +18 -0
- package/lib/esm/components/flyout/selectors.js.map +1 -0
- package/lib/esm/components/modal/selectors.d.ts +11 -0
- package/lib/esm/components/modal/selectors.js +19 -0
- package/lib/esm/components/modal/selectors.js.map +1 -0
- package/lib/esm/components/popover/selectors.d.ts +11 -0
- package/lib/esm/components/popover/selectors.js +19 -0
- package/lib/esm/components/popover/selectors.js.map +1 -0
- package/lib/esm/index.d.ts +4 -0
- package/lib/esm/index.js +4 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/playwright/components/accordion/object.d.ts +16 -0
- package/lib/esm/playwright/components/accordion/object.js +30 -0
- package/lib/esm/playwright/components/accordion/object.js.map +1 -0
- package/lib/esm/playwright/components/combo_box/object.d.ts +9 -2
- package/lib/esm/playwright/components/combo_box/object.js +23 -3
- package/lib/esm/playwright/components/combo_box/object.js.map +1 -1
- package/lib/esm/playwright/components/flyout/object.d.ts +17 -0
- package/lib/esm/playwright/components/flyout/object.js +29 -0
- package/lib/esm/playwright/components/flyout/object.js.map +1 -0
- package/lib/esm/playwright/components/modal/object.d.ts +15 -0
- package/lib/esm/playwright/components/modal/object.js +27 -0
- package/lib/esm/playwright/components/modal/object.js.map +1 -0
- package/lib/esm/playwright/components/popover/object.d.ts +26 -0
- package/lib/esm/playwright/components/popover/object.js +58 -0
- package/lib/esm/playwright/components/popover/object.js.map +1 -0
- package/lib/esm/storybook.d.ts +1 -1
- package/lib/esm/storybook.js +1 -1
- package/package.json +1 -1
- package/src/components/accordion/README.md +28 -0
- package/src/components/flyout/README.md +26 -0
- package/src/components/modal/README.md +27 -0
- package/src/components/popover/README.md +29 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectors.js","sourceRoot":"","sources":["../../../../src/components/accordion/selectors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,6DAA6D;IAC7D,aAAa,EAAE,eAAe;IAE9B,mFAAmF;IACnF,gBAAgB,EAAE,yDAAyD;IAE3E,yHAAyH;IACzH,gBAAgB,EAAE,+BAA+B;CAClD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable selectors for
|
|
3
|
+
* {@link https://eui.elastic.co/docs/components/containers/flyout/|EuiFlyout}.
|
|
4
|
+
*/
|
|
5
|
+
export declare const EuiFlyoutSelectors: {
|
|
6
|
+
/** Root element carrying the consumer's `data-test-subj`. CSS. */
|
|
7
|
+
ROOT_SELECTOR: string;
|
|
8
|
+
/** `data-test-subj` EUI sets on its own close button. Absent with `hideCloseButton` or a rendered flyout menu. */
|
|
9
|
+
CLOSE_BUTTON_TEST_SUBJ: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Stable selectors for
|
|
10
|
+
* {@link https://eui.elastic.co/docs/components/containers/flyout/|EuiFlyout}.
|
|
11
|
+
*/
|
|
12
|
+
export const EuiFlyoutSelectors = {
|
|
13
|
+
/** Root element carrying the consumer's `data-test-subj`. CSS. */
|
|
14
|
+
ROOT_SELECTOR: '.euiFlyout',
|
|
15
|
+
/** `data-test-subj` EUI sets on its own close button. Absent with `hideCloseButton` or a rendered flyout menu. */
|
|
16
|
+
CLOSE_BUTTON_TEST_SUBJ: 'euiFlyoutCloseButton',
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=selectors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectors.js","sourceRoot":"","sources":["../../../../src/components/flyout/selectors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,kEAAkE;IAClE,aAAa,EAAE,YAAY;IAE3B,kHAAkH;IAClH,sBAAsB,EAAE,sBAAsB;CAC/C,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable selectors for
|
|
3
|
+
* {@link https://eui.elastic.co/docs/components/containers/modal/|EuiModal}
|
|
4
|
+
* and `EuiConfirmModal`. `*_SELECTOR` values are CSS.
|
|
5
|
+
*/
|
|
6
|
+
export declare const EuiModalSelectors: {
|
|
7
|
+
/** Root element carrying the consumer's `data-test-subj`. Matches `EuiConfirmModal` too, which renders `EuiModal` underneath. */
|
|
8
|
+
ROOT_SELECTOR: string;
|
|
9
|
+
/** The close button. No `data-test-subj`, only an i18n `aria-label`, so read by this stable class instead. */
|
|
10
|
+
CLOSE_BUTTON_SELECTOR: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Stable selectors for
|
|
10
|
+
* {@link https://eui.elastic.co/docs/components/containers/modal/|EuiModal}
|
|
11
|
+
* and `EuiConfirmModal`. `*_SELECTOR` values are CSS.
|
|
12
|
+
*/
|
|
13
|
+
export const EuiModalSelectors = {
|
|
14
|
+
/** Root element carrying the consumer's `data-test-subj`. Matches `EuiConfirmModal` too, which renders `EuiModal` underneath. */
|
|
15
|
+
ROOT_SELECTOR: '.euiModal',
|
|
16
|
+
/** The close button. No `data-test-subj`, only an i18n `aria-label`, so read by this stable class instead. */
|
|
17
|
+
CLOSE_BUTTON_SELECTOR: '.euiModal__closeIcon',
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=selectors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectors.js","sourceRoot":"","sources":["../../../../src/components/modal/selectors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,iIAAiI;IACjI,aAAa,EAAE,WAAW;IAE1B,8GAA8G;IAC9G,qBAAqB,EAAE,sBAAsB;CAC9C,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable selectors for
|
|
3
|
+
* {@link https://eui.elastic.co/docs/components/containers/popover/|EuiPopover}.
|
|
4
|
+
* `*_SELECTOR` values are CSS.
|
|
5
|
+
*/
|
|
6
|
+
export declare const EuiPopoverSelectors: {
|
|
7
|
+
/** `EuiPopover` sets this on a button-like toggle from mount, regardless of open state. */
|
|
8
|
+
TOGGLE_SELECTOR: string;
|
|
9
|
+
/** The portal panel, matched by the id the toggle's `aria-controls` points at. Present while open or closing. */
|
|
10
|
+
panelFor: (id: string) => string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Stable selectors for
|
|
10
|
+
* {@link https://eui.elastic.co/docs/components/containers/popover/|EuiPopover}.
|
|
11
|
+
* `*_SELECTOR` values are CSS.
|
|
12
|
+
*/
|
|
13
|
+
export const EuiPopoverSelectors = {
|
|
14
|
+
/** `EuiPopover` sets this on a button-like toggle from mount, regardless of open state. */
|
|
15
|
+
TOGGLE_SELECTOR: '[aria-expanded]',
|
|
16
|
+
/** The portal panel, matched by the id the toggle's `aria-controls` points at. Present while open or closing. */
|
|
17
|
+
panelFor: (id) => `[data-popover-panel][id="${id}"]`,
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=selectors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectors.js","sourceRoot":"","sources":["../../../../src/components/popover/selectors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,2FAA2F;IAC3F,eAAe,EAAE,iBAAiB;IAElC,iHAAiH;IACjH,QAAQ,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,4BAA4B,EAAE,IAAI;CAC7D,CAAC"}
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -7,4 +7,8 @@ export { EuiSelectableObject } from './playwright/components/selectable/object';
|
|
|
7
7
|
export { EuiDraggableObject } from './playwright/components/drag_and_drop/object';
|
|
8
8
|
export { EuiFilterButtonObject } from './playwright/components/filter_button/object';
|
|
9
9
|
export { EuiRangeObject } from './playwright/components/form/range/object';
|
|
10
|
+
export { EuiPopoverObject } from './playwright/components/popover/object';
|
|
11
|
+
export { EuiFlyoutObject } from './playwright/components/flyout/object';
|
|
12
|
+
export { EuiAccordionObject } from './playwright/components/accordion/object';
|
|
13
|
+
export { EuiModalObject } from './playwright/components/modal/object';
|
|
10
14
|
export { EuiBasicTableObject } from './playwright/components/basic_table/object';
|
package/lib/esm/index.js
CHANGED
|
@@ -14,5 +14,9 @@ export { EuiSelectableObject } from './playwright/components/selectable/object';
|
|
|
14
14
|
export { EuiDraggableObject } from './playwright/components/drag_and_drop/object';
|
|
15
15
|
export { EuiFilterButtonObject } from './playwright/components/filter_button/object';
|
|
16
16
|
export { EuiRangeObject } from './playwright/components/form/range/object';
|
|
17
|
+
export { EuiPopoverObject } from './playwright/components/popover/object';
|
|
18
|
+
export { EuiFlyoutObject } from './playwright/components/flyout/object';
|
|
19
|
+
export { EuiAccordionObject } from './playwright/components/accordion/object';
|
|
20
|
+
export { EuiModalObject } from './playwright/components/modal/object';
|
|
17
21
|
export { EuiBasicTableObject } from './playwright/components/basic_table/object';
|
|
18
22
|
//# sourceMappingURL=index.js.map
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAoB,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AACxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAoB,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AACxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
|
+
import { BaseObject, type ObjectScope } from '../../base_object';
|
|
3
|
+
/**
|
|
4
|
+
* Playwright Component Object for {@link
|
|
5
|
+
* https://eui.elastic.co/docs/components/containers/accordion/ EuiAccordion}.
|
|
6
|
+
*
|
|
7
|
+
* `testSubj` must be set on the `<EuiAccordion>` itself. See the package
|
|
8
|
+
* README for what this does not cover.
|
|
9
|
+
*/
|
|
10
|
+
export declare class EuiAccordionObject extends BaseObject {
|
|
11
|
+
constructor(scope: ObjectScope, testSubj: string);
|
|
12
|
+
/** The trigger button. Assert `aria-expanded` on it for open state, e.g. `toHaveAttribute('aria-expanded', 'true')`. */
|
|
13
|
+
get trigger(): Locator;
|
|
14
|
+
/** The children wrapper, scoped to this instance. */
|
|
15
|
+
get content(): Locator;
|
|
16
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
import { BaseObject } from '../../base_object';
|
|
9
|
+
import { EuiAccordionSelectors } from '../../../components/accordion/selectors';
|
|
10
|
+
/**
|
|
11
|
+
* Playwright Component Object for {@link
|
|
12
|
+
* https://eui.elastic.co/docs/components/containers/accordion/ EuiAccordion}.
|
|
13
|
+
*
|
|
14
|
+
* `testSubj` must be set on the `<EuiAccordion>` itself. See the package
|
|
15
|
+
* README for what this does not cover.
|
|
16
|
+
*/
|
|
17
|
+
export class EuiAccordionObject extends BaseObject {
|
|
18
|
+
constructor(scope, testSubj) {
|
|
19
|
+
super(scope, testSubj, EuiAccordionSelectors.ROOT_SELECTOR);
|
|
20
|
+
}
|
|
21
|
+
/** The trigger button. Assert `aria-expanded` on it for open state, e.g. `toHaveAttribute('aria-expanded', 'true')`. */
|
|
22
|
+
get trigger() {
|
|
23
|
+
return this.root.locator(EuiAccordionSelectors.TRIGGER_SELECTOR);
|
|
24
|
+
}
|
|
25
|
+
/** The children wrapper, scoped to this instance. */
|
|
26
|
+
get content() {
|
|
27
|
+
return this.root.locator(EuiAccordionSelectors.CONTENT_SELECTOR);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=object.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object.js","sourceRoot":"","sources":["../../../../../src/playwright/components/accordion/object.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,UAAU,EAAoB,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAEhF;;;;;;GAMG;AACH,MAAM,OAAO,kBAAmB,SAAQ,UAAU;IAChD,YAAY,KAAkB,EAAE,QAAgB;QAC9C,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAC9D,CAAC;IAED,wHAAwH;IACxH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;IACnE,CAAC;IAED,qDAAqD;IACrD,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;IACnE,CAAC;CACF"}
|
|
@@ -43,7 +43,8 @@ export declare class EuiComboBoxObject extends BaseObject {
|
|
|
43
43
|
* Clear all selected options. No-op if nothing is selected.
|
|
44
44
|
*
|
|
45
45
|
* Auto-detects the combo box configuration and uses the appropriate strategy:
|
|
46
|
-
* - Pills
|
|
46
|
+
* - Pills with a close button → {@link clickPillClearButtons}
|
|
47
|
+
* - Pills without a close button (`singleSelection`) → {@link clearPillWithoutCloseButton}
|
|
47
48
|
* - `asPlainText` with a confirmed input selection → {@link deleteSearchInput}
|
|
48
49
|
* - Otherwise → {@link deselectAllFromDropdown}
|
|
49
50
|
*
|
|
@@ -62,12 +63,18 @@ export declare class EuiComboBoxObject extends BaseObject {
|
|
|
62
63
|
*/
|
|
63
64
|
getSelectedOptions(): Promise<string[]>;
|
|
64
65
|
private hasPills;
|
|
66
|
+
private hasPillCloseButtons;
|
|
65
67
|
/**
|
|
66
68
|
* Clicks the `×` button on each selected pill individually.
|
|
67
|
-
* Works regardless of `isClearable` — pill close buttons are always present.
|
|
68
69
|
* No-op if no pills are rendered.
|
|
69
70
|
*/
|
|
70
71
|
private clickPillClearButtons;
|
|
72
|
+
/**
|
|
73
|
+
* `singleSelection` pills render without a close button, whatever
|
|
74
|
+
* `isClearable` is. Backspace on an empty search input removes the
|
|
75
|
+
* selection instead.
|
|
76
|
+
*/
|
|
77
|
+
private clearPillWithoutCloseButton;
|
|
71
78
|
/**
|
|
72
79
|
* Opens the dropdown and clicks each `aria-selected="true"` option to
|
|
73
80
|
* deselect it. Works for all `isClearable` and `singleSelection`
|
|
@@ -106,7 +106,8 @@ export class EuiComboBoxObject extends BaseObject {
|
|
|
106
106
|
* Clear all selected options. No-op if nothing is selected.
|
|
107
107
|
*
|
|
108
108
|
* Auto-detects the combo box configuration and uses the appropriate strategy:
|
|
109
|
-
* - Pills
|
|
109
|
+
* - Pills with a close button → {@link clickPillClearButtons}
|
|
110
|
+
* - Pills without a close button (`singleSelection`) → {@link clearPillWithoutCloseButton}
|
|
110
111
|
* - `asPlainText` with a confirmed input selection → {@link deleteSearchInput}
|
|
111
112
|
* - Otherwise → {@link deselectAllFromDropdown}
|
|
112
113
|
*
|
|
@@ -119,7 +120,12 @@ export class EuiComboBoxObject extends BaseObject {
|
|
|
119
120
|
return;
|
|
120
121
|
}
|
|
121
122
|
if (await this.hasPills()) {
|
|
122
|
-
await this.
|
|
123
|
+
if (await this.hasPillCloseButtons()) {
|
|
124
|
+
await this.clickPillClearButtons();
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
await this.clearPillWithoutCloseButton();
|
|
128
|
+
}
|
|
123
129
|
return;
|
|
124
130
|
}
|
|
125
131
|
if (await this.hasConfirmedInputSelection()) {
|
|
@@ -148,9 +154,11 @@ export class EuiComboBoxObject extends BaseObject {
|
|
|
148
154
|
async hasPills() {
|
|
149
155
|
return (await this.pills.count()) > 0;
|
|
150
156
|
}
|
|
157
|
+
async hasPillCloseButtons() {
|
|
158
|
+
return (await this.pills.first().locator('button').count()) > 0;
|
|
159
|
+
}
|
|
151
160
|
/**
|
|
152
161
|
* Clicks the `×` button on each selected pill individually.
|
|
153
|
-
* Works regardless of `isClearable` — pill close buttons are always present.
|
|
154
162
|
* No-op if no pills are rendered.
|
|
155
163
|
*/
|
|
156
164
|
async clickPillClearButtons() {
|
|
@@ -160,6 +168,18 @@ export class EuiComboBoxObject extends BaseObject {
|
|
|
160
168
|
await expect(this.pills).not.toHaveCount(countBefore);
|
|
161
169
|
}
|
|
162
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* `singleSelection` pills render without a close button, whatever
|
|
173
|
+
* `isClearable` is. Backspace on an empty search input removes the
|
|
174
|
+
* selection instead.
|
|
175
|
+
*/
|
|
176
|
+
async clearPillWithoutCloseButton() {
|
|
177
|
+
while (await this.hasPills()) {
|
|
178
|
+
const countBefore = await this.pills.count();
|
|
179
|
+
await this.searchInput.press('Backspace');
|
|
180
|
+
await expect(this.pills).not.toHaveCount(countBefore);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
163
183
|
/**
|
|
164
184
|
* Opens the dropdown and clicks each `aria-selected="true"` option to
|
|
165
185
|
* deselect it. Works for all `isClearable` and `singleSelection`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object.js","sourceRoot":"","sources":["../../../../../src/playwright/components/combo_box/object.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAoB,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAE/E;;;;;;;GAOG;AACH,MAAM,OAAO,iBAAkB,SAAQ,UAAU;IAC/C,YAAY,KAAkB,EAAE,QAAgB;QAC9C,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,oBAAoB,CAAC,aAAa,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,kBAAkB,CACtB,MAAgB,EAChB,EAAE,OAAO,GAAG,IAAK,KAA2B,EAAE;QAE9C,iCAAiC;QACjC,MAAM,YAAY,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;QAC1C,yEAAyE;QACzE,qEAAqE;QACrE,MAAM,YAAY,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC,IAAI,EAAE,CAAC;QAE9C,MAAM,aAAa,GAAG,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAEpE,0CAA0C;QAC1C,IACE,aAAa,CAAC,MAAM,KAAK,YAAY,CAAC,MAAM;YAC5C,aAAa,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,KAA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AAC;IAC5E,CAAC;IAED,IAAY,KAAK;QACf,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC;IAC/D,CAAC;IAEO,KAAK,CAAC,WAAW;QACvB,OAAO,CACL,CAAC,MAAM,IAAI,CAAC,IAAI;aACb,OAAO,CAAC,oBAAoB,CAAC,8BAA8B,CAAC;aAC5D,KAAK,EAAE,CAAC,GAAG,CAAC,CAChB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
|
+
import { BaseObject, type ObjectScope } from '../../base_object';
|
|
3
|
+
/**
|
|
4
|
+
* Playwright Component Object for {@link
|
|
5
|
+
* https://eui.elastic.co/docs/components/containers/flyout/ EuiFlyout}.
|
|
6
|
+
*
|
|
7
|
+
* `testSubj` must be set on the `<EuiFlyout>` itself. See the package README
|
|
8
|
+
* for what this does not cover.
|
|
9
|
+
*/
|
|
10
|
+
export declare class EuiFlyoutObject extends BaseObject {
|
|
11
|
+
constructor(scope: ObjectScope, testSubj: string);
|
|
12
|
+
/**
|
|
13
|
+
* This flyout's own close button, scoped to this instance. Absent with
|
|
14
|
+
* `hideCloseButton` or a rendered flyout menu.
|
|
15
|
+
*/
|
|
16
|
+
get closeButton(): Locator;
|
|
17
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
import { BaseObject } from '../../base_object';
|
|
9
|
+
import { EuiFlyoutSelectors } from '../../../components/flyout/selectors';
|
|
10
|
+
/**
|
|
11
|
+
* Playwright Component Object for {@link
|
|
12
|
+
* https://eui.elastic.co/docs/components/containers/flyout/ EuiFlyout}.
|
|
13
|
+
*
|
|
14
|
+
* `testSubj` must be set on the `<EuiFlyout>` itself. See the package README
|
|
15
|
+
* for what this does not cover.
|
|
16
|
+
*/
|
|
17
|
+
export class EuiFlyoutObject extends BaseObject {
|
|
18
|
+
constructor(scope, testSubj) {
|
|
19
|
+
super(scope, testSubj, EuiFlyoutSelectors.ROOT_SELECTOR);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* This flyout's own close button, scoped to this instance. Absent with
|
|
23
|
+
* `hideCloseButton` or a rendered flyout menu.
|
|
24
|
+
*/
|
|
25
|
+
get closeButton() {
|
|
26
|
+
return this.root.getByTestId(EuiFlyoutSelectors.CLOSE_BUTTON_TEST_SUBJ);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=object.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object.js","sourceRoot":"","sources":["../../../../../src/playwright/components/flyout/object.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,UAAU,EAAoB,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE1E;;;;;;GAMG;AACH,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAC7C,YAAY,KAAkB,EAAE,QAAgB;QAC9C,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAC3D,CAAC;IAED;;;OAGG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;IAC1E,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
|
+
import { BaseObject, type ObjectScope } from '../../base_object';
|
|
3
|
+
/**
|
|
4
|
+
* Playwright Component Object for {@link
|
|
5
|
+
* https://eui.elastic.co/docs/components/containers/modal/ EuiModal} and
|
|
6
|
+
* `EuiConfirmModal`, which renders `EuiModal` underneath.
|
|
7
|
+
*
|
|
8
|
+
* `testSubj` must be set on the `<EuiModal>`/`<EuiConfirmModal>` itself. See
|
|
9
|
+
* the package README for what this does not cover.
|
|
10
|
+
*/
|
|
11
|
+
export declare class EuiModalObject extends BaseObject {
|
|
12
|
+
constructor(scope: ObjectScope, testSubj: string);
|
|
13
|
+
/** This modal's own close button, scoped to this instance. */
|
|
14
|
+
get closeButton(): Locator;
|
|
15
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
import { BaseObject } from '../../base_object';
|
|
9
|
+
import { EuiModalSelectors } from '../../../components/modal/selectors';
|
|
10
|
+
/**
|
|
11
|
+
* Playwright Component Object for {@link
|
|
12
|
+
* https://eui.elastic.co/docs/components/containers/modal/ EuiModal} and
|
|
13
|
+
* `EuiConfirmModal`, which renders `EuiModal` underneath.
|
|
14
|
+
*
|
|
15
|
+
* `testSubj` must be set on the `<EuiModal>`/`<EuiConfirmModal>` itself. See
|
|
16
|
+
* the package README for what this does not cover.
|
|
17
|
+
*/
|
|
18
|
+
export class EuiModalObject extends BaseObject {
|
|
19
|
+
constructor(scope, testSubj) {
|
|
20
|
+
super(scope, testSubj, EuiModalSelectors.ROOT_SELECTOR);
|
|
21
|
+
}
|
|
22
|
+
/** This modal's own close button, scoped to this instance. */
|
|
23
|
+
get closeButton() {
|
|
24
|
+
return this.root.locator(EuiModalSelectors.CLOSE_BUTTON_SELECTOR);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=object.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object.js","sourceRoot":"","sources":["../../../../../src/playwright/components/modal/object.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,UAAU,EAAoB,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE;;;;;;;GAOG;AACH,MAAM,OAAO,cAAe,SAAQ,UAAU;IAC5C,YAAY,KAAkB,EAAE,QAAgB;QAC9C,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC;IAC1D,CAAC;IAED,8DAA8D;IAC9D,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,CAAC;IACpE,CAAC;CACF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BaseObject, type ObjectScope } from '../../base_object';
|
|
2
|
+
/**
|
|
3
|
+
* Playwright Component Object for {@link
|
|
4
|
+
* https://eui.elastic.co/docs/components/containers/popover/ EuiPopover}.
|
|
5
|
+
*
|
|
6
|
+
* `testSubj` must be set on the toggle button, not the panel. See the
|
|
7
|
+
* package README for the component-type guard and what this does not cover.
|
|
8
|
+
*/
|
|
9
|
+
export declare class EuiPopoverObject extends BaseObject {
|
|
10
|
+
constructor(scope: ObjectScope, testSubj: string);
|
|
11
|
+
/**
|
|
12
|
+
* Opens the popover and waits for the panel to be open. A no-op if it is
|
|
13
|
+
* already open.
|
|
14
|
+
*/
|
|
15
|
+
open(): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Closes the popover and waits for the panel to be removed. A no-op if it
|
|
18
|
+
* is already closed.
|
|
19
|
+
*/
|
|
20
|
+
close(): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* The panel the toggle's `aria-controls` points at. EUI sets that attribute
|
|
23
|
+
* synchronously with the open state, before the panel's own transition.
|
|
24
|
+
*/
|
|
25
|
+
private panel;
|
|
26
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
import { expect } from '@playwright/test';
|
|
9
|
+
import { BaseObject } from '../../base_object';
|
|
10
|
+
import { EuiPopoverSelectors } from '../../../components/popover/selectors';
|
|
11
|
+
/**
|
|
12
|
+
* Playwright Component Object for {@link
|
|
13
|
+
* https://eui.elastic.co/docs/components/containers/popover/ EuiPopover}.
|
|
14
|
+
*
|
|
15
|
+
* `testSubj` must be set on the toggle button, not the panel. See the
|
|
16
|
+
* package README for the component-type guard and what this does not cover.
|
|
17
|
+
*/
|
|
18
|
+
export class EuiPopoverObject extends BaseObject {
|
|
19
|
+
constructor(scope, testSubj) {
|
|
20
|
+
super(scope, testSubj, EuiPopoverSelectors.TOGGLE_SELECTOR);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Opens the popover and waits for the panel to be open. A no-op if it is
|
|
24
|
+
* already open.
|
|
25
|
+
*/
|
|
26
|
+
async open() {
|
|
27
|
+
if ((await this.root.getAttribute('aria-expanded')) === 'true') {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
await this.root.click();
|
|
31
|
+
const panel = await this.panel();
|
|
32
|
+
await panel.waitFor({ state: 'visible' });
|
|
33
|
+
await expect(panel).toHaveAttribute('data-popover-open', 'true');
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Closes the popover and waits for the panel to be removed. A no-op if it
|
|
37
|
+
* is already closed.
|
|
38
|
+
*/
|
|
39
|
+
async close() {
|
|
40
|
+
if ((await this.root.getAttribute('aria-expanded')) !== 'true') {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
// `aria-controls` is removed on close, so resolve the panel first.
|
|
44
|
+
const panel = await this.panel();
|
|
45
|
+
await this.root.click();
|
|
46
|
+
await panel.waitFor({ state: 'detached' });
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The panel the toggle's `aria-controls` points at. EUI sets that attribute
|
|
50
|
+
* synchronously with the open state, before the panel's own transition.
|
|
51
|
+
*/
|
|
52
|
+
async panel() {
|
|
53
|
+
await expect(this.root).toHaveAttribute('aria-controls', /.+/);
|
|
54
|
+
const id = (await this.root.getAttribute('aria-controls'));
|
|
55
|
+
return this.root.page().locator(EuiPopoverSelectors.panelFor(id));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=object.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object.js","sourceRoot":"","sources":["../../../../../src/playwright/components/popover/object.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAgB,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAE,UAAU,EAAoB,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,OAAO,gBAAiB,SAAQ,UAAU;IAC9C,YAAY,KAAkB,EAAE,QAAgB;QAC9C,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IAC9D,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,KAAK,MAAM,EAAE,CAAC;YAC/D,OAAO;QACT,CAAC;QACD,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QACxB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACjC,MAAM,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAC1C,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IACnE,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,KAAK,MAAM,EAAE,CAAC;YAC/D,OAAO;QACT,CAAC;QACD,mEAAmE;QACnE,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACjC,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QACxB,MAAM,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACK,KAAK,CAAC,KAAK;QACjB,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;QAC/D,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAW,CAAC;QACrE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IACpE,CAAC;CACF"}
|
package/lib/esm/storybook.d.ts
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Returns the Storybook iframe URL for a given story ID and optional args.
|
|
3
3
|
*
|
|
4
4
|
* @param id - The Storybook story ID (e.g. `'forms-euicombobox--playground'`)
|
|
5
|
-
* @param args - Optional semicolon-separated Storybook args string (e.g. `'data-test-subj:myCombo;singleSelection
|
|
5
|
+
* @param args - Optional semicolon-separated Storybook args string (e.g. `'data-test-subj:myCombo;singleSelection:!true'`)
|
|
6
6
|
*/
|
|
7
7
|
export declare const storyUrl: (id: string, args?: string) => string;
|
package/lib/esm/storybook.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Returns the Storybook iframe URL for a given story ID and optional args.
|
|
10
10
|
*
|
|
11
11
|
* @param id - The Storybook story ID (e.g. `'forms-euicombobox--playground'`)
|
|
12
|
-
* @param args - Optional semicolon-separated Storybook args string (e.g. `'data-test-subj:myCombo;singleSelection
|
|
12
|
+
* @param args - Optional semicolon-separated Storybook args string (e.g. `'data-test-subj:myCombo;singleSelection:!true'`)
|
|
13
13
|
*/
|
|
14
14
|
export const storyUrl = (id, args) => `/iframe.html?id=${id}&viewMode=story${args ? `&args=${args}` : ''}`;
|
|
15
15
|
//# sourceMappingURL=storybook.js.map
|
package/package.json
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# EuiAccordionObject
|
|
2
|
+
|
|
3
|
+
Playwright Component Object for [EuiAccordion](https://eui.elastic.co/docs/components/containers/accordion/).
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { EuiAccordionObject } from '@elastic/eui-test-helpers';
|
|
9
|
+
|
|
10
|
+
const accordion = new EuiAccordionObject(page, 'myAccordion');
|
|
11
|
+
await accordion.trigger.click();
|
|
12
|
+
await expect(accordion.trigger).toHaveAttribute('aria-expanded', 'true');
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Set `data-test-subj` on the `<EuiAccordion>` itself, which the component-type guard verifies.
|
|
16
|
+
|
|
17
|
+
## API
|
|
18
|
+
|
|
19
|
+
| Member | Description |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `trigger` | `Locator` for the trigger button, scoped to this instance. `aria-expanded` on it reflects open state synchronously, so a retrying assertion on it is all that's needed, no wait or poll. |
|
|
22
|
+
| `content` | `Locator` for the children wrapper, scoped to this instance. |
|
|
23
|
+
|
|
24
|
+
Both are read as direct children of the root, not a plain descendant search, so a nested `EuiAccordion` inside `content` never matches these instead of this instance's own trigger/content.
|
|
25
|
+
|
|
26
|
+
## Deliberately out of scope
|
|
27
|
+
|
|
28
|
+
- **Waiting for the open/close transition**: while closed, `content` is `height: 0` with `opacity: 0`, so Playwright already treats anything inside it as not visible and auto-waits. Only the brief opening transition (height and opacity animating together) is not fully covered by Playwright's actionability checks. No consumer has needed a wait for it yet, so none is exposed.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# EuiFlyoutObject
|
|
2
|
+
|
|
3
|
+
Playwright Component Object for [EuiFlyout](https://eui.elastic.co/docs/components/containers/flyout/).
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { EuiFlyoutObject } from '@elastic/eui-test-helpers';
|
|
9
|
+
|
|
10
|
+
const flyout = new EuiFlyoutObject(page, 'myFlyout');
|
|
11
|
+
await flyout.closeButton.click();
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Set `data-test-subj` on the `<EuiFlyout>` itself, which the component-type guard verifies.
|
|
15
|
+
|
|
16
|
+
## API
|
|
17
|
+
|
|
18
|
+
| Member | Description |
|
|
19
|
+
|---|---|
|
|
20
|
+
| `closeButton` | `Locator` for this flyout's own close button, scoped to this instance. Absent with `hideCloseButton` or a rendered flyout menu. |
|
|
21
|
+
|
|
22
|
+
## Deliberately out of scope
|
|
23
|
+
|
|
24
|
+
- **Multiple/nested flyouts on the page at once**: `closeButton` is already scoped to the instance you constructed, so this is naturally handled without extra API. Each flyout needs its own `data-test-subj`.
|
|
25
|
+
- **A Kibana-specific close button convention** (e.g. a `closeFlyoutButton` test-subj some consumers add on their own footer button instead of using EUI's close button): that is app-owned, not this component's concern.
|
|
26
|
+
- **The flyout menu** (`EuiFlyoutMenu`, including its own back button and pagination): a separate, newer subsystem with no evidenced consumer yet.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# EuiModalObject
|
|
2
|
+
|
|
3
|
+
Playwright Component Object for [EuiModal](https://eui.elastic.co/docs/components/containers/modal/) and `EuiConfirmModal`, which renders `EuiModal` underneath.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { EuiModalObject } from '@elastic/eui-test-helpers';
|
|
9
|
+
|
|
10
|
+
const modal = new EuiModalObject(page, 'myModal');
|
|
11
|
+
await modal.closeButton.click();
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Set `data-test-subj` on the `<EuiModal>`/`<EuiConfirmModal>` itself, which the component-type guard verifies.
|
|
15
|
+
|
|
16
|
+
## API
|
|
17
|
+
|
|
18
|
+
| Member | Description |
|
|
19
|
+
|---|---|
|
|
20
|
+
| `closeButton` | `Locator` for this modal's own close button, scoped to this instance. |
|
|
21
|
+
|
|
22
|
+
`closeButton` is read by its stable `euiModal__closeIcon` class rather than a `data-test-subj`, since EUI does not set one on that button, only an i18n `aria-label`.
|
|
23
|
+
|
|
24
|
+
## Deliberately out of scope
|
|
25
|
+
|
|
26
|
+
- **`EuiConfirmModal`'s cancel/confirm buttons**: already carry their own stable `data-test-subj`s (`confirmModalCancelButton`, `confirmModalConfirmButton`), no ambiguity to solve.
|
|
27
|
+
- **Waiting for open/close**: unlike `EuiPopover`, `EuiModal` has no closing state or transition. It is conditionally mounted by the consumer and unmounts immediately on close. Its entrance slide-in is covered by Playwright's actionability wait when clicking `closeButton`.
|