@onehat/ui 0.3.308 → 0.3.309
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/package.json
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* e.g. ['parent', 'child'] will be converted to '[data-testid="parent"] [data-testid="child"]'
|
|
8
8
|
* @return Cypress chainer
|
|
9
9
|
*/
|
|
10
|
-
export function getDomNode(selectors) {
|
|
11
|
-
return cy.get(getTestIdSelectors(selectors, true));
|
|
10
|
+
export function getDomNode(selectors, options = {}) {
|
|
11
|
+
return cy.get(getTestIdSelectors(selectors, true), options);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -18,8 +18,8 @@ export function getDomNode(selectors) {
|
|
|
18
18
|
* e.g. ['parent', 'child'] will be converted to '[data-testid="parent"] [data-testid="child"]'
|
|
19
19
|
* @return Cypress chainer
|
|
20
20
|
*/
|
|
21
|
-
export function getDomNodes(selectors) {
|
|
22
|
-
return cy.get(getTestIdSelectors(selectors));
|
|
21
|
+
export function getDomNodes(selectors, options = {}) {
|
|
22
|
+
return cy.get(getTestIdSelectors(selectors), options);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -128,10 +128,13 @@ export function setComboValue(selectors, value) {
|
|
|
128
128
|
getDomNode([...selectors, 'input']).then((field) => {
|
|
129
129
|
cy.get(field).clear({ force: true });
|
|
130
130
|
if (value) {
|
|
131
|
+
cy.intercept('GET', '**/get**').as('getWaiter'); // set up waiter
|
|
131
132
|
cy.get(field)
|
|
132
133
|
.type(value, { delay: 40, force: true }) // slow it down a bit, so React has time to re-render
|
|
133
|
-
.wait(
|
|
134
|
-
|
|
134
|
+
.wait('@getWaiter'); // allow dropdown to load
|
|
135
|
+
|
|
136
|
+
cy.get(field)
|
|
137
|
+
.wait(1000) // render
|
|
135
138
|
.type('{downarrow}')
|
|
136
139
|
.wait(250) // allow time for selection
|
|
137
140
|
|
|
@@ -166,12 +169,15 @@ export function setTagValue(selectors, value) {
|
|
|
166
169
|
if (!_.isEmpty(values)) {
|
|
167
170
|
_.each(values, (value) => {
|
|
168
171
|
const id = value.id;
|
|
172
|
+
cy.intercept('GET', '**/get**').as('getWaiter'); // set up waiter
|
|
169
173
|
cy.get(field)
|
|
170
174
|
.type('id:' + id, { delay: 40, force: true }) // slow it down a bit, so React has time to re-render
|
|
171
|
-
.wait(
|
|
172
|
-
|
|
175
|
+
.wait('@getWaiter'); // allow dropdown to load
|
|
176
|
+
|
|
177
|
+
cy.get(field)
|
|
178
|
+
.wait(1000) // render
|
|
173
179
|
.type('{downarrow}')
|
|
174
|
-
.wait(
|
|
180
|
+
.wait(500); // allow time for selection
|
|
175
181
|
});
|
|
176
182
|
|
|
177
183
|
// press trigger to hide dropdown
|