Skip to content

Instantly share code, notes, and snippets.

@up1
Last active April 17, 2026 09:56
Show Gist options
  • Select an option

  • Save up1/f4efd674a8ce4d52559cb93a7f73fb0d to your computer and use it in GitHub Desktop.

Select an option

Save up1/f4efd674a8ce4d52559cb93a7f73fb0d to your computer and use it in GitHub Desktop.
Self-healing in test auotmation
// Version 1 : role
await page.getByRole('button', { name: 'OK' }).click();
// Version 2 : role
await page.getByRole('button', { name: 'Submit' }).click();
// Version 3 : role
await page.getByRole('button', { name: 'Login' }).click();
// Version 4 : id
await expect(page.locator('#login_button')).toBeVisible();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment