Skip to content

Instantly share code, notes, and snippets.

@efleming969
Created July 30, 2021 21:25
Show Gist options
  • Save efleming969/dc6a504d49a611067a017ec7a2eeab3e to your computer and use it in GitHub Desktop.
Save efleming969/dc6a504d49a611067a017ec7a2eeab3e to your computer and use it in GitHub Desktop.
/* ==================== */
const codeInput = await page.$(
`//input[@aria-labelledby = (//*[text() = 'Code']/@id) or @id = (//*[text() = 'Code']/@for)]` )
await codeInput.type( "111111" )
await page.click( `//button[text() = 'Fetch game data']` )
await page.waitForSelector( `//*[@aria-label='list of players']` )
await page.click( `//input[@aria-labelledby = (//*[text() = 'joe']/@id) or @id = (//*[text() = 'joe']/@for)]` )
await page.click( `//button[@type = 'submit' and text() = 'Submit']` )
const alert = await page.waitForSelector( `//*[@role = 'alert' and @aria-label = 'confirmation']` )
expect( await alert.textContent() ).to.eq( "Your game was submitted!" )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment