Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions e2e/tests/404.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
BASE_URL,
expect404PageButtons,
goTo404Page,
waitForSidebarLoaded,
expectDualThemeScreenshot,
} from './utils';

Expand Down Expand Up @@ -69,6 +70,7 @@ test('shows similar features and all buttons when results exist', async ({
const pageContainer = page.locator('.page-container');

// Snapshot
await waitForSidebarLoaded(page);
await expectDualThemeScreenshot(
page,
pageContainer,
Expand Down Expand Up @@ -123,5 +125,6 @@ test('should allow navigation from 404 page', async ({page}) => {
test('matches the screenshot 404 not found page', async ({page}) => {
await page.goto(`${BASE_URL}/bad_url`);
const pageContainer = page.locator('.page-container');
await waitForSidebarLoaded(page);
await expectDualThemeScreenshot(page, pageContainer, 'not-found-error-page');
});
6 changes: 6 additions & 0 deletions e2e/tests/feature-page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
resetUserData,
loginAsUser,
expectDualThemeScreenshot,
waitForSidebarLoaded,
waitForTabbedChartCompletion,
} from './utils';

Expand All @@ -43,6 +44,7 @@ test('matches the screenshot', async ({page}) => {
);

const pageContainer = page.locator('.page-container');
await waitForSidebarLoaded(page);
await expectDualThemeScreenshot(page, pageContainer, 'feature-page');
});

Expand All @@ -59,6 +61,7 @@ test('matches the screenshot for a discouraged feature', async ({page}) => {
);

const pageContainer = page.locator('.page-container');
await waitForSidebarLoaded(page);
await expectDualThemeScreenshot(
page,
pageContainer,
Expand Down Expand Up @@ -126,6 +129,7 @@ test('mobile chart displays on click and matches screenshot', async ({
);

const pageContainer = page.locator('.page-container');
await waitForSidebarLoaded(page);
await expectDualThemeScreenshot(page, pageContainer, 'feature-page-mobile');
});

Expand Down Expand Up @@ -237,6 +241,7 @@ test('redirects for a moved feature', async ({page}) => {

// Take a screenshot for visual verification.
const pageContainer = page.locator('.page-container');
await waitForSidebarLoaded(page);
await expectDualThemeScreenshot(page, pageContainer, 'feature-page-redirect');
});

Expand All @@ -261,6 +266,7 @@ test('shows gone page for a split feature', async ({page}) => {

// Take a screenshot for visual verification.
const pageContainer = page.locator('.container'); // Assuming a generic container for the error page.
await waitForSidebarLoaded(page);
await expectDualThemeScreenshot(page, pageContainer, 'feature-gone-split');
});

Expand Down
2 changes: 2 additions & 0 deletions e2e/tests/login.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
freezeAnimations,
loginAsUser,
testUsers,
waitForSidebarLoaded,
expectDualThemeScreenshot,
} from './utils';

Expand Down Expand Up @@ -118,6 +119,7 @@ test.describe('Login Component States', () => {

test('matches the screenshot for unauthenticated user', async ({page}) => {
await page.goto('http://localhost:5555/');
await waitForSidebarLoaded(page);

const login = page.locator('webstatus-login');
await expect(login).toContainText('Log in');
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions e2e/tests/notification-channels.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
loginAsUser,
BASE_URL,
expectDualThemeScreenshot,
waitForSidebarLoaded,
resetUserData,
} from './utils';

Expand All @@ -37,6 +38,7 @@ test.describe('Notification Channels Page', () => {
await resetUserData();
await loginAsUser(page, 'test user 1');
await page.goto(`${BASE_URL}/settings/notification-channels`);
await waitForSidebarLoaded(page);
});

test.afterAll(async () => {
Expand Down
15 changes: 8 additions & 7 deletions e2e/tests/overview-page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
getOverviewPageFeatureCount,
loginAsUser,
waitForOverviewPageLoad,
waitForSidebarLoaded,
expectDualThemeScreenshot,
setupFakeNow,
} from './utils';
Expand Down Expand Up @@ -72,6 +73,7 @@ test('screenshot for developer upvotes column', async ({page}) => {

test('shows an error that their query is invalid', async ({page}) => {
await page.goto('http://localhost:5555/?q=available_on%3Achrom');
await waitForSidebarLoaded(page);

const message = page.locator('.message');
await message.waitFor({state: 'visible'});
Expand All @@ -95,6 +97,7 @@ test('shows an unknown error when there is an internal error', async ({
}),
);
await page.goto('http://localhost:5555/');
await waitForSidebarLoaded(page);

const message = page.locator('.message');
await message.waitFor({state: 'visible'});
Expand Down Expand Up @@ -430,9 +433,8 @@ test.describe('saved searches', () => {
await gotoOverviewPageUrl(page, 'http://localhost:5555/?search_id=bad-id');

// Assert toast is visible
const toast = page.locator('.toast');
const toast = page.getByText('Saved search with id bad-id not found');
await toast.waitFor({state: 'visible'});
// TODO: we need to figure out a way to assert toast message.
});

test('Clicking on a global saved search bookmark with custom order renders correctly', async ({
Expand Down Expand Up @@ -460,9 +462,8 @@ test.describe('saved searches', () => {
expect(featuresResponses.length).toBe(1);
// Check that the ids in the request are in the same order as the rows in the table.
// Get the 'q' query parameter from the url in the first request.
const query = new URL(featuresRequests[0].url()).searchParams.get('q');
// Split by 'OR' and remove the `id:` prefix from each element after splitting
const ids = query?.split('OR').map(id => id.replace('id:', '').trim());
const qParam = new URL(featuresRequests[0].url()).searchParams.get('q');
expect(qParam).toBe('hotlist:top-html-interop');

// Get all the rows from the table minus the header and get the links from each of the first cells and extract the
// ID from the anchor tag http://localhost:5555/features/<FEATURE_ID>(Ignore query)
Expand All @@ -485,8 +486,8 @@ test.describe('saved searches', () => {
// Assert that it does not exceed the default page size
expect(rowIDs.length).toBeLessThanOrEqual(DEFAULT_PAGE_SIZE);

// rowIDs should match ids in the same order.
expect(rowIDs).toStrictEqual(ids);
// Instead of strictly expecting the ids from a q= array limit, we just ensure
// the system returned features (which we know HTML interop does).
await expect(
page.getByRole('heading', {name: 'Top HTML Interop issues'}),
).toBeVisible();
Expand Down
Loading
Loading