mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
fix(e2e): use mat-button-toggle value selectors for playlist type selection
mat-button-toggle elements inside a group render their internal buttons
with role="radio", not role="button", so getByRole('button') selectors
fail. Switch to attribute selectors targeting the value attribute instead.
https://claude.ai/code/session_01VU6ZZTG7YrhKhKBQvBfmpp
This commit is contained in:
3 files changed
+3
-3
No files matched your search
@@ -12,7 +12,7 @@ test('basic test', async ({ page }) => {
|
||||
// Upload playlist test
|
||||
await page.getByRole('button', { name: 'Add playlist' }).click();
|
||||
const dialog = page.locator('mat-dialog-container');
|
||||
await dialog.getByRole('button', { name: 'Add via file upload' }).click();
|
||||
await dialog.locator('mat-button-toggle[value="file"]').click();
|
||||
await page.setInputFiles('input[type="file"]', fixturePath);
|
||||
await page.waitForURL(/\/workspace\/playlists\/.+\/all$/);
|
||||
await expect(page.getByText('test.m3u')).toBeVisible();
|
||||
|
||||
@@ -76,7 +76,7 @@ async function addStalkerPortal(
|
||||
|
||||
await page.getByRole('button', { name: 'Add playlist' }).click();
|
||||
const dialog = page.locator('mat-dialog-container');
|
||||
await dialog.getByRole('button', { name: 'Stalker' }).click();
|
||||
await dialog.locator('mat-button-toggle[value="stalker"]').click();
|
||||
|
||||
await setInputValue(dialog.locator('input#title'), name);
|
||||
await setInputValue(dialog.locator('input#portalUrl'), PORTAL_URL);
|
||||
|
||||
@@ -56,7 +56,7 @@ async function addXtreamPortal(
|
||||
|
||||
await page.getByRole('button', { name: 'Add playlist' }).click();
|
||||
const dialog = page.locator('mat-dialog-container');
|
||||
await dialog.getByRole('button', { name: 'Xtream' }).click();
|
||||
await dialog.locator('mat-button-toggle[value="xtream"]').click();
|
||||
|
||||
await dialog.locator('#title').fill(name);
|
||||
await dialog.locator('#serverUrl').fill(MOCK_SERVER);
|
||||
|
||||
Reference in new issue
Block a user