Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nodejs/docs/api/class-testconfig.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ Here is an example that uses [testInfo.outputPath()](/api/class-testinfo.mdx#tes

```js
import { test, expect } from '@playwright/test';
import fs from 'fs';
import * as fs from 'fs';

test('example test', async ({}, testInfo) => {
const file = testInfo.outputPath('temporary-file.txt');
Expand Down
2 changes: 1 addition & 1 deletion nodejs/docs/api/class-testinfo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Returns a path inside the [testInfo.outputDir](/api/class-testinfo.mdx#test-info

```js
import { test, expect } from '@playwright/test';
import fs from 'fs';
import * as fs from 'fs';

test('example test', async ({}, testInfo) => {
const file = testInfo.outputPath('dir', 'temporary-file.txt');
Expand Down
2 changes: 1 addition & 1 deletion nodejs/docs/api/class-testproject.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ Here is an example that uses [testInfo.outputPath()](/api/class-testinfo.mdx#tes

```js
import { test, expect } from '@playwright/test';
import fs from 'fs';
import * as fs from 'fs';

test('example test', async ({}, testInfo) => {
const file = testInfo.outputPath('temporary-file.txt');
Expand Down
10 changes: 5 additions & 5 deletions nodejs/docs/auth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Create `tests/auth.setup.ts` that will prepare authenticated browser state for a

```js title="tests/auth.setup.ts"
import { test as setup, expect } from '@playwright/test';
import path from 'path';
import * as path from 'path';

const authFile = path.join(__dirname, '../playwright/.auth/user.json');

Expand Down Expand Up @@ -162,8 +162,8 @@ Create `playwright/fixtures.ts` file that will [override `storageState` fixture]

```js title="playwright/fixtures.ts"
import { test as baseTest, expect } from '@playwright/test';
import fs from 'fs';
import path from 'path';
import * as fs from 'fs';
import * as path from 'path';

export * from '@playwright/test';
export const test = baseTest.extend<{}, { workerStorageState: string }>({
Expand Down Expand Up @@ -258,8 +258,8 @@ Alternatively, in a [worker fixture](#moderate-one-account-per-parallel-worker):

```js title="playwright/fixtures.ts"
import { test as baseTest, request } from '@playwright/test';
import fs from 'fs';
import path from 'path';
import * as fs from 'fs';
import * as path from 'path';

export * from '@playwright/test';
export const test = baseTest.extend<{}, { workerStorageState: string }>({
Expand Down
2 changes: 1 addition & 1 deletion nodejs/docs/chrome-extensions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ First, add fixtures that will load the extension:

```js title="fixtures.ts"
import { test as base, chromium, type BrowserContext } from '@playwright/test';
import path from 'path';
import * as path from 'path';

export const test = base.extend<{
context: BrowserContext;
Expand Down
2 changes: 1 addition & 1 deletion nodejs/docs/evaluating.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Next, add init script to the page.

```js
import { test, expect } from '@playwright/test';
import path from 'path';
import * as path from 'path';

test.beforeEach(async ({ page }) => {
// Add script for every test in the beforeEach hook.
Expand Down
6 changes: 3 additions & 3 deletions nodejs/docs/test-parameterize.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ To make environment variables easier to manage, consider something like `.env` f
```js title="playwright.config.ts"
import { defineConfig } from '@playwright/test';
import dotenv from 'dotenv';
import path from 'path';
import * as path from 'path';

// Read from ".env" file.
dotenv.config({ path: path.resolve(__dirname, '.env') });
Expand Down Expand Up @@ -402,8 +402,8 @@ See for example this CSV file, in our example `input.csv`:
Based on this we'll generate some tests by using the [csv-parse](https://www.npmjs.com/package/csv-parse) library from NPM:

```js title="test.spec.ts"
import fs from 'fs';
import path from 'path';
import * as fs from 'fs';
import * as path from 'path';
import { test } from '@playwright/test';
import { parse } from 'csv-parse/sync';

Expand Down
6 changes: 3 additions & 3 deletions nodejs/docs/webview2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ Using the following, Playwright will run your WebView2 application as a sub-proc

```js title="webView2Test.ts"
import { test as base } from '@playwright/test';
import fs from 'fs';
import os from 'os';
import path from 'path';
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import childProcess from 'child_process';

const EXECUTABLE_PATH = path.join(
Expand Down
Loading