@cuppet/core 1.0.12 → 1.0.13
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
|
@@ -137,6 +137,12 @@ Make sure to install these in your project:
|
|
|
137
137
|
yarn install @cucumber/cucumber config
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
+
## Contributing
|
|
141
|
+
|
|
142
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details on how to submit pull requests and our development workflow.
|
|
143
|
+
|
|
144
|
+
For detailed development setup and publishing information, check out our [Development Guide](developmentGuide.md).
|
|
145
|
+
|
|
140
146
|
## License
|
|
141
147
|
|
|
142
148
|
ISC
|
|
@@ -54,9 +54,13 @@ Then('I should see the element with selector {string} in the DOM', async functio
|
|
|
54
54
|
const selector = this.commonFields[cssSelector] ?? cssSelector;
|
|
55
55
|
await utils.seeElement(this.page, selector, false);
|
|
56
56
|
});
|
|
57
|
+
Then('I should not see the element with selector {string} in the DOM', async function (cssSelector) {
|
|
58
|
+
const selector = this.commonFields[cssSelector] ?? cssSelector;
|
|
59
|
+
await utils.notSeeElement(this.page, selector, false);
|
|
60
|
+
});
|
|
57
61
|
Then('I should not see the element with selector {string}', async function (cssSelector) {
|
|
58
62
|
const selector = this.commonFields[cssSelector] ?? cssSelector;
|
|
59
|
-
await utils.notSeeElement(this.page, selector);
|
|
63
|
+
await utils.notSeeElement(this.page, selector, true);
|
|
60
64
|
});
|
|
61
65
|
Then('I wait for element {string} to disappear within {string} seconds', async function (cssSelector, time) {
|
|
62
66
|
const selector = this.commonFields[cssSelector] ?? cssSelector;
|
package/package.json
CHANGED
|
@@ -311,13 +311,15 @@ module.exports = {
|
|
|
311
311
|
},
|
|
312
312
|
|
|
313
313
|
/**
|
|
314
|
-
*
|
|
314
|
+
* Verify whether element is visible or not.
|
|
315
|
+
* Depending on VisibleInDOM boolean will check if it is only hidden or not present in the DOM.
|
|
315
316
|
* @param {Page} page
|
|
316
317
|
* @param selector
|
|
318
|
+
* @param VisibleInDOM
|
|
317
319
|
* @param time
|
|
318
320
|
* @returns {Promise<void>}
|
|
319
321
|
*/
|
|
320
|
-
notSeeElement: async function (page, selector, time = 5000) {
|
|
322
|
+
notSeeElement: async function (page, selector, VisibleInDOM, time = 5000) {
|
|
321
323
|
const options = {
|
|
322
324
|
hidden: true,
|
|
323
325
|
timeout: time, // Maximum time to wait in milliseconds (default: 30000)
|
|
@@ -328,8 +330,8 @@ module.exports = {
|
|
|
328
330
|
} catch {
|
|
329
331
|
throw new Error('Element is visible!');
|
|
330
332
|
}
|
|
331
|
-
if (isElementInPage) {
|
|
332
|
-
throw new Error(`${selector} is hidden but can be found in the page source!`);
|
|
333
|
+
if (!VisibleInDOM && isElementInPage) {
|
|
334
|
+
throw new Error(`${selector} is hidden but can be found in the page source (DOM)!`);
|
|
333
335
|
}
|
|
334
336
|
},
|
|
335
337
|
|