Skip to content

Commit 068ac10

Browse files
author
Temilayo kufeji
committed
Update Readme to include Applitools usage
1 parent aebbb67 commit 068ac10

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

README.MD

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,62 @@ module.exports = function () {
234234
};
235235
```
236236

237+
### Applitools Eyes!
238+
The Applitools Eyes Selenium JavaScript SDK allows you to easily add visual checkpoints to your JavaScript Selenium tests.
239+
It takes care of getting screenshots of your application from the underlying WebDriver, sending them to the Eyes server for validation and failing the test in case differences are found.
240+
To use Applitools Eyes specifying an ApiKey from Aplitools using a `selenium-cucumber-js.json` file at the root of your project
241+
242+
For example the following configuration could be used with an increased timeout which allows enough time for viusual checks:
243+
244+
```json
245+
{
246+
"eye_key": "Your_Api_Key",
247+
"timeout": 50000
248+
}
249+
```
250+
251+
And its usage within page Objects:
252+
253+
```js
254+
module.exports = {
255+
256+
url: 'https://applitools.com/helloworld',
257+
258+
elements: {
259+
clickme: by.tagName('button'),
260+
searchResultLink: by.css('div.g > h3 > a')
261+
},
262+
263+
/**
264+
* enters a search term into Google's search box and presses enter
265+
* @param {string} searchQuery
266+
* @returns {Promise} a promise to enter the search values
267+
*/
268+
applitools_Eyes_Example: function () {
269+
270+
// Start the test and set the browser's viewport size to 800x600.
271+
eyes.open(driver, 'Hello World!', 'My first Javascript test!',
272+
{width: 800, height: 600});
273+
274+
// Navigate the browser to the "hello world!" web-site.
275+
driver.get(page.HelloWorld.elements.url);
276+
277+
// Visual checkpoint #1.
278+
eyes.checkWindow('Main Page');
279+
280+
// Click the "Click me!" button.
281+
driver.findElement(page.HelloWorld.elements.clickme).click();
282+
283+
// Visual checkpoint #2.
284+
eyes.checkWindow('Click!');
285+
286+
// End the test.
287+
eyes.close();
288+
}
289+
};
290+
```
291+
292+
237293
### Before/After hooks
238294

239295
You can register before and after handlers for features and scenarios:

0 commit comments

Comments
 (0)