Skip to content

Commit aa4035e

Browse files
committed
test: fix test interceptor
1 parent 1dc8417 commit aa4035e

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ jobs:
127127
run: pnpm test:playwright
128128

129129
- uses: actions/upload-artifact@v4
130-
if: always()
130+
if: ${{ !cancelled() }}
131131
with:
132132
name: playwright-report
133133
path: playwright-report/

playwright.config.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ export default defineConfig({
3333
/* Base URL to use in actions like `await page.goto('/')`. */
3434
baseURL,
3535

36-
navigationTimeout: isCI ? 10_000 : 4000,
37-
actionTimeout: isCI ? 10_000 : 4000,
36+
navigationTimeout: isCI ? 10_000 : 10_000,
37+
actionTimeout: isCI ? 10_000 : 10_000,
3838

3939
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
4040
screenshot: 'only-on-failure',
@@ -49,14 +49,14 @@ export default defineConfig({
4949
name: 'chromium',
5050
use: { ...devices['Desktop Chrome'] },
5151
},
52-
{
53-
name: 'firefox',
54-
use: { ...devices['Desktop Firefox'] },
55-
},
56-
{
57-
name: 'webkit',
58-
use: { ...devices['Desktop Safari'] },
59-
},
52+
// {
53+
// name: 'firefox',
54+
// use: { ...devices['Desktop Firefox'] },
55+
// },
56+
// {
57+
// name: 'webkit',
58+
// use: { ...devices['Desktop Safari'] },
59+
// },
6060
]
6161
: [
6262
{
@@ -69,7 +69,7 @@ export default defineConfig({
6969

7070
/* Run your local dev server before starting the tests */
7171
webServer: {
72-
command: isCI ? 'pnpm serve' : 'npm run dev',
72+
command: isCI ? 'pnpm serve' : 'pnpm dev',
7373
url: baseURL,
7474
reuseExistingServer: !isCI,
7575
ignoreHTTPSErrors: true,

playwright/page-objects/conduit.page-object.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import fs from 'node:fs/promises'
22
import path from 'node:path'
33
import url from 'node:url'
44
import type { Page, Response } from '@playwright/test'
5-
import type { User } from 'src/services/api.ts'
5+
import type { User } from 'src/services/api'
66
import { Route } from '../constant'
7-
import { expect } from '../extends.ts'
8-
import { boxedStep } from '../utils/test-decorators.ts'
7+
import { expect } from '../extends'
8+
import { boxedStep } from '../utils/test-decorators'
99

1010
const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
1111
const fixtureDir = path.join(__dirname, '../../cypress/fixtures')
@@ -23,6 +23,8 @@ export class ConduitPageObject {
2323
timeout?: number
2424
} = {}): Promise<() => Promise<Response>> {
2525
await this.page.route(url, async route => {
26+
if (route.request().url().endsWith('.ts'))
27+
return await route.continue()
2628
if (route.request().method() !== method)
2729
return await route.continue()
2830

0 commit comments

Comments
 (0)