Skip to content

Commit feac510

Browse files
committed
Made in sync with master.
2 parents 95b4591 + a4ab7fd commit feac510

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

index.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,8 @@ class ResembleHelper extends Helper {
7575
* @returns {Promise<void}
7676
*/
7777
async screenshotElement(selector, name) {
78-
79-
if (this.helpers['Puppeteer']) {
80-
const helper = this._getHelper();
78+
const helper = this._getHelper();
79+
if(this.helpers['Puppeteer']){
8180
const configuration = this.config;
8281

8382
await helper.waitForVisible(selector);
@@ -89,7 +88,7 @@ class ResembleHelper extends Helper {
8988
path: configuration.screenshotFolder + name + '.png'
9089
});
9190
}
92-
else throw new Error("Method to be called only with Puppeteer. Other helpers not supported");
91+
else throw new Error("Method only works with Puppeteer");
9392
}
9493

9594
/**
@@ -196,8 +195,8 @@ class ResembleHelper extends Helper {
196195
}
197196

198197
if (this.helpers['WebDriver'] || this.helpers['Appium']) {
199-
location = await ele.getLocation();
200-
size = await ele.getSize();
198+
location = await el.getLocation();
199+
size = await el.getSize();
201200
}
202201

203202
if (this.helpers['WebDriverIO']) {
@@ -223,6 +222,7 @@ class ResembleHelper extends Helper {
223222
if (this.helpers['Puppeteer']) {
224223
return this.helpers['Puppeteer'];
225224
}
225+
226226
if (this.helpers['WebDriver']) {
227227
return this.helpers['WebDriver'];
228228
}

0 commit comments

Comments
 (0)