Skip to content

Commit

Permalink
Added screenshotElement function
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartikeya99 committed May 31, 2019
1 parent f8f69b3 commit 3dd89ee
Show file tree
Hide file tree
Showing 2 changed files with 212 additions and 210 deletions.
9 changes: 7 additions & 2 deletions README.md
Expand Up @@ -69,7 +69,11 @@ It is exactly same as `seeVisualDiff` function, only an additional `selector` CS
> Note:
`seeVisualDiffForElement` only works when the page for baseImage is open in the browser, so that webdriver can fetch coordinates of the provided selector


Third one is the `screenshotElement` which basically takes screenshot of the element. Selector for the element must be provided.
It saves the image in the output directory as mentioned in the config folder.
```
I.screenshotElement("selectorForElement", "nameForImage");
```

Finally to use the helper in your test, you can write something like this:

Expand All @@ -95,4 +99,5 @@ Scenario('Compare CPU Usage Images', async (I) => {
adminPage.navigateToDashboard("OS", "System Overview");
I.seeVisualDiffForElement("//div[@class='panel-container']", "Complete_Dashboard_Image.png", {prepareBaseImage: false, tolerance: 3});
});
```
```

0 comments on commit 3dd89ee

Please sign in to comment.