Skip to content

Commit 3dd89ee

Browse files
committed
Added screenshotElement function
1 parent f8f69b3 commit 3dd89ee

File tree

2 files changed

+212
-210
lines changed

2 files changed

+212
-210
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ It is exactly same as `seeVisualDiff` function, only an additional `selector` CS
6969
> Note:
7070
`seeVisualDiffForElement` only works when the page for baseImage is open in the browser, so that webdriver can fetch coordinates of the provided selector
7171

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

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

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

0 commit comments

Comments
 (0)