Created
October 19, 2023 18:35
-
-
Save CodeDredd/ba99de4b46a15bcb861485782ecf7bce to your computer and use it in GitHub Desktop.
Full e2e test example with nuxt 3
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
import { fileURLToPath } from 'node:url'; | |
import { describe, test } from 'vitest'; | |
import { expect } from '@playwright/test'; | |
import { setup, createPage } from '@nuxt/test-utils'; | |
describe('Landing page', async () => { | |
await setup({ | |
rootDir: fileURLToPath(new URL('..', import.meta.url)), | |
server: true, | |
browser: true, | |
}); | |
test.each([ | |
{ slug: '/mietwagen/usa/' }, | |
{ slug: '/mietwagen/usa/miami/' }, | |
{ slug: '/mietwagen/alamo/' }, | |
{ slug: '/mietwagen/frankreich/' }, | |
{ slug: '/mietwagen/portugal/algarve/' }, | |
{ slug: '/mietwagen/portugal/faro/' }, | |
{ slug: '/mietwagen/hertz/' }, | |
{ slug: '/mietwagen/italien/rom/' }, | |
])('with slug $slug has button', async ({ slug }) => { | |
const page = await createPage(slug); | |
const button = page.getByRole('button', { | |
name: 'Mietwagen suchen', | |
}); | |
await expect(button).toBeVisible(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment