Hi - I am trying to make my website a11y compliant. I am using dynamically loaded components (reusable UI components that behave differently in different workflows). Can I run playwright tests on my active window to ensure that I am a11y compliant? My tech stack - VueJS frontend + Java springboot API + MySQL.
This thread is trying to answer question "Can I run playwright tests on my active window to ensure that I am a11y compliant?"
Kind of possible but not super simple I would say, you will need to launch Chrome with remote debugging port and then in Playwright connect to browser via an endpoint https://playwright.dev/docs/api/class-browsertype#browser-type-connect-over-cdp.
Something like this I suppose https://gist.github.com/bobdobbalina/64450fb391dab3863e047295cb155410. It will expose whole browser, afterwards you should be able to manipulate tabs with Playwright api like usually.
I am new to DOM testing. so, to re-preface my question - I am testing for a11y compliance on about 600 views (based on workflow) -
to allow Playwright in its own browser wouldn't you need to provide 600 routes (page.goto('https://playwright.dev/');
)?
from example.spec.js
test('has title', async ({ page }) => {
await page.goto('https://playwright.dev/');
// Expect a title "to contain" a substring.
await expect(page).toHaveTitle(/Playwright/);
});
test('get started link', async ({ page }) => {
await page.goto('https://playwright.dev/');
// Click the get started link.
await page.getByRole('link', { name: 'Get started' }).click();
// Expects page to have a heading with the name of Installation.
await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
});
@tphillips8117
sure. the idea is to split the fixes across different teams (we have 10+ teams). What you are suggesting is a centralized fix. tthat would be me and my junior dev ๐
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].