-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add example of puppeteer #265
Conversation
Codecov Report
@@ Coverage Diff @@
## master #265 +/- ##
=======================================
Coverage 93.91% 93.91%
=======================================
Files 13 13
Lines 838 838
Branches 182 182
=======================================
Hits 787 787
Misses 51 51 Continue to review full report at Codecov.
|
examples/puppeteer/oauth2-test.js
Outdated
@@ -0,0 +1,117 @@ | |||
// Copyright 2018, Google, Inc. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
examples/puppeteer/oauth2-test.js
Outdated
|
||
function getAuthenticatedClient() { | ||
let browser = null; | ||
return new Promise((resolve, reject) => { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
.waitForSelector('#password input[type="password"]', { visible: true }); | ||
console.log('typing password...'); | ||
await page.type('#password input[type="password"]', config.password, { | ||
delay: 100 |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This was super fun! Adds an example of using puppeteer to do automated testing of an OAuth2 workflow with Google Sign in. Addresses #225.