You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use: {
screenshot: "only-on-failure",
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
actionTimeout: 0,
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: process.env.TESTS_URL,
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
browserName: "chromium",
headless: true,
testIdAttribute: "data-test-id", // <---------
},
Example (overly simplified) login page HTML:
playwright.config.ts
tests/
login.ts
Prefer
page.getByTestId
over unstableLocator
(because DOM-based selectors might change & break tests)References:
https://playwright.dev/docs/locators#set-a-custom-test-id-attribute
https://playwrightsolutions.com/getbytestid/
The text was updated successfully, but these errors were encountered: