Skip to content

Commit a9373f0

Browse files
authored
test(e2e): enable more cases on Windows (#6038)
1 parent 4c707e5 commit a9373f0

File tree

10 files changed

+12
-47
lines changed

10 files changed

+12
-47
lines changed

e2e/cases/hmr/error-recovery/index.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
import fs from 'node:fs';
22
import { join } from 'node:path';
33
import { dev, rspackOnlyTest } from '@e2e/helper';
4-
import { expect, test } from '@playwright/test';
4+
import { expect } from '@playwright/test';
55

66
const cwd = __dirname;
77

88
rspackOnlyTest(
99
'HMR should work after fixing compilation error',
1010
async ({ page }) => {
11-
if (process.platform === 'win32') {
12-
test.skip();
13-
}
14-
1511
await fs.promises.cp(join(cwd, 'src'), join(cwd, 'test-temp-src'), {
1612
recursive: true,
1713
});

e2e/cases/hmr/rebuild-logs/index.test.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
import fs from 'node:fs';
22
import { join } from 'node:path';
33
import { dev, rspackOnlyTest } from '@e2e/helper';
4-
import { expect, test } from '@playwright/test';
4+
import { expect } from '@playwright/test';
55

66
const cwd = __dirname;
77

88
rspackOnlyTest('should print changed files in logs', async ({ page }) => {
9-
if (process.platform === 'win32') {
10-
test.skip();
11-
}
12-
139
await fs.promises.cp(join(cwd, 'src'), join(cwd, 'test-temp-src'), {
1410
recursive: true,
1511
});
@@ -38,15 +34,11 @@ rspackOnlyTest('should print changed files in logs', async ({ page }) => {
3834
.replace('Hello Rsbuild!', 'Hello Rsbuild2!'),
3935
);
4036

41-
await rsbuild.expectLog('building test-temp-src/App.tsx');
37+
await rsbuild.expectLog(/building test-temp-src[\\/]App\.tsx/);
4238
await rsbuild.close();
4339
});
4440

4541
rspackOnlyTest('should print removed files in logs', async ({ page }) => {
46-
if (process.platform === 'win32') {
47-
test.skip();
48-
}
49-
5042
await fs.promises.cp(join(cwd, 'src'), join(cwd, 'test-temp-src'), {
5143
recursive: true,
5244
});
@@ -70,6 +62,6 @@ rspackOnlyTest('should print removed files in logs', async ({ page }) => {
7062

7163
await fs.promises.unlink(appPath);
7264

73-
await rsbuild.expectLog('building removed test-temp-src/App.tsx');
65+
await rsbuild.expectLog(/building removed test-temp-src[\\/]App\.tsx/);
7466
await rsbuild.close();
7567
});

e2e/cases/html/template-cache/index.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import fse from 'fs-extra';
99
rspackOnlyTest(
1010
'should not re-compile templates when the template is not changed',
1111
async ({ page }) => {
12+
// Failed to run this case on Windows
1213
if (process.platform === 'win32') {
1314
test.skip();
1415
}

e2e/cases/lazy-compilation/add-initial-chunk/index.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
import { dev, rspackOnlyTest } from '@e2e/helper';
2-
import { expect, test } from '@playwright/test';
2+
import { expect } from '@playwright/test';
33

44
// https://github.com/web-infra-dev/rspack/issues/6633
55
rspackOnlyTest(
66
'should render pages correctly when using lazy compilation and add new initial chunk',
77
async ({ page }) => {
8-
if (process.platform === 'win32') {
9-
test.skip();
10-
}
11-
128
const rsbuild = await dev({
139
cwd: __dirname,
1410
page,

e2e/cases/lazy-compilation/basic/index.test.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import { dev, gotoPage, rspackOnlyTest } from '@e2e/helper';
2-
import { expect, test } from '@playwright/test';
2+
import { expect } from '@playwright/test';
33

44
rspackOnlyTest(
55
'should render pages correctly when using lazy compilation',
66
async ({ page }) => {
7-
if (process.platform === 'win32') {
8-
test.skip();
9-
}
10-
117
const rsbuild = await dev({
128
cwd: __dirname,
139
rsbuildConfig: {
@@ -38,10 +34,6 @@ rspackOnlyTest(
3834
rspackOnlyTest(
3935
'should allow to configure `tools.rspack.experiments.lazyCompilation`',
4036
async ({ page }) => {
41-
if (process.platform === 'win32') {
42-
test.skip();
43-
}
44-
4537
const rsbuild = await dev({
4638
cwd: __dirname,
4739
rsbuildConfig: {

e2e/cases/lazy-compilation/dynamic-import/index.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import { dev, gotoPage, rspackOnlyTest } from '@e2e/helper';
2-
import { expect, test } from '@playwright/test';
2+
import { expect } from '@playwright/test';
33

44
rspackOnlyTest(
55
'should lazy compile dynamic imported modules',
66
async ({ page }) => {
7-
if (process.platform === 'win32') {
8-
test.skip();
9-
}
10-
117
const rsbuild = await dev({
128
cwd: __dirname,
139
});

e2e/cases/lazy-compilation/port-placeholder/index.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import { dev, gotoPage, rspackOnlyTest } from '@e2e/helper';
2-
import { expect, test } from '@playwright/test';
2+
import { expect } from '@playwright/test';
33

44
rspackOnlyTest(
55
'should replace port placeholder with actual port',
66
async ({ page }) => {
7-
if (process.platform === 'win32') {
8-
test.skip();
9-
}
10-
117
const rsbuild = await dev({
128
cwd: __dirname,
139
});

e2e/cases/module-federation-v2/index.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
gotoPage,
88
rspackOnlyTest,
99
} from '@e2e/helper';
10-
import { expect, test } from '@playwright/test';
10+
import { expect } from '@playwright/test';
1111
import type { RsbuildConfig } from '@rsbuild/core';
1212
import { pluginCheckSyntax } from '@rsbuild/plugin-check-syntax';
1313

@@ -29,11 +29,6 @@ export default Button;`,
2929
rspackOnlyTest(
3030
'should run module federation in development mode',
3131
async ({ page }) => {
32-
// this case often timeout on Windows
33-
if (process.platform === 'win32') {
34-
test.skip();
35-
}
36-
3732
writeButtonCode();
3833

3934
const remotePort = await getRandomPort();

e2e/cases/print-file-size/basic/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function extractFileSizeLogs(logs: string[]) {
1919
if (isFileSizeLog) {
2020
// replace numbers and contenthash with placeholder
2121
// remove trailing spaces
22-
// replace Windows path seq with slash
22+
// replace Windows path sep with slash
2323
result.push(
2424
log
2525
.replace(/\.[a-z0-9]{8}\./g, '.[[hash]].')

e2e/cases/server/reload-html/index.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const cwd = __dirname;
88
rspackOnlyTest(
99
'should reload page when HTML template changed',
1010
async ({ page }) => {
11+
// Failed to run this case on Windows
1112
if (process.platform === 'win32') {
1213
test.skip();
1314
}

0 commit comments

Comments
 (0)