@elastic/eui-test-helpers 2.2.0 → 2.3.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 +3 -0
- package/lib/cjs/components/card/selectors.d.ts +15 -0
- package/lib/cjs/components/card/selectors.js +29 -0
- package/lib/cjs/components/markdown_editor/selectors.d.ts +17 -0
- package/lib/cjs/components/markdown_editor/selectors.js +31 -0
- package/lib/cjs/components/tabs/selectors.d.ts +17 -0
- package/lib/cjs/components/tabs/selectors.js +31 -0
- package/lib/cjs/index.d.ts +3 -0
- package/lib/cjs/index.js +33 -12
- package/lib/cjs/playwright/components/card/object.d.ts +23 -0
- package/lib/cjs/playwright/components/card/object.js +69 -0
- package/lib/cjs/playwright/components/markdown_editor/object.d.ts +24 -0
- package/lib/cjs/playwright/components/markdown_editor/object.js +70 -0
- package/lib/cjs/playwright/components/tabs/object.d.ts +31 -0
- package/lib/cjs/playwright/components/tabs/object.js +76 -0
- package/lib/cjs/selectors.d.ts +20 -0
- package/lib/cjs/selectors.js +46 -40
- package/lib/esm/components/card/selectors.d.ts +15 -0
- package/lib/esm/components/card/selectors.js +23 -0
- package/lib/esm/components/card/selectors.js.map +1 -0
- package/lib/esm/components/markdown_editor/selectors.d.ts +17 -0
- package/lib/esm/components/markdown_editor/selectors.js +25 -0
- package/lib/esm/components/markdown_editor/selectors.js.map +1 -0
- package/lib/esm/components/tabs/selectors.d.ts +17 -0
- package/lib/esm/components/tabs/selectors.js +25 -0
- package/lib/esm/components/tabs/selectors.js.map +1 -0
- package/lib/esm/index.d.ts +3 -0
- package/lib/esm/index.js +3 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/playwright/components/card/object.d.ts +23 -0
- package/lib/esm/playwright/components/card/object.js +54 -0
- package/lib/esm/playwright/components/card/object.js.map +1 -0
- package/lib/esm/playwright/components/markdown_editor/object.d.ts +24 -0
- package/lib/esm/playwright/components/markdown_editor/object.js +57 -0
- package/lib/esm/playwright/components/markdown_editor/object.js.map +1 -0
- package/lib/esm/playwright/components/tabs/object.d.ts +31 -0
- package/lib/esm/playwright/components/tabs/object.js +70 -0
- package/lib/esm/playwright/components/tabs/object.js.map +1 -0
- package/lib/esm/selectors.d.ts +20 -0
- package/lib/esm/selectors.js +6 -0
- package/lib/esm/selectors.js.map +1 -1
- package/package.json +1 -1
- package/src/components/card/README.md +30 -0
- package/src/components/markdown_editor/README.md +30 -0
- package/src/components/tabs/README.md +29 -0
package/lib/esm/selectors.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import { EuiAccordionSelectors } from './components/accordion/selectors';
|
|
9
9
|
import { EuiBasicTableSelectors } from './components/basic_table/selectors';
|
|
10
10
|
import { EuiCallOutSelectors } from './components/call_out/selectors';
|
|
11
|
+
import { EuiCardSelectors } from './components/card/selectors';
|
|
11
12
|
import { EuiColorPickerSelectors } from './components/color_picker/selectors';
|
|
12
13
|
import { EuiComboBoxSelectors } from './components/combo_box/selectors';
|
|
13
14
|
import { EuiContextMenuSelectors } from './components/context_menu/selectors';
|
|
@@ -16,6 +17,7 @@ import { EuiDraggableSelectors } from './components/drag_and_drop/selectors';
|
|
|
16
17
|
import { EuiFieldSearchSelectors } from './components/form/field_search/selectors';
|
|
17
18
|
import { EuiFilterButtonSelectors } from './components/filter_button/selectors';
|
|
18
19
|
import { EuiFlyoutSelectors } from './components/flyout/selectors';
|
|
20
|
+
import { EuiMarkdownEditorSelectors } from './components/markdown_editor/selectors';
|
|
19
21
|
import { EuiModalSelectors } from './components/modal/selectors';
|
|
20
22
|
import { EuiPaginationSelectors } from './components/pagination/selectors';
|
|
21
23
|
import { EuiPopoverSelectors } from './components/popover/selectors';
|
|
@@ -25,6 +27,7 @@ import { EuiSelectableSelectors } from './components/selectable/selectors';
|
|
|
25
27
|
import { EuiSideNavSelectors } from './components/side_nav/selectors';
|
|
26
28
|
import { EuiSuperSelectSelectors } from './components/form/super_select/selectors';
|
|
27
29
|
import { EuiTableSelectors } from './components/table/selectors';
|
|
30
|
+
import { EuiTabsSelectors } from './components/tabs/selectors';
|
|
28
31
|
import { EuiGlobalToastListSelectors } from './components/toast/selectors';
|
|
29
32
|
import { EuiToolTipSelectors } from './components/tool_tip/selectors';
|
|
30
33
|
import { EuiTreeViewSelectors } from './components/tree_view/selectors';
|
|
@@ -38,6 +41,7 @@ export const selectors = {
|
|
|
38
41
|
accordion: EuiAccordionSelectors,
|
|
39
42
|
basicTable: EuiBasicTableSelectors,
|
|
40
43
|
callOut: EuiCallOutSelectors,
|
|
44
|
+
card: EuiCardSelectors,
|
|
41
45
|
colorPicker: EuiColorPickerSelectors,
|
|
42
46
|
comboBox: EuiComboBoxSelectors,
|
|
43
47
|
contextMenu: EuiContextMenuSelectors,
|
|
@@ -46,6 +50,7 @@ export const selectors = {
|
|
|
46
50
|
fieldSearch: EuiFieldSearchSelectors,
|
|
47
51
|
filterButton: EuiFilterButtonSelectors,
|
|
48
52
|
flyout: EuiFlyoutSelectors,
|
|
53
|
+
markdownEditor: EuiMarkdownEditorSelectors,
|
|
49
54
|
modal: EuiModalSelectors,
|
|
50
55
|
pagination: EuiPaginationSelectors,
|
|
51
56
|
popover: EuiPopoverSelectors,
|
|
@@ -55,6 +60,7 @@ export const selectors = {
|
|
|
55
60
|
sideNav: EuiSideNavSelectors,
|
|
56
61
|
superSelect: EuiSuperSelectSelectors,
|
|
57
62
|
table: EuiTableSelectors,
|
|
63
|
+
tabs: EuiTabsSelectors,
|
|
58
64
|
globalToastList: EuiGlobalToastListSelectors,
|
|
59
65
|
toolTip: EuiToolTipSelectors,
|
|
60
66
|
treeView: EuiTreeViewSelectors,
|
package/lib/esm/selectors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.js","sourceRoot":"","sources":["../../src/selectors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,sBA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;IAC1B,cAAc,EAAE,0BAA0B;IAC1C,KAAK,EAAE,iBAAiB;IACxB,UAAU,EAAE,sBAAsB;IAClC,OAAO,EAAE,mBAAmB;IAC5B,KAAK,EAAE,iBAAiB;IACxB,SAAS,EAAE,qBAAqB;IAChC,UAAU,EAAE,sBAAsB;IAClC,OAAO,EAAE,mBAAmB;IAC5B,WAAW,EAAE,uBAAuB;IACpC,KAAK,EAAE,iBAAiB;IACxB,IAAI,EAAE,gBAAgB;IACtB,eAAe,EAAE,2BAA2B;IAC5C,OAAO,EAAE,mBAAmB;IAC5B,QAAQ,EAAE,oBAAoB;CACtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# EuiCardObject
|
|
2
|
+
|
|
3
|
+
Playwright Component Object for [EuiCard](https://eui.elastic.co/docs/components/display/card/).
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { EuiCardObject } from '@elastic/eui-test-helpers';
|
|
9
|
+
|
|
10
|
+
const card = new EuiCardObject(page, 'myCard');
|
|
11
|
+
expect(await card.getTitle()).toBe('Logs');
|
|
12
|
+
await card.click();
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Set `data-test-subj` on `<EuiCard>`. EUI spreads it onto the panel, which the component-type guard verifies.
|
|
16
|
+
|
|
17
|
+
## API
|
|
18
|
+
|
|
19
|
+
| Member | Description |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `selectButton` | `Locator` for the `selectable` toggle button, absent on plain cards. |
|
|
22
|
+
| `getTitle()` | The title text. |
|
|
23
|
+
| `getDescription()` | The description text, or `null` when the card has none. |
|
|
24
|
+
| `click()` | Click the card, which follows `href` or fires `onClick`. |
|
|
25
|
+
| `isSelected()` | Whether the `selectable` toggle is checked. |
|
|
26
|
+
| `toggleSelected()` | Click the `selectable` toggle and wait for it to flip. |
|
|
27
|
+
|
|
28
|
+
## Deliberately excluded
|
|
29
|
+
|
|
30
|
+
`children`, `footer`, `betaBadgeProps` and `icon`. They are consumer content, so assert on them through `locator`. `EuiCheckableCard` is a different component built on a radio or checkbox.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# EuiMarkdownEditorObject
|
|
2
|
+
|
|
3
|
+
Playwright Component Object for [EuiMarkdownEditor](https://eui.elastic.co/docs/components/editors-and-syntax/markdown-editor/).
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { EuiMarkdownEditorObject } from '@elastic/eui-test-helpers';
|
|
9
|
+
|
|
10
|
+
const editor = new EuiMarkdownEditorObject(page, 'myEditor');
|
|
11
|
+
await editor.setValue('# Hello');
|
|
12
|
+
expect(await editor.getValue()).toBe('# Hello');
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Set `data-test-subj` on `<EuiMarkdownEditor>`. EUI spreads it onto the wrapper, which the component-type guard verifies.
|
|
16
|
+
|
|
17
|
+
## API
|
|
18
|
+
|
|
19
|
+
| Member | Description |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `textArea` | `Locator` for the `<textarea>` holding the markdown source. |
|
|
22
|
+
| `preview` | `Locator` for the rendered markdown, only in the DOM while previewing. |
|
|
23
|
+
| `setValue(text)` | Replace the markdown source. Switches back to editing first if needed. |
|
|
24
|
+
| `getValue()` | The current markdown source. |
|
|
25
|
+
| `isPreviewing()` | Whether the rendered preview is shown instead of the textarea. |
|
|
26
|
+
| `togglePreview()` | Switch between the textarea and the rendered preview. |
|
|
27
|
+
|
|
28
|
+
## Deliberately excluded
|
|
29
|
+
|
|
30
|
+
The formatting toolbar buttons and the drop zone. They are consumer facing (`toolbarProps`, `uiPlugins`, `dropHandlers`), so drive them with `locator` and the `euiMarkdownEditorToolbarButton*` test subjects EUI sets.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# EuiTabsObject
|
|
2
|
+
|
|
3
|
+
Playwright Component Object for [EuiTabs](https://eui.elastic.co/docs/components/navigation/tabs/). Also covers `EuiTabbedContent`, which renders an `EuiTabs` as the first child of the element carrying your `data-test-subj`.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { EuiTabsObject } from '@elastic/eui-test-helpers';
|
|
9
|
+
|
|
10
|
+
const tabs = new EuiTabsObject(page, 'myTabs');
|
|
11
|
+
await tabs.select('Documents');
|
|
12
|
+
expect(await tabs.getSelected()).toBe('Documents');
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Set `data-test-subj` on `<EuiTabs>` or `<EuiTabbedContent>`. Tabs are addressed by their exact label.
|
|
16
|
+
|
|
17
|
+
## API
|
|
18
|
+
|
|
19
|
+
| Member | Description |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `tabs` | `Locator` for all tabs, in order. |
|
|
22
|
+
| `getTabs()` | The labels of all tabs, in order. |
|
|
23
|
+
| `tab(label)` | `Locator` for the tab with exactly this label. Matches the label span, so `prepend` and `append` content does not interfere. |
|
|
24
|
+
| `select(label)` | Click the tab and wait for it to become selected. |
|
|
25
|
+
| `getSelected()` | The label of the selected tab, or `null`. |
|
|
26
|
+
|
|
27
|
+
## Deliberately excluded
|
|
28
|
+
|
|
29
|
+
Tab panels. `EuiTabbedContent` renders one `role="tabpanel"` for the selected tab, and bare `EuiTabs` consumers render content themselves, so assert on that content directly.
|