Skip to content

Commit

Permalink
log selector when click fails
Browse files Browse the repository at this point in the history
  • Loading branch information
campersau committed May 5, 2020
1 parent 2fcb40d commit 67de641
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions clicktests/environment.js
Expand Up @@ -257,11 +257,16 @@ class Environment {
}

async click(selector) {
const elementHandle = await this.waitForElementVisible(selector);
if (elementHandle == null) {
throw new Error(`Element does not exist or is not visible: ${selector}`);
try {
const elementHandle = await this.waitForElementVisible(selector);
if (elementHandle == null) {
throw new Error(`Element does not exist or is not visible: ${selector}`);
}
await elementHandle.click();
} catch (err) {
winston.error(`Failed to click element: ${selector}`);
throw err;
}
await elementHandle.click();
}

async commit(commitMessage) {
Expand Down

0 comments on commit 67de641

Please sign in to comment.