mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
refactor(e2e): update dialog interactions for playlist addition in tests
Entire-Checkpoint: 84693b066142
This commit is contained in:
1 parent
69bf106999
commit
cf311ddf6f
3 files changed
+6
-5
No files matched your search
@@ -11,7 +11,8 @@ test('basic test', async ({ page }) => {
|
||||
|
||||
// Upload playlist test
|
||||
await page.getByRole('button', { name: 'Add playlist' }).click();
|
||||
await page.getByRole('menuitem', { name: 'Add via file upload' }).click();
|
||||
const dialog = page.locator('mat-dialog-container');
|
||||
await dialog.getByRole('button', { name: 'Add via file upload' }).click();
|
||||
await page.setInputFiles('input[type="file"]', fixturePath);
|
||||
await page.waitForURL(/\/workspace\/playlists\/.+\/all$/);
|
||||
await expect(page.getByText('test.m3u')).toBeVisible();
|
||||
|
||||
@@ -64,8 +64,8 @@ async function setInputValue(input: Locator, value: string): Promise<void> {
|
||||
|
||||
/**
|
||||
* Add a Stalker portal via the UI:
|
||||
* 1. Click the "add playlist" button
|
||||
* 2. Click "Stalker Portal Import" in the menu
|
||||
* 1. Click the "add playlist" button to open the unified dialog
|
||||
* 2. Select "Stalker" toggle
|
||||
* 3. Fill in the form and submit
|
||||
*/
|
||||
async function addStalkerPortal(
|
||||
@@ -75,8 +75,8 @@ async function addStalkerPortal(
|
||||
const { name = 'Mock Stalker Portal', mac = DEFAULT_MAC } = options;
|
||||
|
||||
await page.getByRole('button', { name: 'Add playlist' }).click();
|
||||
await page.getByRole('menuitem', { name: /Add Stalker Portal/i }).click();
|
||||
const dialog = page.locator('mat-dialog-container');
|
||||
await dialog.getByRole('button', { name: 'Stalker' }).click();
|
||||
|
||||
await setInputValue(dialog.locator('input#title'), name);
|
||||
await setInputValue(dialog.locator('input#portalUrl'), PORTAL_URL);
|
||||
|
||||
@@ -55,8 +55,8 @@ async function addXtreamPortal(
|
||||
} = options;
|
||||
|
||||
await page.getByRole('button', { name: 'Add playlist' }).click();
|
||||
await page.getByRole('menuitem', { name: /Add Xtreme Code/i }).click();
|
||||
const dialog = page.locator('mat-dialog-container');
|
||||
await dialog.getByRole('button', { name: 'Xtream' }).click();
|
||||
|
||||
await dialog.locator('#title').fill(name);
|
||||
await dialog.locator('#serverUrl').fill(MOCK_SERVER);
|
||||
|
||||
Reference in new issue
Block a user