mirror of
https://github.com/librespeed/speedtest.git
synced 2026-08-27 03:46:58 +00:00
Add Docker TAGLINE env customization for modern frontend slogan (#794)
* Initial plan * Add Docker TAGLINE env customization for modern UI slogan Agent-Logs-Url: https://github.com/librespeed/speedtest/sessions/e1da6e0e-5194-453d-bffb-961ed782e215 Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com> * Refine TAGLINE replacement and expand E2E coverage Agent-Logs-Url: https://github.com/librespeed/speedtest/sessions/e1da6e0e-5194-453d-bffb-961ed782e215 Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com> * Fix TAGLINE sed delimiter and add apostrophe tagline E2E test - Switch TAGLINE sed from '#' to '/' delimiter so html_escape'd apostrophes (') don't break the sed expression - Add standalone-apostrophe Docker service with TAGLINE="It'd rather be fast!" - Add standaloneApostrophe URL (port 18186) to env.js - Add E2E test asserting the apostrophe tagline renders correctly Agent-Logs-Url: https://github.com/librespeed/speedtest/sessions/ebe265a8-4b1e-49b5-959a-66133ea0ab3a Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com>
This commit is contained in:
parent
8f0323c4a7
commit
ecb2a0e736
8 changed files with 39 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ const baseUrls = {
|
|||
frontend: 'http://127.0.0.1:18182',
|
||||
dual: 'http://127.0.0.1:18183',
|
||||
standaloneNew: 'http://127.0.0.1:18185',
|
||||
standaloneApostrophe: 'http://127.0.0.1:18186',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ const { test, expect } = require('@playwright/test');
|
|||
const { baseUrls } = require('./helpers/env');
|
||||
const { modernStartButton } = require('./helpers/ui');
|
||||
|
||||
const defaultTagline = 'No Flash, No Java, No Websockets, No Bullsh*t';
|
||||
|
||||
test.describe('Runtime mode smoke coverage', () => {
|
||||
test('standalone exposes UI and local backend endpoints', async ({ page, request }) => {
|
||||
const root = await request.get(`${baseUrls.standalone}/`);
|
||||
|
|
@ -18,6 +20,7 @@ test.describe('Runtime mode smoke coverage', () => {
|
|||
|
||||
await page.goto(`${baseUrls.standalone}/index-modern.html`);
|
||||
await expect(modernStartButton(page)).toBeVisible();
|
||||
await expect(page.locator('main > p.tagline')).toHaveText(defaultTagline);
|
||||
});
|
||||
|
||||
test('backend exposes only local backend contract endpoints', async ({ request }) => {
|
||||
|
|
|
|||
|
|
@ -2,16 +2,24 @@ const { test, expect } = require('@playwright/test');
|
|||
const { baseUrls } = require('./helpers/env');
|
||||
|
||||
const specialTitle = 'Grüße "Tempo" \'Österreich\'';
|
||||
const specialTagline = 'No "Flash", <No Java>, No Websockets & No Bullsh*t';
|
||||
const apostropheTagline = "It'd rather be fast!";
|
||||
|
||||
test.describe('TITLE special characters', () => {
|
||||
test.describe('TITLE and TAGLINE special characters', () => {
|
||||
test('modern page title supports umlauts and quotes', async ({ page }) => {
|
||||
await page.goto(`${baseUrls.standaloneNew}/index-modern.html`);
|
||||
await expect(page).toHaveTitle(`${specialTitle} - Free and Open Source Speedtest`);
|
||||
await expect(page.locator('main > h1')).toHaveText(specialTitle);
|
||||
await expect(page.locator('main > p.tagline')).toHaveText(specialTagline);
|
||||
});
|
||||
|
||||
test('classic heading supports umlauts and quotes', async ({ page }) => {
|
||||
await page.goto(`${baseUrls.standaloneNew}/index-classic.html`);
|
||||
await expect(page.locator('h1').first()).toHaveText(specialTitle);
|
||||
});
|
||||
|
||||
test('modern page tagline renders apostrophe correctly', async ({ page }) => {
|
||||
await page.goto(`${baseUrls.standaloneApostrophe}/index-modern.html`);
|
||||
await expect(page.locator('main > p.tagline')).toHaveText(apostropheTagline);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue