Skip to content

Commit be2e5a6

Browse files
authored
Fix Playwright test title expectations to match actual WLED page titles
Settings pages have individual titles like "Usermod Settings", "2D Set-up", "Wi-Fi Settings" etc. - not all contain "WLED". Updated tests to expect the actual title served by each page.
1 parent 14d506a commit be2e5a6

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

e2e-tests/settings.spec.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ const { test, expect } = require('./fixtures');
2020
*/
2121
test.describe('WLED Settings Pages', () => {
2222
const settingsPages = [
23-
{ path: '/settings', name: 'Main Settings' },
24-
{ path: '/settings/wifi', name: 'WiFi Settings' },
25-
{ path: '/settings/leds', name: 'LED Settings' },
26-
{ path: '/settings/ui', name: 'UI Settings' },
27-
{ path: '/settings/sync', name: 'Sync Settings' },
28-
{ path: '/settings/time', name: 'Time Settings' },
29-
{ path: '/settings/sec', name: 'Security Settings' },
30-
{ path: '/settings/um', name: 'Usermod Settings' },
31-
{ path: '/settings/2D', name: '2D Settings' },
23+
{ path: '/settings', name: 'Main Settings', title: 'WLED Settings' },
24+
{ path: '/settings/wifi', name: 'WiFi Settings', title: 'Wi-Fi Settings' },
25+
{ path: '/settings/leds', name: 'LED Settings', title: 'LED Settings' },
26+
{ path: '/settings/ui', name: 'UI Settings', title: 'UI Settings' },
27+
{ path: '/settings/sync', name: 'Sync Settings', title: 'Sync Settings' },
28+
{ path: '/settings/time', name: 'Time Settings', title: 'Time Settings' },
29+
{ path: '/settings/sec', name: 'Security Settings', title: 'Misc Settings' },
30+
{ path: '/settings/um', name: 'Usermod Settings', title: 'Usermod Settings' },
31+
{ path: '/settings/2D', name: '2D Settings', title: '2D Set-up' },
3232
];
3333

34-
for (const { path, name } of settingsPages) {
34+
for (const { path, name, title } of settingsPages) {
3535
test(`${name} (${path}) should load without JavaScript errors`, async ({ page }) => {
3636
const pageErrors = [];
3737

@@ -44,8 +44,8 @@ test.describe('WLED Settings Pages', () => {
4444
await page.waitForLoadState('load');
4545
await page.waitForTimeout(2000);
4646

47-
// Check that the page loaded with WLED title
48-
await expect(page).toHaveTitle(/WLED/);
47+
// Check that the page loaded with expected title
48+
await expect(page).toHaveTitle(title);
4949

5050
// Check for JavaScript uncaught exceptions
5151
expect(pageErrors, `Page errors in ${name}: ${pageErrors.join(', ')}`).toHaveLength(0);

0 commit comments

Comments
 (0)