playwright/tests/installation/fixture-scripts/docker.spec.js
Andrey Lushnikov af042beb13
feat: introduce docker integration (#16382)
This patch introduces the following commands:
- `npx playwright docker build` that builds a VRT docker image
  locally that is based off the `mcr.microsoft.com/playwright:jammy`
- `npx playwright docker start` that launches a docker container with
  browsers.
- `npx playwright docker stop` that stops given docker container.
- `npx playwright docker test` that runs all the tests inside a
  launched docker container.
2022-09-09 15:25:42 -07:00

20 lines
725 B
JavaScript

const { test, expect } = require('@playwright/test');
test('platform', async ({ page }) => {
console.log('@' + page.context().browser().browserType().name(), await page.evaluate(() => navigator.platform));
});
test('userAgent', async ({ page }) => {
console.log('@' + page.context().browser().browserType().name(), await page.evaluate(() => navigator.userAgent));
});
test('screenshot', async ({ page }) => {
await expect(page).toHaveScreenshot('img.png');
});
test('localhost', async ({ page }) => {
expect(process.env.TEST_PORT).toBeTruthy();
await page.goto('http://localhost:' + process.env.TEST_PORT);
console.log('@' + page.context().browser().browserType().name(), await page.textContent('body'));
});