diff --git a/nodejs/docs/api/class-testconfig.mdx b/nodejs/docs/api/class-testconfig.mdx index d329973b4e6..bd6013c89d8 100644 --- a/nodejs/docs/api/class-testconfig.mdx +++ b/nodejs/docs/api/class-testconfig.mdx @@ -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'); diff --git a/nodejs/docs/api/class-testinfo.mdx b/nodejs/docs/api/class-testinfo.mdx index f8e567bd10b..c75a2d36510 100644 --- a/nodejs/docs/api/class-testinfo.mdx +++ b/nodejs/docs/api/class-testinfo.mdx @@ -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'); diff --git a/nodejs/docs/api/class-testproject.mdx b/nodejs/docs/api/class-testproject.mdx index 009b1e59069..c5fd79f9a49 100644 --- a/nodejs/docs/api/class-testproject.mdx +++ b/nodejs/docs/api/class-testproject.mdx @@ -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'); diff --git a/nodejs/docs/auth.mdx b/nodejs/docs/auth.mdx index 9a8cebcbe99..faffed9e258 100644 --- a/nodejs/docs/auth.mdx +++ b/nodejs/docs/auth.mdx @@ -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'); @@ -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 }>({ @@ -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 }>({ diff --git a/nodejs/docs/chrome-extensions.mdx b/nodejs/docs/chrome-extensions.mdx index 58600712ef4..f4b6a78d30e 100644 --- a/nodejs/docs/chrome-extensions.mdx +++ b/nodejs/docs/chrome-extensions.mdx @@ -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; diff --git a/nodejs/docs/evaluating.mdx b/nodejs/docs/evaluating.mdx index 267da3f6866..87e33f7121d 100644 --- a/nodejs/docs/evaluating.mdx +++ b/nodejs/docs/evaluating.mdx @@ -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. diff --git a/nodejs/docs/test-parameterize.mdx b/nodejs/docs/test-parameterize.mdx index 69eca6dcb0e..b2c315d11fd 100644 --- a/nodejs/docs/test-parameterize.mdx +++ b/nodejs/docs/test-parameterize.mdx @@ -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') }); @@ -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'; diff --git a/nodejs/docs/webview2.mdx b/nodejs/docs/webview2.mdx index 88f8b4d7f47..dfb87c18d64 100644 --- a/nodejs/docs/webview2.mdx +++ b/nodejs/docs/webview2.mdx @@ -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(