Skip to content

Commit caac417

Browse files
committed
Merge branch '1102-simple-playwright-test' of https://github.com/w3bdesign/nuxtjs-woocommerce into 1102-simple-playwright-test
2 parents f3c2e64 + f4d26cf commit caac417

File tree

2 files changed

+20
-26
lines changed

2 files changed

+20
-26
lines changed

playwright.config.ts

+16-22
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineConfig, devices } from '@playwright/test';
1+
import { defineConfig, devices } from "@playwright/test";
22

33
/**
44
* Read environment variables from file.
@@ -10,7 +10,7 @@ import { defineConfig, devices } from '@playwright/test';
1010
* See https://playwright.dev/docs/test-configuration.
1111
*/
1212
export default defineConfig({
13-
testDir: './tests',
13+
testDir: "./tests",
1414
/* Run tests in files in parallel */
1515
fullyParallel: true,
1616
/* Fail the build on CI if you accidentally left test.only in the source code. */
@@ -20,31 +20,31 @@ export default defineConfig({
2020
/* Opt out of parallel tests on CI. */
2121
workers: process.env.CI ? 1 : undefined,
2222
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
23-
reporter: 'html',
23+
reporter: "html",
2424
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
2525
use: {
2626
/* Base URL to use in actions like `await page.goto('/')`. */
2727
// baseURL: 'http://127.0.0.1:3000',
2828

2929
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
30-
trace: 'on-first-retry',
30+
trace: "on-first-retry",
3131
},
3232

3333
/* Configure projects for major browsers */
3434
projects: [
3535
{
36-
name: 'chromium',
37-
use: { ...devices['Desktop Chrome'] },
36+
name: "chromium",
37+
use: { ...devices["Desktop Chrome"] },
3838
},
3939

4040
{
41-
name: 'firefox',
42-
use: { ...devices['Desktop Firefox'] },
41+
name: "firefox",
42+
use: { ...devices["Desktop Firefox"] },
4343
},
4444

4545
{
46-
name: 'webkit',
47-
use: { ...devices['Desktop Safari'] },
46+
name: "webkit",
47+
use: { ...devices["Desktop Safari"] },
4848
},
4949

5050
/* Test against mobile viewports. */
@@ -75,16 +75,10 @@ export default defineConfig({
7575
// reuseExistingServer: !process.env.CI,
7676
// },
7777

78-
79-
/* Run your local dev server before starting the tests */
80-
webServer: {
81-
reuseExistingServer: true,
82-
command: 'npm run dev',
83-
port: 3000,
84-
},
85-
86-
87-
88-
89-
78+
/* Run your local dev server before starting the tests */
79+
webServer: {
80+
reuseExistingServer: true,
81+
command: "npm run dev",
82+
port: 3000,
83+
},
9084
});

tests/index.spec.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { test, expect } from '@playwright/test';
1+
import { test, expect } from "@playwright/test";
22

3-
test('Has Index title', async ({ page }) => {
3+
test("Has Index title", async ({ page }) => {
44
//await page.goto('https://playwright.dev/');
5-
await page.goto('/');
5+
await page.goto("/");
66

77
// Expect a title "to contain" a substring.
88
await expect(page).toHaveTitle(/Index - Nuxt 3 Woocommerce/);
9-
});
9+
});

0 commit comments

Comments
 (0)