Skip to content

Instantly share code, notes, and snippets.

@akvadrako
Created October 28, 2021 10:07
Show Gist options
  • Save akvadrako/2732bfe1421933a92621b2b053091af3 to your computer and use it in GitHub Desktop.
Save akvadrako/2732bfe1421933a92621b2b053091af3 to your computer and use it in GitHub Desktop.
const { chromium, firefox } = require('playwright');
async function demo() {
const type = chromium
const browser = await type.launch({ headless: false })
const ctx = await browser.newContext()
const page = await ctx.newPage()
ctx.tracing.start({ screenshots: true, snapshots: true })
await page.goto('https://dev0.caaas.ca/public/plaid.html?token=link-sandbox-ae58abe2-a2e8-48ec-a365-bc04ca87f5d8')
//await page.waitForEvent('framenavigated')
let frame
while(! frame) {
await page.waitForTimeout(0.1)
frame = await page.frame({ url: /.*link.html.*/ })
}
await frame.waitForTimeout(0.1)
await frame.click('button:has-text("Continue")', { noWaitAfter: true })
await frame.waitForTimeout(0.1)
await frame.click('button:has-text("Royal Bank")')
await frame.waitForTimeout(0.1)
ctx.tracing.stop({ path: "trace.zip" })
}
demo()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment