Last active
March 3, 2019 01:57
-
-
Save k0d3d/508e60db312da9ef78c44d0c5480f49c to your computer and use it in GitHub Desktop.
Mock stub startup for strategies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports.isAwaitingReview = async function isAwaitingReview (context, page) { | |
return new Promise ((resolve, reject) => { | |
let currentUrl = await page.url() | |
if (currentUrl.indexOf('terms/unblock') > -1) { | |
const dialogButton = await page.$('[role=dialog]').$('button') | |
if (!dialogButton) { | |
return reject(page) | |
} | |
await dialogButton.click() | |
resolve(page) | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment