-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
458557c
commit 6342756
Showing
6 changed files
with
141 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { expect, test } from '@nuxt/test-utils/playwright' | ||
|
||
test.beforeEach(async ({ goto }) => { | ||
await goto('/about') | ||
}) | ||
|
||
test('page: about - shows correct title', async ({ page }) => { | ||
const headingContent = await page.textContent('h1') | ||
await expect(headingContent).toContain('about me') | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import type { ConfigOptions } from '@nuxt/test-utils/playwright' | ||
import { fileURLToPath } from 'node:url' | ||
import { defineConfig, devices } from '@playwright/test' | ||
import { isCI, isWindows } from 'std-env' | ||
|
||
export default defineConfig<ConfigOptions>({ | ||
testDir: './e2e', | ||
testIgnore: '**/features/**', | ||
fullyParallel: true, | ||
forbidOnly: !!isCI, | ||
retries: isCI ? 2 : 0, | ||
workers: isCI ? 1 : undefined, | ||
timeout: isWindows ? 60000 : undefined, | ||
reporter: 'html', | ||
|
||
use: { | ||
// trace: 'on-first-retry', | ||
nuxt: { | ||
rootDir: fileURLToPath(new URL('.', import.meta.url)), | ||
}, | ||
}, | ||
// ... | ||
// projects: devicesToTest.map(p => typeof p === 'string' ? ({ name: p, use: devices[p] }) : p), | ||
}) | ||
|
||
/** | ||
* See https://playwright.dev/docs/test-configuration. | ||
*/ | ||
/** | ||
* | ||
export default defineConfig({ | ||
use: { | ||
baseURL: 'http://localhost:3000', | ||
trace: 'on-first-retry', | ||
}, | ||
projects: [ | ||
{ | ||
name: 'chromium', | ||
use: { ...devices['Desktop Chrome'] }, | ||
}, | ||
// { | ||
// name: 'firefox', | ||
// use: { ...devices['Desktop Firefox'] }, | ||
// }, | ||
// { | ||
// name: 'webkit', | ||
// use: { ...devices['Desktop Safari'] }, | ||
// }, | ||
// { | ||
// name: 'Mobile Chrome', | ||
// use: { ...devices['Pixel 5'] }, | ||
// }, | ||
// { | ||
// name: 'Mobile Safari', | ||
// use: { ...devices['iPhone 12'] }, | ||
// }, | ||
// { | ||
// name: 'Microsoft Edge', | ||
// use: { ...devices['Desktop Edge'], channel: 'msedge' }, | ||
// }, | ||
// { | ||
// name: 'Google Chrome', | ||
// use: { ...devices['Desktop Chrome'], channel: 'chrome' }, | ||
// }, | ||
], | ||
webServer: { | ||
command: 'npm run dev', | ||
url: 'http://localhost:3000', | ||
reuseExistingServer: !process.env.CI, | ||
}, | ||
}) | ||
*/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
import { defineVitestConfig } from '@nuxt/test-utils/config' | ||
|
||
console.log('jojo') | ||
|
||
export default defineVitestConfig({ | ||
test: { | ||
environment: 'nuxt', | ||
exclude: ['**/e2e/**', '**/node_modules/**'], | ||
}, | ||
}) |