Category : playwright

Locally, I can do the following: import { test, expect } from ‘@playwright/test’; test(‘should work’, async ({ page }) => { await page.goto(`https://playwright.dev`); expect(await page.screenshot()).toMatchSnapshot(‘test.png’); }); npx playwright test –update-snapshots This works fine, but I want to generate the files via Docker so they’re the same as when they run in CI. On the docs, ..

Read more

I want to use Google Chrome’s built in webkitSpeechRecognition API from a Node.js application by managing a headless Playwright browser. This set-up works fine if I am running the app from my machine: Playwight browser gets opened, and i can access the window.webkitSpeechRecognition object SpeechRecognition succesfully get’s initialized: recognition = new SpeechRecognition() then I can ..

Read more

I m trying to create .net 5.0 docker image with playwright, my image build properly but when i run my app using dotnet run ‘ProjectName’ it fails while executing command: await using var browser = await playwright.Chromium.LaunchAsync(new BrowserTypeLaunchOptions { Headless = false, Args = new[] { "–disable-dev-shm-usage" } }); Received error: Unhandled exception. Microsoft.Playwright.PlaywrightException: Browser ..

Read more

I am trying to use playwright with a python package, but playwright gives me this error while running: Executable doesn’t exist at /home/.cache/ms-playwright/webkit-1564/pw_run.sh When I run docker build -t fetch_post_service . The logs inidcate the missing files are downloaded to root, and not home: Playwright build of chromium v930007 downloaded to /root/.cache/ms-playwright/chromium-930007 Playwright build of ..

Read more

I’m trying to run end-2-end tests in docker in headless mode and getting playwright._impl._api_types.Error: net::ERR_CONNECTION_REFUSED at http://app/. It happends only in chromium and firefox. Webkit works but there are also problems with finding selectors. E2E tests passed when i run them from localhost. Requests succeed when I make them from localhost. Also requests succeed when ..

Read more

I`m trying to create .net 5.0 docker image with playwright. This is my DockerFile: FROM mcr.microsoft.com/dotnet/runtime:5.0-buster-slim AS base WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build WORKDIR /src COPY ["Agent.csproj", "Agent/"] RUN dotnet restore "Agent/Agent.csproj" COPY . "/src/Agent" WORKDIR "/src/Agent" RUN apt-get update -yq && apt-get upgrade -yq && apt-get install -yq curl git nano RUN curl ..

Read more

Getting some errors after I’ve wrapped my Playwright project in a Docker image. I’m using Firefox in Playwright. Dockerfile FROM mcr.microsoft.com/playwright:next WORKDIR /app COPY package.json package-lock.json ./ RUN npm ci COPY . . RUN npx playwright install CMD ["node","index.js"] Package.json dependencies "@extra/humanize": "^4.2.2-next.616", "playwright": "^1.15.0", "playwright-extra": "^4.2.1-next.616" index.js const { firefox } = require(‘playwright’); (async ..

Read more

I’m trying to capture a screenshot in my github action and am following the steps as so: My actions.yml looks like: name: Fetch data on: ‘push’ jobs: test: runs-on: ubuntu-latest steps: – uses: actions/[email protected] – uses: ./ and my Dockerfile is: FROM node:16-alpine COPY ./ ./ WORKDIR ./ RUN npm install ENTRYPOINT [ "node", "/src/action.js" ..

Read more

I am trying to execute the karate script in mcr.microsoft.com/playwright:bionic docker container . I have exposed the port 5900 as shown below but not sure how to get the playwrighturl for the mcr.microsoft.com/playwright:bionic docker container ? do i need to execute the "node server.js" inside mcr.microsoft.com/playwright:bionic docker container to get websocket endpoint. Kindly clarify ! ..

Read more