You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JavaScript browser automation framework using official [selenium-webdriver](http://seleniumhq.github.io/selenium/docs/api/javascript/"view webdriver js documentation") and [cucumber-js](https://github.com/cucumber/cucumber-js"view cucumber js documentation").
4
4
@@ -12,6 +12,7 @@ JavaScript browser automation framework using official [selenium-webdriver](http
12
12
*[Step definitions](#step-definitions)
13
13
*[Page objects](#page-objects)
14
14
*[Shared objects](#shared-objects)
15
+
*[Helpers](#helpers)
15
16
*[Visual Comparison](#visual-comparison)
16
17
*[Before/After hooks](#beforeafter-hooks)
17
18
*[Reports](#reports)
@@ -233,6 +234,36 @@ module.exports = function () {
233
234
};
234
235
```
235
236
237
+
### Helpers
238
+
239
+
`selenium-cucumber-js` contains a few helper methods to make working with selenium a bit easier, those methods are:
240
+
241
+
```js
242
+
// Load a URL, returning only when the <body> tag is present
243
+
helpers.loadPage('http://www.google.com');
244
+
245
+
// get the value of a HTML attribute
246
+
helpers.getAttributeValue('body', 'class');
247
+
248
+
// get a list of elements matching a query selector who's inner text matches param.
249
+
helpers.getElementsContainingText('nav[role="navigation"] ul li a', 'Safety Boots')
250
+
251
+
// get first elements matching a query selector who's inner text matches textToMatch param
252
+
helpers.getFirstElementContainingText('nav[role="navigation"] ul li a', 'Safety Boots').click();
253
+
254
+
// click element(s) that are not visible (useful in situations where a menu needs a hover before a child link appears)
255
+
helpers.clickHiddenElement('nav[role="navigation"] ul li a','Safety Boots');
256
+
257
+
// wait until a HTML attribute equals a particular value
The `selenium-cucumber-js` framework uses [Applitools Eyes](https://applitools.com/) to add visual checkpoints to your JavaScript Selenium tests. It takes care of getting screenshots of your application from the underlying WebDriver, sending them to the Applitools Eyes server for validation and failing the test when differences are detected. To preform visual comparisons within your tests, obtain an [Applitools Eyes](https://applitools.com/) API Key and assign it to the `eye_key` property of the `selenium-cucumber-js.json` config file in the root of your project.
0 commit comments