We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1961bc6 commit 3df6480Copy full SHA for 3df6480
index.js
@@ -94,8 +94,17 @@ class ResembleHelper extends Helper {
94
await el.screenshot({
95
path: configuration.screenshotFolder + name + '.png'
96
});
97
- }
98
- else throw new Error("Method only works with Puppeteer");
+ } else if (this.helpers['WebDriver']) {
+ const configuration = this.config;
99
+
100
+ await helper.waitForVisible(selector);
101
+ const els = await helper._locate(selector);
102
+ if (!els.length) throw new Error(`Element ${selector} couldn't be located`);
103
+ const el = els[0];
104
105
+ await el.saveScreenshot(configuration.screenshotFolder + name + '.png');
106
+ }
107
+ else throw new Error("Method only works with Puppeteer and WebDriver helpers.");
108
}
109
110
/**
0 commit comments