@elastic/eui-test-helpers 1.8.0 → 2.0.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 CHANGED
@@ -66,12 +66,20 @@ their own version at runtime.
66
66
 
67
67
  ### Selectors
68
68
 
69
- Each Component Object's stable selectors are exported too (`EuiComboBoxSelectors`,
70
- `EuiDataGridSelectors`, and so on). `*_SELECTOR` values are CSS class selectors,
71
- `*_TEST_SUBJ` values are `data-test-subj` names EUI sets itself. Prefer the
72
- Component Objects. The selectors exist for tooling, such as lint rules that flag
73
- hand-written EUI selectors in consumer tests, and for the rare scoping need an
74
- object does not cover yet.
69
+ Each Component Object's stable selectors are exported under one `selectors`
70
+ object, keyed by component (`selectors.comboBox`, `selectors.dataGrid`, and so
71
+ on). `*_SELECTOR` values are CSS class selectors, `*_TEST_SUBJ` values are
72
+ `data-test-subj` names EUI sets itself.
73
+
74
+ ```ts
75
+ import { selectors } from '@elastic/eui-test-helpers';
76
+
77
+ page.locator(selectors.basicTable.ROW_SELECTOR);
78
+ ```
79
+
80
+ Prefer the Component Objects. The selectors exist for tooling, such as lint
81
+ rules that flag hand-written EUI selectors in consumer tests, and for the rare
82
+ scoping need an object does not cover yet.
75
83
 
76
84
  ## Contributing
77
85
 
@@ -16,4 +16,4 @@ export { EuiBasicTableObject } from './playwright/components/basic_table/object'
16
16
  export { EuiColorPickerObject } from './playwright/components/color_picker/object';
17
17
  export { EuiTreeViewObject } from './playwright/components/tree_view/object';
18
18
  export { EuiToolTipObject } from './playwright/components/tool_tip/object';
19
- export * from './selectors';
19
+ export { selectors } from './selectors';
package/lib/cjs/index.js CHANGED
@@ -3,26 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- var _exportNames = {
7
- BaseObject: true,
8
- EuiComboBoxObject: true,
9
- EuiDataGridObject: true,
10
- EuiSuperSelectObject: true,
11
- EuiGlobalToastListObject: true,
12
- EuiSelectableObject: true,
13
- EuiDraggableObject: true,
14
- EuiFilterButtonObject: true,
15
- EuiRangeObject: true,
16
- EuiPopoverObject: true,
17
- EuiFlyoutObject: true,
18
- EuiAccordionObject: true,
19
- EuiContextMenuObject: true,
20
- EuiModalObject: true,
21
- EuiBasicTableObject: true,
22
- EuiColorPickerObject: true,
23
- EuiTreeViewObject: true,
24
- EuiToolTipObject: true
25
- };
26
6
  Object.defineProperty(exports, "BaseObject", {
27
7
  enumerable: true,
28
8
  get: function () {
@@ -131,6 +111,12 @@ Object.defineProperty(exports, "EuiTreeViewObject", {
131
111
  return _object16.EuiTreeViewObject;
132
112
  }
133
113
  });
114
+ Object.defineProperty(exports, "selectors", {
115
+ enumerable: true,
116
+ get: function () {
117
+ return _selectors.selectors;
118
+ }
119
+ });
134
120
  var _base_object = require("./playwright/base_object");
135
121
  var _object = require("./playwright/components/combo_box/object");
136
122
  var _object2 = require("./playwright/components/datagrid/object");
@@ -149,15 +135,4 @@ var _object14 = require("./playwright/components/basic_table/object");
149
135
  var _object15 = require("./playwright/components/color_picker/object");
150
136
  var _object16 = require("./playwright/components/tree_view/object");
151
137
  var _object17 = require("./playwright/components/tool_tip/object");
152
- var _selectors = require("./selectors");
153
- Object.keys(_selectors).forEach(function (key) {
154
- if (key === "default" || key === "__esModule") return;
155
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
156
- if (key in exports && exports[key] === _selectors[key]) return;
157
- Object.defineProperty(exports, key, {
158
- enumerable: true,
159
- get: function () {
160
- return _selectors[key];
161
- }
162
- });
163
- });
138
+ var _selectors = require("./selectors");
@@ -1,26 +1,103 @@
1
1
  /**
2
- * Stable selectors used by the Component Objects, one constant object per
3
- * component. `*_SELECTOR` values are CSS class selectors EUI renders,
4
- * `*_TEST_SUBJ` values are `data-test-subj` names EUI sets itself.
2
+ * Stable selectors of every Component Object, keyed by component.
3
+ * `*_SELECTOR` values are CSS classes, `*_TEST_SUBJ` values are `data-test-subj` names.
5
4
  *
6
- * Prefer the Component Objects. These are exported for tooling (for example
7
- * lint rules that flag hand-written EUI selectors in consumer tests) and for
8
- * the rare scoping need an object does not cover yet.
5
+ * @example page.locator(selectors.comboBox.PILL_SELECTOR)
9
6
  */
10
- export { EuiAccordionSelectors } from './components/accordion/selectors';
11
- export { EuiBasicTableSelectors } from './components/basic_table/selectors';
12
- export { EuiColorPickerSelectors } from './components/color_picker/selectors';
13
- export { EuiComboBoxSelectors } from './components/combo_box/selectors';
14
- export { EuiContextMenuSelectors } from './components/context_menu/selectors';
15
- export { EuiDataGridSelectors } from './components/datagrid/selectors';
16
- export { EuiDraggableSelectors } from './components/drag_and_drop/selectors';
17
- export { EuiFilterButtonSelectors } from './components/filter_button/selectors';
18
- export { EuiFlyoutSelectors } from './components/flyout/selectors';
19
- export { EuiRangeSelectors } from './components/form/range/selectors';
20
- export { EuiSuperSelectSelectors } from './components/form/super_select/selectors';
21
- export { EuiModalSelectors } from './components/modal/selectors';
22
- export { EuiPopoverSelectors } from './components/popover/selectors';
23
- export { EuiSelectableSelectors } from './components/selectable/selectors';
24
- export { EuiGlobalToastListSelectors } from './components/toast/selectors';
25
- export { EuiToolTipSelectors } from './components/tool_tip/selectors';
26
- export { EuiTreeViewSelectors } from './components/tree_view/selectors';
7
+ export declare const selectors: {
8
+ readonly accordion: {
9
+ ROOT_SELECTOR: string;
10
+ TRIGGER_SELECTOR: string;
11
+ CONTENT_SELECTOR: string;
12
+ };
13
+ readonly basicTable: {
14
+ ROOT_SELECTOR: string;
15
+ ROW_SELECTOR: string;
16
+ HEADER_CELL_SELECTOR_PREFIX: string;
17
+ };
18
+ readonly colorPicker: {
19
+ ANCHOR_SELECTOR: string;
20
+ PANEL_SELECTOR: string;
21
+ SWATCH_SELECTOR: string;
22
+ };
23
+ readonly comboBox: {
24
+ ROOT_SELECTOR: string;
25
+ INPUT_WRAPPER_TEST_SUBJ: string;
26
+ SEARCH_INPUT_TEST_SUBJ: string;
27
+ OPTIONS_LIST_TEST_SUBJ: string;
28
+ OPTIONS_LIST_TOGGLE_BUTTON_TEST_SUBJ: string;
29
+ CLEAR_BUTTON_TEST_SUBJ: string;
30
+ PLAIN_TEXT_INPUT_WRAP_SELECTOR: string;
31
+ PILL_SELECTOR: string;
32
+ optionFor: (testSubj: string) => string;
33
+ selectedOptionFor: (testSubj: string) => string;
34
+ optionsListFor: (testSubj: string) => string;
35
+ };
36
+ readonly contextMenu: {
37
+ ROOT_SELECTOR: string;
38
+ PANEL_SELECTOR: string;
39
+ ITEM_SELECTOR: string;
40
+ };
41
+ readonly dataGrid: {
42
+ ROOT_SELECTOR: string;
43
+ FULL_SCREEN_ROOT_SELECTOR: string;
44
+ ROW_SELECTOR: string;
45
+ ROW_CELL_SELECTOR: string;
46
+ HEADER_CELL_SELECTOR: string;
47
+ HEADER_ACTIONS_BUTTON_SELECTOR: string;
48
+ FULL_SCREEN_BUTTON_TEST_SUBJ: string;
49
+ headerActionsMenuFor: (columnId: string) => string;
50
+ cellFor: (columnId: string, rowIndex: number) => string;
51
+ columnCellsFor: (columnId: string) => string;
52
+ headerCellFor: (columnId: string) => string;
53
+ };
54
+ readonly draggable: {
55
+ HANDLE_SELECTOR: string;
56
+ ITEM_SELECTOR: string;
57
+ };
58
+ readonly filterButton: {
59
+ ROOT_SELECTOR: string;
60
+ NOTIFICATION_SELECTOR: string;
61
+ HAS_ACTIVE_FILTERS_CLASS: string;
62
+ IS_SELECTED_CLASS: string;
63
+ };
64
+ readonly flyout: {
65
+ ROOT_SELECTOR: string;
66
+ CLOSE_BUTTON_TEST_SUBJ: string;
67
+ };
68
+ readonly modal: {
69
+ ROOT_SELECTOR: string;
70
+ CLOSE_BUTTON_SELECTOR: string;
71
+ };
72
+ readonly popover: {
73
+ TOGGLE_SELECTOR: string;
74
+ panelFor: (id: string) => string;
75
+ };
76
+ readonly range: {
77
+ SLIDER_SELECTOR: string;
78
+ NUMBER_INPUT_SELECTOR: string;
79
+ };
80
+ readonly selectable: {
81
+ ROOT_SELECTOR: string;
82
+ SEARCH_SELECTOR: string;
83
+ };
84
+ readonly superSelect: {
85
+ ROOT_SELECTOR: string;
86
+ WRAPPER_SELECTOR: string;
87
+ LISTBOX_SELECTOR: string;
88
+ HIDDEN_INPUT_SELECTOR: string;
89
+ optionByValue: (value: string) => string;
90
+ };
91
+ readonly globalToastList: {
92
+ ROOT_SELECTOR: string;
93
+ TOAST_SELECTOR: string;
94
+ CLOSE_BUTTON_TEST_SUBJ: string;
95
+ };
96
+ readonly toolTip: {
97
+ ROOT_SELECTOR: string;
98
+ };
99
+ readonly treeView: {
100
+ ROOT_SELECTOR: string;
101
+ ITEM_SELECTOR: string;
102
+ };
103
+ };
@@ -3,108 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "EuiAccordionSelectors", {
7
- enumerable: true,
8
- get: function () {
9
- return _selectors.EuiAccordionSelectors;
10
- }
11
- });
12
- Object.defineProperty(exports, "EuiBasicTableSelectors", {
13
- enumerable: true,
14
- get: function () {
15
- return _selectors2.EuiBasicTableSelectors;
16
- }
17
- });
18
- Object.defineProperty(exports, "EuiColorPickerSelectors", {
19
- enumerable: true,
20
- get: function () {
21
- return _selectors3.EuiColorPickerSelectors;
22
- }
23
- });
24
- Object.defineProperty(exports, "EuiComboBoxSelectors", {
25
- enumerable: true,
26
- get: function () {
27
- return _selectors4.EuiComboBoxSelectors;
28
- }
29
- });
30
- Object.defineProperty(exports, "EuiContextMenuSelectors", {
31
- enumerable: true,
32
- get: function () {
33
- return _selectors5.EuiContextMenuSelectors;
34
- }
35
- });
36
- Object.defineProperty(exports, "EuiDataGridSelectors", {
37
- enumerable: true,
38
- get: function () {
39
- return _selectors6.EuiDataGridSelectors;
40
- }
41
- });
42
- Object.defineProperty(exports, "EuiDraggableSelectors", {
43
- enumerable: true,
44
- get: function () {
45
- return _selectors7.EuiDraggableSelectors;
46
- }
47
- });
48
- Object.defineProperty(exports, "EuiFilterButtonSelectors", {
49
- enumerable: true,
50
- get: function () {
51
- return _selectors8.EuiFilterButtonSelectors;
52
- }
53
- });
54
- Object.defineProperty(exports, "EuiFlyoutSelectors", {
55
- enumerable: true,
56
- get: function () {
57
- return _selectors9.EuiFlyoutSelectors;
58
- }
59
- });
60
- Object.defineProperty(exports, "EuiGlobalToastListSelectors", {
61
- enumerable: true,
62
- get: function () {
63
- return _selectors15.EuiGlobalToastListSelectors;
64
- }
65
- });
66
- Object.defineProperty(exports, "EuiModalSelectors", {
67
- enumerable: true,
68
- get: function () {
69
- return _selectors12.EuiModalSelectors;
70
- }
71
- });
72
- Object.defineProperty(exports, "EuiPopoverSelectors", {
73
- enumerable: true,
74
- get: function () {
75
- return _selectors13.EuiPopoverSelectors;
76
- }
77
- });
78
- Object.defineProperty(exports, "EuiRangeSelectors", {
79
- enumerable: true,
80
- get: function () {
81
- return _selectors10.EuiRangeSelectors;
82
- }
83
- });
84
- Object.defineProperty(exports, "EuiSelectableSelectors", {
85
- enumerable: true,
86
- get: function () {
87
- return _selectors14.EuiSelectableSelectors;
88
- }
89
- });
90
- Object.defineProperty(exports, "EuiSuperSelectSelectors", {
91
- enumerable: true,
92
- get: function () {
93
- return _selectors11.EuiSuperSelectSelectors;
94
- }
95
- });
96
- Object.defineProperty(exports, "EuiToolTipSelectors", {
97
- enumerable: true,
98
- get: function () {
99
- return _selectors16.EuiToolTipSelectors;
100
- }
101
- });
102
- Object.defineProperty(exports, "EuiTreeViewSelectors", {
103
- enumerable: true,
104
- get: function () {
105
- return _selectors17.EuiTreeViewSelectors;
106
- }
107
- });
6
+ exports.selectors = void 0;
108
7
  var _selectors = require("./components/accordion/selectors");
109
8
  var _selectors2 = require("./components/basic_table/selectors");
110
9
  var _selectors3 = require("./components/color_picker/selectors");
@@ -114,11 +13,44 @@ var _selectors6 = require("./components/datagrid/selectors");
114
13
  var _selectors7 = require("./components/drag_and_drop/selectors");
115
14
  var _selectors8 = require("./components/filter_button/selectors");
116
15
  var _selectors9 = require("./components/flyout/selectors");
117
- var _selectors10 = require("./components/form/range/selectors");
118
- var _selectors11 = require("./components/form/super_select/selectors");
119
- var _selectors12 = require("./components/modal/selectors");
120
- var _selectors13 = require("./components/popover/selectors");
121
- var _selectors14 = require("./components/selectable/selectors");
16
+ var _selectors10 = require("./components/modal/selectors");
17
+ var _selectors11 = require("./components/popover/selectors");
18
+ var _selectors12 = require("./components/form/range/selectors");
19
+ var _selectors13 = require("./components/selectable/selectors");
20
+ var _selectors14 = require("./components/form/super_select/selectors");
122
21
  var _selectors15 = require("./components/toast/selectors");
123
22
  var _selectors16 = require("./components/tool_tip/selectors");
124
- var _selectors17 = require("./components/tree_view/selectors");
23
+ var _selectors17 = require("./components/tree_view/selectors");
24
+ /*
25
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
26
+ * or more contributor license agreements. Licensed under the Elastic License
27
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
28
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
29
+ * Side Public License, v 1.
30
+ */
31
+
32
+ /**
33
+ * Stable selectors of every Component Object, keyed by component.
34
+ * `*_SELECTOR` values are CSS classes, `*_TEST_SUBJ` values are `data-test-subj` names.
35
+ *
36
+ * @example page.locator(selectors.comboBox.PILL_SELECTOR)
37
+ */
38
+ const selectors = exports.selectors = {
39
+ accordion: _selectors.EuiAccordionSelectors,
40
+ basicTable: _selectors2.EuiBasicTableSelectors,
41
+ colorPicker: _selectors3.EuiColorPickerSelectors,
42
+ comboBox: _selectors4.EuiComboBoxSelectors,
43
+ contextMenu: _selectors5.EuiContextMenuSelectors,
44
+ dataGrid: _selectors6.EuiDataGridSelectors,
45
+ draggable: _selectors7.EuiDraggableSelectors,
46
+ filterButton: _selectors8.EuiFilterButtonSelectors,
47
+ flyout: _selectors9.EuiFlyoutSelectors,
48
+ modal: _selectors10.EuiModalSelectors,
49
+ popover: _selectors11.EuiPopoverSelectors,
50
+ range: _selectors12.EuiRangeSelectors,
51
+ selectable: _selectors13.EuiSelectableSelectors,
52
+ superSelect: _selectors14.EuiSuperSelectSelectors,
53
+ globalToastList: _selectors15.EuiGlobalToastListSelectors,
54
+ toolTip: _selectors16.EuiToolTipSelectors,
55
+ treeView: _selectors17.EuiTreeViewSelectors
56
+ };
@@ -16,4 +16,4 @@ export { EuiBasicTableObject } from './playwright/components/basic_table/object'
16
16
  export { EuiColorPickerObject } from './playwright/components/color_picker/object';
17
17
  export { EuiTreeViewObject } from './playwright/components/tree_view/object';
18
18
  export { EuiToolTipObject } from './playwright/components/tool_tip/object';
19
- export * from './selectors';
19
+ export { selectors } from './selectors';
package/lib/esm/index.js CHANGED
@@ -23,5 +23,5 @@ export { EuiBasicTableObject } from './playwright/components/basic_table/object'
23
23
  export { EuiColorPickerObject } from './playwright/components/color_picker/object';
24
24
  export { EuiTreeViewObject } from './playwright/components/tree_view/object';
25
25
  export { EuiToolTipObject } from './playwright/components/tool_tip/object';
26
- export * from './selectors';
26
+ export { selectors } from './selectors';
27
27
  //# sourceMappingURL=index.js.map
@@ -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,gBAAgB,EAAE,MAAM,w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AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAE3E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
@@ -1,26 +1,103 @@
1
1
  /**
2
- * Stable selectors used by the Component Objects, one constant object per
3
- * component. `*_SELECTOR` values are CSS class selectors EUI renders,
4
- * `*_TEST_SUBJ` values are `data-test-subj` names EUI sets itself.
2
+ * Stable selectors of every Component Object, keyed by component.
3
+ * `*_SELECTOR` values are CSS classes, `*_TEST_SUBJ` values are `data-test-subj` names.
5
4
  *
6
- * Prefer the Component Objects. These are exported for tooling (for example
7
- * lint rules that flag hand-written EUI selectors in consumer tests) and for
8
- * the rare scoping need an object does not cover yet.
5
+ * @example page.locator(selectors.comboBox.PILL_SELECTOR)
9
6
  */
10
- export { EuiAccordionSelectors } from './components/accordion/selectors';
11
- export { EuiBasicTableSelectors } from './components/basic_table/selectors';
12
- export { EuiColorPickerSelectors } from './components/color_picker/selectors';
13
- export { EuiComboBoxSelectors } from './components/combo_box/selectors';
14
- export { EuiContextMenuSelectors } from './components/context_menu/selectors';
15
- export { EuiDataGridSelectors } from './components/datagrid/selectors';
16
- export { EuiDraggableSelectors } from './components/drag_and_drop/selectors';
17
- export { EuiFilterButtonSelectors } from './components/filter_button/selectors';
18
- export { EuiFlyoutSelectors } from './components/flyout/selectors';
19
- export { EuiRangeSelectors } from './components/form/range/selectors';
20
- export { EuiSuperSelectSelectors } from './components/form/super_select/selectors';
21
- export { EuiModalSelectors } from './components/modal/selectors';
22
- export { EuiPopoverSelectors } from './components/popover/selectors';
23
- export { EuiSelectableSelectors } from './components/selectable/selectors';
24
- export { EuiGlobalToastListSelectors } from './components/toast/selectors';
25
- export { EuiToolTipSelectors } from './components/tool_tip/selectors';
26
- export { EuiTreeViewSelectors } from './components/tree_view/selectors';
7
+ export declare const selectors: {
8
+ readonly accordion: {
9
+ ROOT_SELECTOR: string;
10
+ TRIGGER_SELECTOR: string;
11
+ CONTENT_SELECTOR: string;
12
+ };
13
+ readonly basicTable: {
14
+ ROOT_SELECTOR: string;
15
+ ROW_SELECTOR: string;
16
+ HEADER_CELL_SELECTOR_PREFIX: string;
17
+ };
18
+ readonly colorPicker: {
19
+ ANCHOR_SELECTOR: string;
20
+ PANEL_SELECTOR: string;
21
+ SWATCH_SELECTOR: string;
22
+ };
23
+ readonly comboBox: {
24
+ ROOT_SELECTOR: string;
25
+ INPUT_WRAPPER_TEST_SUBJ: string;
26
+ SEARCH_INPUT_TEST_SUBJ: string;
27
+ OPTIONS_LIST_TEST_SUBJ: string;
28
+ OPTIONS_LIST_TOGGLE_BUTTON_TEST_SUBJ: string;
29
+ CLEAR_BUTTON_TEST_SUBJ: string;
30
+ PLAIN_TEXT_INPUT_WRAP_SELECTOR: string;
31
+ PILL_SELECTOR: string;
32
+ optionFor: (testSubj: string) => string;
33
+ selectedOptionFor: (testSubj: string) => string;
34
+ optionsListFor: (testSubj: string) => string;
35
+ };
36
+ readonly contextMenu: {
37
+ ROOT_SELECTOR: string;
38
+ PANEL_SELECTOR: string;
39
+ ITEM_SELECTOR: string;
40
+ };
41
+ readonly dataGrid: {
42
+ ROOT_SELECTOR: string;
43
+ FULL_SCREEN_ROOT_SELECTOR: string;
44
+ ROW_SELECTOR: string;
45
+ ROW_CELL_SELECTOR: string;
46
+ HEADER_CELL_SELECTOR: string;
47
+ HEADER_ACTIONS_BUTTON_SELECTOR: string;
48
+ FULL_SCREEN_BUTTON_TEST_SUBJ: string;
49
+ headerActionsMenuFor: (columnId: string) => string;
50
+ cellFor: (columnId: string, rowIndex: number) => string;
51
+ columnCellsFor: (columnId: string) => string;
52
+ headerCellFor: (columnId: string) => string;
53
+ };
54
+ readonly draggable: {
55
+ HANDLE_SELECTOR: string;
56
+ ITEM_SELECTOR: string;
57
+ };
58
+ readonly filterButton: {
59
+ ROOT_SELECTOR: string;
60
+ NOTIFICATION_SELECTOR: string;
61
+ HAS_ACTIVE_FILTERS_CLASS: string;
62
+ IS_SELECTED_CLASS: string;
63
+ };
64
+ readonly flyout: {
65
+ ROOT_SELECTOR: string;
66
+ CLOSE_BUTTON_TEST_SUBJ: string;
67
+ };
68
+ readonly modal: {
69
+ ROOT_SELECTOR: string;
70
+ CLOSE_BUTTON_SELECTOR: string;
71
+ };
72
+ readonly popover: {
73
+ TOGGLE_SELECTOR: string;
74
+ panelFor: (id: string) => string;
75
+ };
76
+ readonly range: {
77
+ SLIDER_SELECTOR: string;
78
+ NUMBER_INPUT_SELECTOR: string;
79
+ };
80
+ readonly selectable: {
81
+ ROOT_SELECTOR: string;
82
+ SEARCH_SELECTOR: string;
83
+ };
84
+ readonly superSelect: {
85
+ ROOT_SELECTOR: string;
86
+ WRAPPER_SELECTOR: string;
87
+ LISTBOX_SELECTOR: string;
88
+ HIDDEN_INPUT_SELECTOR: string;
89
+ optionByValue: (value: string) => string;
90
+ };
91
+ readonly globalToastList: {
92
+ ROOT_SELECTOR: string;
93
+ TOAST_SELECTOR: string;
94
+ CLOSE_BUTTON_TEST_SUBJ: string;
95
+ };
96
+ readonly toolTip: {
97
+ ROOT_SELECTOR: string;
98
+ };
99
+ readonly treeView: {
100
+ ROOT_SELECTOR: string;
101
+ ITEM_SELECTOR: string;
102
+ };
103
+ };
@@ -5,30 +5,46 @@
5
5
  * in compliance with, at your election, the Elastic License 2.0 or the Server
6
6
  * Side Public License, v 1.
7
7
  */
8
+ import { EuiAccordionSelectors } from './components/accordion/selectors';
9
+ import { EuiBasicTableSelectors } from './components/basic_table/selectors';
10
+ import { EuiColorPickerSelectors } from './components/color_picker/selectors';
11
+ import { EuiComboBoxSelectors } from './components/combo_box/selectors';
12
+ import { EuiContextMenuSelectors } from './components/context_menu/selectors';
13
+ import { EuiDataGridSelectors } from './components/datagrid/selectors';
14
+ import { EuiDraggableSelectors } from './components/drag_and_drop/selectors';
15
+ import { EuiFilterButtonSelectors } from './components/filter_button/selectors';
16
+ import { EuiFlyoutSelectors } from './components/flyout/selectors';
17
+ import { EuiModalSelectors } from './components/modal/selectors';
18
+ import { EuiPopoverSelectors } from './components/popover/selectors';
19
+ import { EuiRangeSelectors } from './components/form/range/selectors';
20
+ import { EuiSelectableSelectors } from './components/selectable/selectors';
21
+ import { EuiSuperSelectSelectors } from './components/form/super_select/selectors';
22
+ import { EuiGlobalToastListSelectors } from './components/toast/selectors';
23
+ import { EuiToolTipSelectors } from './components/tool_tip/selectors';
24
+ import { EuiTreeViewSelectors } from './components/tree_view/selectors';
8
25
  /**
9
- * Stable selectors used by the Component Objects, one constant object per
10
- * component. `*_SELECTOR` values are CSS class selectors EUI renders,
11
- * `*_TEST_SUBJ` values are `data-test-subj` names EUI sets itself.
26
+ * Stable selectors of every Component Object, keyed by component.
27
+ * `*_SELECTOR` values are CSS classes, `*_TEST_SUBJ` values are `data-test-subj` names.
12
28
  *
13
- * Prefer the Component Objects. These are exported for tooling (for example
14
- * lint rules that flag hand-written EUI selectors in consumer tests) and for
15
- * the rare scoping need an object does not cover yet.
29
+ * @example page.locator(selectors.comboBox.PILL_SELECTOR)
16
30
  */
17
- export { EuiAccordionSelectors } from './components/accordion/selectors';
18
- export { EuiBasicTableSelectors } from './components/basic_table/selectors';
19
- export { EuiColorPickerSelectors } from './components/color_picker/selectors';
20
- export { EuiComboBoxSelectors } from './components/combo_box/selectors';
21
- export { EuiContextMenuSelectors } from './components/context_menu/selectors';
22
- export { EuiDataGridSelectors } from './components/datagrid/selectors';
23
- export { EuiDraggableSelectors } from './components/drag_and_drop/selectors';
24
- export { EuiFilterButtonSelectors } from './components/filter_button/selectors';
25
- export { EuiFlyoutSelectors } from './components/flyout/selectors';
26
- export { EuiRangeSelectors } from './components/form/range/selectors';
27
- export { EuiSuperSelectSelectors } from './components/form/super_select/selectors';
28
- export { EuiModalSelectors } from './components/modal/selectors';
29
- export { EuiPopoverSelectors } from './components/popover/selectors';
30
- export { EuiSelectableSelectors } from './components/selectable/selectors';
31
- export { EuiGlobalToastListSelectors } from './components/toast/selectors';
32
- export { EuiToolTipSelectors } from './components/tool_tip/selectors';
33
- export { EuiTreeViewSelectors } from './components/tree_view/selectors';
31
+ export const selectors = {
32
+ accordion: EuiAccordionSelectors,
33
+ basicTable: EuiBasicTableSelectors,
34
+ colorPicker: EuiColorPickerSelectors,
35
+ comboBox: EuiComboBoxSelectors,
36
+ contextMenu: EuiContextMenuSelectors,
37
+ dataGrid: EuiDataGridSelectors,
38
+ draggable: EuiDraggableSelectors,
39
+ filterButton: EuiFilterButtonSelectors,
40
+ flyout: EuiFlyoutSelectors,
41
+ modal: EuiModalSelectors,
42
+ popover: EuiPopoverSelectors,
43
+ range: EuiRangeSelectors,
44
+ selectable: EuiSelectableSelectors,
45
+ superSelect: EuiSuperSelectSelectors,
46
+ globalToastList: EuiGlobalToastListSelectors,
47
+ toolTip: EuiToolTipSelectors,
48
+ treeView: EuiTreeViewSelectors,
49
+ };
34
50
  //# sourceMappingURL=selectors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"selectors.js","sourceRoot":"","sources":["../../src/selectors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;GAQG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,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E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,SAAS,EAAE,qBAAqB;IAChC,UAAU,EAAE,sBAAsB;IAClC,WAAW,EAAE,uBAAuB;IACpC,QAAQ,EAAE,oBAAoB;IAC9B,WAAW,EAAE,uBAAuB;IACpC,QAAQ,EAAE,oBAAoB;IAC9B,SAAS,EAAE,qBAAqB;IAChC,YAAY,EAAE,wBAAwB;IACtC,MAAM,EAAE,kBAAkB;IAC1B,KAAK,EAAE,iBAAiB;IACxB,OAAO,EAAE,mBAAmB;IAC5B,KAAK,EAAE,iBAAiB;IACxB,UAAU,EAAE,sBAAsB;IAClC,WAAW,EAAE,uBAAuB;IACpC,eAAe,EAAE,2BAA2B;IAC5C,OAAO,EAAE,mBAAmB;IAC5B,QAAQ,EAAE,oBAAoB;CACtB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elastic/eui-test-helpers",
3
- "version": "1.8.0",
3
+ "version": "2.0.0",
4
4
  "description": "A library of EUI test helpers for RTL, Cypress and Scout",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "repository": {