Skip to content

Commit 5257b4f

Browse files
committed
fix(e2e): remove unused isStaging function and update tests
- Removed the unused `isStaging` function from `utils.ts`. - Replaced `isStaging` with `isProduction` in landings spec tests. - Updated test skipping logic for reverse-proxy hosts.
1 parent 3d44307 commit 5257b4f

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

test/production/landings.spec.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { test, expect } from '@playwright/test';
2-
import { isStaging } from '../utils';
1+
import { expect, test } from '@playwright/test';
2+
import { isProduction } from '../utils';
33

44
test.describe('/lp/ pages list', async () => {
5-
test(`Check /lp/multiplatform default redirects`, async ({ page, baseURL }) => {
6-
test.skip(isStaging(baseURL), 'for host with reverse-proxy only');
5+
test.skip(({ baseURL }) => isProduction(baseURL), 'for host with reverse-proxy only');
76

7+
test(`Check /lp/multiplatform default redirects`, async ({ page, baseURL }) => {
88
const targetUrl = 'https://kotlinlang.org/multiplatform/';
99

1010
await page.goto('/lp/multiplatform');
@@ -18,7 +18,6 @@ test.describe('/lp/ pages list', async () => {
1818
});
1919

2020
test(`Check /lp/multiplatform case-studies redirect`, async ({ page, baseURL }) => {
21-
test.skip(isStaging(baseURL), 'for host with reverse-proxy only');
2221
const targetUrl = 'https://kotlinlang.org/case-studies/?type=multiplatform';
2322

2423
await page.goto('/lp/multiplatform/case-studies/');

test/utils.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ import { PageAssertionsToHaveScreenshotOptions } from 'playwright/types/test';
33

44
export const testSelector = (name: string) => `[data-test="${name}"]`;
55

6-
export function isStaging(baseURL: string): boolean {
7-
const { hostname } = new URL(baseURL);
8-
return hostname !== 'kotlinlang.org';
9-
}
10-
116
const TRANSITION_TIMEOUT = 2000;
127

138
export async function checkAnchor(page: Page, anchor: Locator) {

0 commit comments

Comments
 (0)