From f980c8ebd3ac6d9504c02558205cadc0ec8cbaaf Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 10:11:17 +0000 Subject: [PATCH] feat(roll): roll to ToT Playwright (20-02-25) --- nodejs/docs/api/class-testconfig.mdx | 2 +- nodejs/docs/api/class-testinfo.mdx | 2 +- nodejs/docs/api/class-testproject.mdx | 2 +- nodejs/docs/auth.mdx | 10 +++++----- nodejs/docs/chrome-extensions.mdx | 2 +- nodejs/docs/evaluating.mdx | 2 +- nodejs/docs/test-fixtures.mdx | 2 +- nodejs/docs/test-parameterize.mdx | 6 +++--- nodejs/docs/webview2.mdx | 6 +++--- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/nodejs/docs/api/class-testconfig.mdx b/nodejs/docs/api/class-testconfig.mdx index ce0e03ca7f7..687c9d23edb 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 * as fs from 'fs'; +import 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 c75a2d36510..f8e567bd10b 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 * as fs from 'fs'; +import 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 c5fd79f9a49..009b1e59069 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 * as fs from 'fs'; +import 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 faffed9e258..9a8cebcbe99 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 * as path from 'path'; +import 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 * as fs from 'fs'; -import * as path from 'path'; +import fs from 'fs'; +import 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 * as fs from 'fs'; -import * as path from 'path'; +import fs from 'fs'; +import 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 f4b6a78d30e..58600712ef4 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 * as path from 'path'; +import path from 'path'; export const test = base.extend<{ context: BrowserContext; diff --git a/nodejs/docs/evaluating.mdx b/nodejs/docs/evaluating.mdx index 87e33f7121d..267da3f6866 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 * as path from 'path'; +import path from 'path'; test.beforeEach(async ({ page }) => { // Add script for every test in the beforeEach hook. diff --git a/nodejs/docs/test-fixtures.mdx b/nodejs/docs/test-fixtures.mdx index c63a63c4ea3..459ecf66080 100644 --- a/nodejs/docs/test-fixtures.mdx +++ b/nodejs/docs/test-fixtures.mdx @@ -421,7 +421,7 @@ Here is an example fixture that automatically attaches debug logs when the test ```js title="my-test.ts" import debug from 'debug'; -import * as fs from 'fs'; +import fs from 'fs'; import { test as base } from '@playwright/test'; export const test = base.extend<{ saveLogs: void }>({ diff --git a/nodejs/docs/test-parameterize.mdx b/nodejs/docs/test-parameterize.mdx index b2c315d11fd..69eca6dcb0e 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 * as path from 'path'; +import 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 * as fs from 'fs'; -import * as path from 'path'; +import fs from 'fs'; +import 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 dfb87c18d64..88f8b4d7f47 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 * as fs from 'fs'; -import * as os from 'os'; -import * as path from 'path'; +import fs from 'fs'; +import os from 'os'; +import path from 'path'; import childProcess from 'child_process'; const EXECUTABLE_PATH = path.join(