Skip to content

Commit 46a0213

Browse files
authored
chore: remove internal uses of "folio" (#6931)
Replaced by "pwt" or "playwright test".
1 parent b556ee6 commit 46a0213

37 files changed

+271
-271
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ A barrier for introducing new installation dependencies is especially high:
130130
- Tests should be *hermetic*. Tests should not depend on external services.
131131
- Tests should work on all three platforms: Mac, Linux and Win. This is especially important for screenshot tests.
132132

133-
Playwright tests are located in [`tests`](https://github.com/microsoft/playwright/blob/master/tests) and use [Folio](https://github.com/microsoft/folio) test runner.
133+
Playwright tests are located in [`tests`](https://github.com/microsoft/playwright/blob/master/tests) and use `@playwright/test` test runner.
134134
These are integration tests, making sure public API methods and events work as expected.
135135

136136
- To run all tests:

tests/playwright-test/access-data.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures';
1919
test('should access error in fixture', async ({ runInlineTest }) => {
2020
const result = await runInlineTest({
2121
'test-error-visible-in-env.spec.ts': `
22-
const test = folio.test.extend({
22+
const test = pwt.test.extend({
2323
foo: [async ({}, run, testInfo) => {
2424
await run();
2525
console.log('ERROR[[[' + JSON.stringify(testInfo.error, undefined, 2) + ']]]');
@@ -40,7 +40,7 @@ test('should access error in fixture', async ({ runInlineTest }) => {
4040
test('should access annotations in fixture', async ({ runInlineTest }) => {
4141
const { exitCode, report } = await runInlineTest({
4242
'test-data-visible-in-env.spec.ts': `
43-
const test = folio.test.extend({
43+
const test = pwt.test.extend({
4444
foo: [async ({}, run, testInfo) => {
4545
await run();
4646
testInfo.annotations.push({ type: 'myname', description: 'hello' });
@@ -74,7 +74,7 @@ test('should report projectName in result', async ({ runInlineTest }) => {
7474
};
7575
`,
7676
'test-data-visible-in-env.spec.ts': `
77-
folio.test('some test', async ({}, testInfo) => {
77+
pwt.test('some test', async ({}, testInfo) => {
7878
});
7979
`
8080
});

tests/playwright-test/base-reporter.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ test('handle long test names', async ({ runInlineTest }) => {
2020
const title = 'title'.repeat(30);
2121
const result = await runInlineTest({
2222
'a.test.js': `
23-
const { test } = folio;
23+
const { test } = pwt;
2424
test('${title}', async ({}) => {
2525
expect(1).toBe(0);
2626
});
@@ -33,7 +33,7 @@ test('handle long test names', async ({ runInlineTest }) => {
3333
test('print the error name', async ({ runInlineTest }) => {
3434
const result = await runInlineTest({
3535
'a.spec.ts': `
36-
const { test } = folio;
36+
const { test } = pwt;
3737
test('foobar', async ({}) => {
3838
const error = new Error('my-message');
3939
error.name = 'FooBarError';
@@ -49,7 +49,7 @@ test('print the error name', async ({ runInlineTest }) => {
4949
test('print should print the error name without a message', async ({ runInlineTest }) => {
5050
const result = await runInlineTest({
5151
'a.spec.ts': `
52-
const { test } = folio;
52+
const { test } = pwt;
5353
test('foobar', async ({}) => {
5454
const error = new Error();
5555
error.name = 'FooBarError';
@@ -75,7 +75,7 @@ test('print an error in a codeframe', async ({ runInlineTest }) => {
7575
}
7676
`,
7777
'a.spec.ts': `
78-
const { test } = folio;
78+
const { test } = pwt;
7979
import myLib from './my-lib';
8080
test('foobar', async ({}) => {
8181
const error = new Error('my-message');

tests/playwright-test/basic.spec.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import * as path from 'path';
2020
test('should fail', async ({ runInlineTest }) => {
2121
const result = await runInlineTest({
2222
'one-failure.spec.ts': `
23-
const { test } = folio;
23+
const { test } = pwt;
2424
test('fails', () => {
2525
expect(1 + 1).toBe(7);
2626
});
@@ -35,7 +35,7 @@ test('should fail', async ({ runInlineTest }) => {
3535
test('should timeout', async ({ runInlineTest }) => {
3636
const { exitCode, passed, failed, output } = await runInlineTest({
3737
'one-timeout.spec.js': `
38-
const { test } = folio;
38+
const { test } = pwt;
3939
test('timeout', async () => {
4040
await new Promise(f => setTimeout(f, 10000));
4141
});
@@ -50,7 +50,7 @@ test('should timeout', async ({ runInlineTest }) => {
5050
test('should succeed', async ({ runInlineTest }) => {
5151
const result = await runInlineTest({
5252
'one-success.spec.js': `
53-
const { test } = folio;
53+
const { test } = pwt;
5454
test('succeeds', () => {
5555
expect(1 + 1).toBe(2);
5656
});
@@ -67,7 +67,7 @@ test('should report suite errors', async ({ runInlineTest }) => {
6767
if (new Error().stack.includes('workerRunner'))
6868
throw new Error('Suite error');
6969
70-
const { test } = folio;
70+
const { test } = pwt;
7171
test('passes',() => {
7272
expect(1 + 1).toBe(2);
7373
});
@@ -81,7 +81,7 @@ test('should report suite errors', async ({ runInlineTest }) => {
8181
test('should respect nested skip', async ({ runInlineTest }) => {
8282
const { exitCode, passed, failed, skipped } = await runInlineTest({
8383
'nested-skip.spec.js': `
84-
const { test } = folio;
84+
const { test } = pwt;
8585
test.describe('skipped', () => {
8686
test.skip();
8787
test('succeeds',() => {
@@ -99,7 +99,7 @@ test('should respect nested skip', async ({ runInlineTest }) => {
9999
test('should respect excluded tests', async ({ runInlineTest }) => {
100100
const { exitCode, passed } = await runInlineTest({
101101
'excluded.spec.ts': `
102-
const { test } = folio;
102+
const { test } = pwt;
103103
test('included test', () => {
104104
expect(1 + 1).toBe(2);
105105
});
@@ -135,7 +135,7 @@ test('should respect excluded tests', async ({ runInlineTest }) => {
135135
test('should respect focused tests', async ({ runInlineTest }) => {
136136
const { exitCode, passed } = await runInlineTest({
137137
'focused.spec.ts': `
138-
const { test } = folio;
138+
const { test } = pwt;
139139
test('included test', () => {
140140
expect(1 + 1).toBe(3);
141141
});
@@ -183,7 +183,7 @@ test('should respect focused tests', async ({ runInlineTest }) => {
183183
test('skip should take priority over fail', async ({ runInlineTest }) => {
184184
const { passed, skipped, failed } = await runInlineTest({
185185
'test.spec.ts': `
186-
const { test } = folio;
186+
const { test } = pwt;
187187
test.describe('failing suite', () => {
188188
test.fail();
189189
@@ -220,13 +220,13 @@ test('should focus test from one runTests', async ({ runInlineTest }) => {
220220
] };
221221
`,
222222
'a/afile.spec.ts': `
223-
const { test } = folio;
223+
const { test } = pwt;
224224
test('just a test', () => {
225225
expect(1 + 1).toBe(3);
226226
});
227227
`,
228228
'b/bfile.spec.ts': `
229-
const { test } = folio;
229+
const { test } = pwt;
230230
test.only('focused test', () => {
231231
expect(1 + 1).toBe(2);
232232
});

tests/playwright-test/config.spec.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ test('should be able to define config', async ({ runInlineTest }) => {
2424
module.exports = { timeout: 12345 };
2525
`,
2626
'a.test.ts': `
27-
const { test } = folio;
27+
const { test } = pwt;
2828
test('pass', async ({}, testInfo) => {
2929
expect(testInfo.timeout).toBe(12345);
3030
});
@@ -41,7 +41,7 @@ test('should prioritize project timeout', async ({ runInlineTest }) => {
4141
module.exports = { timeout: 500, projects: [{ timeout: 10000}, {}] };
4242
`,
4343
'a.test.ts': `
44-
const { test } = folio;
44+
const { test } = pwt;
4545
test('pass', async ({}, testInfo) => {
4646
await new Promise(f => setTimeout(f, 1500));
4747
});
@@ -60,7 +60,7 @@ test('should prioritize command line timeout over project timeout', async ({ run
6060
module.exports = { projects: [{ timeout: 10000}] };
6161
`,
6262
'a.test.ts': `
63-
const { test } = folio;
63+
const { test } = pwt;
6464
test('pass', async ({}, testInfo) => {
6565
await new Promise(f => setTimeout(f, 1500));
6666
});
@@ -81,12 +81,12 @@ test('should read config from --config, resolve relative testDir', async ({ runI
8181
};
8282
`,
8383
'a.test.ts': `
84-
const { test } = folio;
84+
const { test } = pwt;
8585
test('ignored', async ({}) => {
8686
});
8787
`,
8888
'dir/b.test.ts': `
89-
const { test } = folio;
89+
const { test } = pwt;
9090
test('run', async ({}) => {
9191
});
9292
`,
@@ -104,12 +104,12 @@ test('should default testDir to the config file', async ({ runInlineTest }) => {
104104
module.exports = {};
105105
`,
106106
'a.test.ts': `
107-
const { test } = folio;
107+
const { test } = pwt;
108108
test('ignored', async ({}) => {
109109
});
110110
`,
111111
'dir/b.test.ts': `
112-
const { test } = folio;
112+
const { test } = pwt;
113113
test('run', async ({}) => {
114114
});
115115
`,
@@ -133,7 +133,7 @@ test('should be able to set reporters', async ({ runInlineTest }, testInfo) => {
133133
};
134134
`,
135135
'a.test.ts': `
136-
const { test } = folio;
136+
const { test } = pwt;
137137
test('pass', async () => {
138138
});
139139
`
@@ -154,12 +154,12 @@ test('should support different testDirs', async ({ runInlineTest }) => {
154154
] };
155155
`,
156156
'a.test.ts': `
157-
const { test } = folio;
157+
const { test } = pwt;
158158
test('runs once', async ({}) => {
159159
});
160160
`,
161161
'dir/b.test.ts': `
162-
const { test } = folio;
162+
const { test } = pwt;
163163
test('runs twice', async ({}) => {
164164
});
165165
`,
@@ -181,7 +181,7 @@ test('should allow export default form the config file', async ({ runInlineTest
181181
export default { timeout: 1000 };
182182
`,
183183
'a.test.ts': `
184-
const { test } = folio;
184+
const { test } = pwt;
185185
test('fails', async ({}, testInfo) => {
186186
await new Promise(f => setTimeout(f, 2000));
187187
});
@@ -203,13 +203,13 @@ test('should allow root testDir and use it for relative paths', async ({ runInli
203203
};
204204
`,
205205
'a.test.ts': `
206-
const { test } = folio;
206+
const { test } = pwt;
207207
test('fails', async ({}, testInfo) => {
208208
expect(1 + 1).toBe(3);
209209
});
210210
`,
211211
'dir/a.test.ts': `
212-
const { test } = folio;
212+
const { test } = pwt;
213213
test('fails', async ({}, testInfo) => {
214214
expect(1 + 1).toBe(3);
215215
});
@@ -226,11 +226,11 @@ test('should allow root testDir and use it for relative paths', async ({ runInli
226226
test('should throw when test() is called in config file', async ({ runInlineTest }) => {
227227
const result = await runInlineTest({
228228
'playwright.config.ts': `
229-
folio.test('hey', () => {});
229+
pwt.test('hey', () => {});
230230
module.exports = {};
231231
`,
232232
'a.test.ts': `
233-
const { test } = folio;
233+
const { test } = pwt;
234234
test('test', async ({}) => {
235235
});
236236
`,
@@ -247,7 +247,7 @@ test('should filter by project, case-insensitive', async ({ runInlineTest }) =>
247247
] };
248248
`,
249249
'a.test.ts': `
250-
const { test } = folio;
250+
const { test } = pwt;
251251
test('pass', async ({}, testInfo) => {
252252
console.log(testInfo.project.name);
253253
});
@@ -269,7 +269,7 @@ test('should print nice error when project is unknown', async ({ runInlineTest }
269269
] };
270270
`,
271271
'a.test.ts': `
272-
const { test } = folio;
272+
const { test } = pwt;
273273
test('pass', async ({}, testInfo) => {
274274
console.log(testInfo.project.name);
275275
});
@@ -285,7 +285,7 @@ test('should work without config file', async ({ runInlineTest }) => {
285285
throw new Error('This file should not be required');
286286
`,
287287
'dir/a.test.ts': `
288-
const { test } = folio;
288+
const { test } = pwt;
289289
test('pass', async ({}) => {
290290
test.expect(1 + 1).toBe(2);
291291
});
@@ -308,7 +308,7 @@ test('should inerhit use options in projects', async ({ runInlineTest }) => {
308308
};
309309
`,
310310
'a.test.ts': `
311-
const { test } = folio;
311+
const { test } = pwt;
312312
test('pass', async ({ foo, bar }, testInfo) => {
313313
test.expect(foo).toBe('config');
314314
test.expect(bar).toBe('project');
@@ -328,7 +328,7 @@ test('should work with undefined values and base', async ({ runInlineTest }) =>
328328
};
329329
`,
330330
'a.test.ts': `
331-
const { test } = folio;
331+
const { test } = pwt;
332332
test('pass', async ({}, testInfo) => {
333333
expect(testInfo.config.updateSnapshots).toBe('none');
334334
});
@@ -381,7 +381,7 @@ test('should work with custom reporter', async ({ runInlineTest }) => {
381381
};
382382
`,
383383
'a.test.ts': `
384-
const { test } = folio;
384+
const { test } = pwt;
385385
test('pass', async ({}) => {
386386
console.log('log');
387387
console.error('error');

tests/playwright-test/dot-reporter.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { test, expect, stripAscii } from './playwright-test-fixtures';
2020
test('render expected', async ({ runInlineTest }) => {
2121
const result = await runInlineTest({
2222
'a.test.js': `
23-
const { test } = folio;
23+
const { test } = pwt;
2424
test('one', async ({}) => {
2525
expect(1).toBe(1);
2626
});
@@ -33,7 +33,7 @@ test('render expected', async ({ runInlineTest }) => {
3333
test('render unexpected', async ({ runInlineTest }) => {
3434
const result = await runInlineTest({
3535
'a.test.js': `
36-
const { test } = folio;
36+
const { test } = pwt;
3737
test('one', async ({}) => {
3838
expect(1).toBe(0);
3939
});
@@ -46,7 +46,7 @@ test('render unexpected', async ({ runInlineTest }) => {
4646
test('render unexpected after retry', async ({ runInlineTest }) => {
4747
const result = await runInlineTest({
4848
'a.test.js': `
49-
const { test } = folio;
49+
const { test } = pwt;
5050
test('one', async ({}) => {
5151
expect(1).toBe(0);
5252
});
@@ -61,7 +61,7 @@ test('render unexpected after retry', async ({ runInlineTest }) => {
6161
test('render flaky', async ({ runInlineTest }) => {
6262
const result = await runInlineTest({
6363
'a.test.js': `
64-
const { test } = folio;
64+
const { test } = pwt;
6565
test('one', async ({}, testInfo) => {
6666
expect(testInfo.retry).toBe(3);
6767
});
@@ -81,7 +81,7 @@ test('should work from config', async ({ runInlineTest }) => {
8181
module.exports = { reporter: 'dot' };
8282
`,
8383
'a.test.js': `
84-
const { test } = folio;
84+
const { test } = pwt;
8585
test('one', async ({}) => {
8686
expect(1).toBe(1);
8787
});

0 commit comments

Comments
 (0)