Skip to content

Commit 54c1894

Browse files
committed
e2e test: bypass welcome page
1 parent 2a2fd32 commit 54c1894

1 file changed

Lines changed: 15 additions & 18 deletions

File tree

e2e-tests/index.spec.js

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ const { test, expect } = require('./fixtures');
33

44
/**
55
* Test that the main index page loads without JavaScript errors.
6-
* The WLED web UI is served from compiled-in firmware data via the '/' route.
7-
* The '/index.htm' path only serves from LittleFS (custom uploaded UI) and
8-
* won't work when there's no filesystem content.
6+
* The WLED web UI is served from compiled-in firmware data.
7+
*
8+
* NOTE: We navigate to '/sliders' (not '/') because '/' calls serveIndexOrWelcome()
9+
* which serves the welcome page when no WiFi config is saved (e.g. fresh boot in QEMU).
10+
* '/sliders' calls serveIndex() directly, always serving the full main UI.
911
*/
1012
test.describe('WLED Index Page', () => {
1113
test('should load main UI without JavaScript errors', async ({ page }) => {
@@ -24,16 +26,14 @@ test.describe('WLED Index Page', () => {
2426
pageErrors.push(error.message);
2527
});
2628

27-
// The main UI is served at '/' (or '/sliders') from compiled-in PAGE_index
28-
await page.goto('/');
29-
30-
// Wait for page to be loaded (don't wait for networkidle as API calls may hang)
29+
// Use /sliders — always serves the built-in main UI, bypasses welcome page check
30+
await page.goto('/sliders');
3131
await page.waitForLoadState('load');
3232

3333
// Wait a bit for initial JavaScript to execute
3434
await page.waitForTimeout(3000);
35-
36-
// Check that the page title is set
35+
36+
// Title is "WLED" from <title>WLED</title>, or device name (also contains WLED)
3737
await expect(page).toHaveTitle(/WLED/);
3838

3939
// Check for JavaScript errors
@@ -46,17 +46,14 @@ test.describe('WLED Index Page', () => {
4646
});
4747

4848
test('should have basic UI elements', async ({ page }) => {
49-
await page.goto('/');
49+
// Use /sliders — always serves the built-in main UI
50+
await page.goto('/sliders');
5051
await page.waitForLoadState('load');
5152
await page.waitForTimeout(3000);
52-
53-
// Check for the picker container (color wheel)
54-
const pickerContainer = page.locator('#picker');
55-
await expect(pickerContainer).toBeAttached();
56-
57-
// Check for the controls/sliders container
58-
const controls = page.locator('#sliders');
59-
await expect(controls).toBeAttached();
53+
54+
// Both `#picker` (color wheel) and `#sliders` are defined in index.htm
55+
await expect(page.locator('`#picker`')).toBeAttached();
56+
await expect(page.locator('`#sliders`')).toBeAttached();
6057
});
6158

6259
test('JSON API /json/info should return valid data', async ({ page }) => {

0 commit comments

Comments
 (0)