|
|
@@ -1,8 +1,9 @@
|
|
|
const { test, expect } = require('@playwright/test');
|
|
|
const { baseUrls } = require('./helpers/env');
|
|
|
-const { modernStartButton } = require('./helpers/ui');
|
|
|
+const { modernStartButton, classicStartButton } = require('./helpers/ui');
|
|
|
|
|
|
const defaultTagline = 'No Flash, No Java, No Websockets, No Bullsh*t';
|
|
|
+const frontendRemoteServerListUrl = 'http://127.0.0.1:18184/tests/e2e/fixtures/servers-frontend-remote.json';
|
|
|
|
|
|
test.describe('Runtime mode smoke coverage', () => {
|
|
|
test('standalone exposes UI and local backend endpoints', async ({ page, request }) => {
|
|
|
@@ -52,6 +53,34 @@ test.describe('Runtime mode smoke coverage', () => {
|
|
|
await expect(page.locator('#selected-server')).not.toHaveText(/searching nearest server/i);
|
|
|
});
|
|
|
|
|
|
+ test('frontend starts with SERVER_LIST_URL without requiring /servers.json', async ({ page, request }) => {
|
|
|
+ const index = await request.get(`${baseUrls.frontendRemote}/index-modern.html`);
|
|
|
+ expect(index.ok()).toBeTruthy();
|
|
|
+ await expect(await index.text()).toContain(frontendRemoteServerListUrl);
|
|
|
+
|
|
|
+ const stability = await request.get(`${baseUrls.frontendRemote}/stability.html`);
|
|
|
+ expect(stability.ok()).toBeTruthy();
|
|
|
+ await expect(await stability.text()).toContain(frontendRemoteServerListUrl);
|
|
|
+
|
|
|
+ const localBackendEndpoint = await request.get(`${baseUrls.frontendRemote}/backend/empty.php`);
|
|
|
+ expect(localBackendEndpoint.status()).toBe(404);
|
|
|
+
|
|
|
+ await page.goto(`${baseUrls.frontendRemote}/index-modern.html`);
|
|
|
+ await expect(modernStartButton(page)).toBeVisible();
|
|
|
+ await expect(page.locator('#selected-server')).toContainText('Remote frontend backend', { timeout: 10_000 });
|
|
|
+ });
|
|
|
+
|
|
|
+ test('default entrypoint loads the classic frontend with SERVER_LIST_URL', async ({ page }) => {
|
|
|
+ const pageErrors = [];
|
|
|
+ page.on('pageerror', (error) => pageErrors.push(error.message));
|
|
|
+
|
|
|
+ await page.goto(`${baseUrls.frontendRemote}/index.html`);
|
|
|
+ await page.waitForURL(/index-classic\.html/);
|
|
|
+ await expect(classicStartButton(page)).toBeVisible();
|
|
|
+ await expect(page.locator('#server')).toContainText('Remote frontend backend', { timeout: 10_000 });
|
|
|
+ expect(pageErrors).toEqual([]);
|
|
|
+ });
|
|
|
+
|
|
|
test('dual combines frontend and local backend availability', async ({ page, request }) => {
|
|
|
const serverList = await request.get(`${baseUrls.dual}/server-list.json`);
|
|
|
expect(serverList.ok()).toBeTruthy();
|