Skip to content
Snippets Groups Projects
Select Git revision
  • a25403d4cc92b187c2fda9d8b4a9d7673bd17b83
  • main default protected
2 results

screenshot.spec.js

Blame
  • screenshot.spec.js 1.00 KiB
    const playwright = require('playwright');
    const { test} = require('@playwright/test');
    
    test("Screenshot Marketingseite", async({ page }) => {
        await page.goto("https://www.tatort-game.de/index.html");
        await page.screenshot({ path: "screenshots/tatort-game-startseite.png", fullPage: true });
    })
    
    test("SWR Logo", async({ page }) => {
        await page.goto("https://www.swr.de/index.html");
        await page.locator('#header-main-navi-header').screenshot({ path: 'screenshots/swr/navbar.png' });
    })
    
    test("SWR Logo - multipel", async({ page }) => {
        for (const browserType of [playwright.chromium, playwright.webkit, playwright.firefox]) {
            const browser = await browserType.launch();
            const context = await browser.newContext();
            const page = await context.newPage();
            await page.goto('https://www.swr.de/index.html');
            await page.locator('#header-main-navi-header').screenshot({ path: `screenshots/swr/${browserType.name()}-navbar.png` });
            await browser.close();
          }
    })