mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
test(e2e): refactor recent source card visibility checks in Electron provider tests
This commit is contained in:
1 parent
c123fbf115
commit
02c37e9bda
1 file changed
+29
-10
@@ -1,3 +1,5 @@
|
||||
import type { Page } from '@playwright/test';
|
||||
|
||||
import {
|
||||
addStalkerPortal,
|
||||
addXtreamPortal,
|
||||
@@ -30,11 +32,10 @@ test.describe('Electron Provider Smoke Tests', () => {
|
||||
await expectPortalDebugSuccess(app.mainWindow, 'xtream');
|
||||
|
||||
await goToDashboard(app.mainWindow);
|
||||
await expect(
|
||||
app.mainWindow.getByRole('link', {
|
||||
name: new RegExp(defaultXtreamPortalName, 'i'),
|
||||
})
|
||||
).toBeVisible();
|
||||
await expectRecentSourceCard(
|
||||
app.mainWindow,
|
||||
defaultXtreamPortalName
|
||||
);
|
||||
} finally {
|
||||
await closeElectronApp(app);
|
||||
}
|
||||
@@ -56,13 +57,31 @@ test.describe('Electron Provider Smoke Tests', () => {
|
||||
await expectPortalDebugSuccess(app.mainWindow, 'stalker');
|
||||
|
||||
await goToDashboard(app.mainWindow);
|
||||
await expect(
|
||||
app.mainWindow.getByRole('link', {
|
||||
name: new RegExp(defaultStalkerPortalName, 'i'),
|
||||
})
|
||||
).toBeVisible();
|
||||
await expectRecentSourceCard(
|
||||
app.mainWindow,
|
||||
defaultStalkerPortalName
|
||||
);
|
||||
} finally {
|
||||
await closeElectronApp(app);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
async function expectRecentSourceCard(
|
||||
page: Page,
|
||||
title: string
|
||||
): Promise<void> {
|
||||
await expect(
|
||||
page.getByTestId('dashboard-recent-sources-rail')
|
||||
).toBeVisible({
|
||||
timeout: 20000,
|
||||
});
|
||||
|
||||
await expect(
|
||||
page.getByTestId('dashboard-recent-sources-rail-card').filter({
|
||||
hasText: title,
|
||||
}).first()
|
||||
).toBeVisible({
|
||||
timeout: 20000,
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user