docs(test-runner): fixed wrong function calls (#7080)

This commit is contained in:
Max Schmitt 2021-06-11 16:20:13 -07:00 committed by GitHub
parent 8a8b3932f8
commit 2b8ea73048
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -21,17 +21,17 @@ Here is how typical test environment setup differs between traditional test styl
const { test } = require('@playwright/test'); const { test } = require('@playwright/test');
const { TodoPage } = require('./todo-page'); const { TodoPage } = require('./todo-page');
describe('todo tests', () => { test.describe('todo tests', () => {
let todoPage; let todoPage;
beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
todoPage = new TodoPage(page); todoPage = new TodoPage(page);
await todoPage.goto(); await todoPage.goto();
await todoPage.addToDo('item1'); await todoPage.addToDo('item1');
await todoPage.addToDo('item2'); await todoPage.addToDo('item2');
}); });
afterEach(async () => { test.afterEach(async () => {
await todoPage.removeAll(); await todoPage.removeAll();
}); });
@ -168,7 +168,7 @@ module.exports = base.test.extend({
```js js-flavor=ts ```js js-flavor=ts
// hello.ts // hello.ts
import base from '@playwright/test'; import { test as base } from '@playwright/test';
// Define test fixtures "hello" and "helloWorld". // Define test fixtures "hello" and "helloWorld".
type TestFixtures = { type TestFixtures = {

2
types/test.d.ts vendored
View file

@ -806,7 +806,7 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
* can perform setup/teardown and provide a resource to the test. * can perform setup/teardown and provide a resource to the test.
* *
* ```ts * ```ts
* import base from '@playwright/test'; * import { test as base } from '@playwright/test';
* import rimraf from 'rimraf'; * import rimraf from 'rimraf';
* *
* const test = base.extend<{ dirCount: number, dirs: string[] }>({ * const test = base.extend<{ dirCount: number, dirs: string[] }>({