Skip to content

Commit 6783a62

Browse files
authored
Merge branch 'master' into fix-275
2 parents 9a963af + d91ba6c commit 6783a62

File tree

4 files changed

+93
-0
lines changed

4 files changed

+93
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ phpunit.xml.bak
77
coverage/
88
node_modules/
99
vendor/
10+
/test-results/
11+
/playwright-report/
12+
/blob-report/
13+
/playwright/.cache/

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@
88
"less": "^4.2.0",
99
"less-plugin-clean-css": "^1.5.1",
1010
"uglify-js": "^3.17.4"
11+
},
12+
"devDependencies": {
13+
"@playwright/test": "^1.44.0",
14+
"@types/node": "^20.12.11"
1115
}
1216
}

playwright.config.ts

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import { defineConfig, devices } from '@playwright/test';
2+
3+
/**
4+
* Read environment variables from file.
5+
* https://github.com/motdotla/dotenv
6+
*/
7+
// require('dotenv').config();
8+
9+
/**
10+
* See https://playwright.dev/docs/test-configuration.
11+
*/
12+
export default defineConfig({
13+
testDir: './tests/e2e/',
14+
/* Run tests in files in parallel */
15+
fullyParallel: true,
16+
/* Fail the build on CI if you accidentally left test.only in the source code. */
17+
forbidOnly: !!process.env.CI,
18+
/* Retry on CI only */
19+
retries: process.env.CI ? 2 : 0,
20+
/* Opt out of parallel tests on CI. */
21+
workers: process.env.CI ? 1 : undefined,
22+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
23+
reporter: 'html',
24+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
25+
use: {
26+
/* Base URL to use in actions like `await page.goto('/')`. */
27+
// baseURL: 'http://127.0.0.1:3000',
28+
29+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
30+
trace: 'on-first-retry',
31+
},
32+
33+
/* Configure projects for major browsers */
34+
projects: [
35+
{
36+
name: 'chromium',
37+
use: { ...devices['Desktop Chrome'] },
38+
},
39+
40+
{
41+
name: 'firefox',
42+
use: { ...devices['Desktop Firefox'] },
43+
},
44+
45+
/* Test against mobile viewports. */
46+
// {
47+
// name: 'Mobile Chrome',
48+
// use: { ...devices['Pixel 5'] },
49+
// },
50+
// {
51+
// name: 'Mobile Safari',
52+
// use: { ...devices['iPhone 12'] },
53+
// },
54+
55+
/* Test against branded browsers. */
56+
// {
57+
// name: 'Microsoft Edge',
58+
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
59+
// },
60+
// {
61+
// name: 'Google Chrome',
62+
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
63+
// },
64+
],
65+
66+
/* Run your local dev server before starting the tests */
67+
// webServer: {
68+
// command: 'npm run start',
69+
// url: 'http://127.0.0.1:3000',
70+
// reuseExistingServer: !process.env.CI,
71+
// },
72+
});

tests/e2e/start.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test('test', async ({ page }) => {
4+
await page.goto('https://msls.co/');
5+
6+
await expect(page).toHaveTitle(/Multisite Language Switcher - WordPress multilingual/);
7+
await page.getByRole('link', { name: 'de_DE' }).click();
8+
9+
await expect(page).toHaveTitle(/Multisite Language Switcher - WordPress mehrsprachig/);
10+
await page.getByRole('link', { name: 'en_GB' }).click();
11+
12+
await expect(page).toHaveTitle(/Multisite Language Switcher - WordPress multilingual/);
13+
});

0 commit comments

Comments
 (0)