Skip to content

Instantly share code, notes, and snippets.

@CodeDredd
Created October 19, 2023 18:35
Show Gist options
  • Select an option

  • Save CodeDredd/ba99de4b46a15bcb861485782ecf7bce to your computer and use it in GitHub Desktop.

Select an option

Save CodeDredd/ba99de4b46a15bcb861485782ecf7bce to your computer and use it in GitHub Desktop.

Revisions

  1. CodeDredd created this gist Oct 19, 2023.
    29 changes: 29 additions & 0 deletions landingpages.spec.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    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();
    });
    });