Skip to content

Commit

Permalink
Merge pull request #1 from quad/master
Browse files Browse the repository at this point in the history
Wait for the keypad itself to appear …
  • Loading branch information
adamroyle committed Feb 16, 2021
2 parents 0ff9d2c + e986510 commit 429e21e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/index.ts
Expand Up @@ -4,11 +4,7 @@ import { PNG } from 'pngjs'

export async function login(page: Page, clientNumber: string, accessCode: string): Promise<string> {
await page.goto('https://www.ing.com.au/securebanking/')
await page.waitForResponse('https://www.ing.com.au/KeypadService/v1/KeypadService.svc/json/PinpadImages')
// we wait for a second request, but only if it comes within 2 seconds
await page
.waitForResponse('https://www.ing.com.au/KeypadService/v1/KeypadService.svc/json/PinpadImages', { timeout: 2000 })
.catch(() => {})
await page.waitForSelector('#loginInput')
await page.type('#cifField', clientNumber)

const randomisedKeys = await page.$$eval('.pin > img', imgs =>
Expand Down

0 comments on commit 429e21e

Please sign in to comment.