docs/test-configuration: Update code snippet (#10355)

This commit is contained in:
Nav-2d 2021-11-18 15:38:18 -08:00 committed by GitHub
parent c470080aec
commit 82edd1f4b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -92,11 +92,11 @@ The same works inside describe.
// example.spec.js
const { test, expect } = require('@playwright/test');
test.describe('headed block', () => {
// Run tests in this describe block in headed mode.
test.use({ headless: false });
test.describe('locale block', () => {
// Run tests in this describe block with specified locale.
test.use({ locale: 'en-US' });
test('my headed test', async ({ page }) => {
test('my locale test', async ({ page }) => {
// ...
});
});
@ -106,11 +106,11 @@ test.describe('headed block', () => {
// example.spec.ts
import { test, expect } from '@playwright/test';
test.describe('headed block', () => {
// Run tests in this describe block in headed mode.
test.use({ headless: false });
test.describe('locale block', () => {
// Run tests in this describe block with specified locale.
test.use({ locale: 'en-US' });
test('my headed test', async ({ page }) => {
test('my locale test', async ({ page }) => {
// ...
});
});