Questions tagged [playwright-test]

playwright-test is the official test runner of playwright and is especially made for end-to-end testing.

329 questions
3
votes
2 answers

Electron desktop Application testing with[PLAYWRIGHT]

I'm attempting to use playwright to automate an electron js application, but I can't seem to find any relevant information. To automate a simple programme, I used playwright:- https://playwright.dev/docs/api/class-electron and…
3
votes
1 answer

How to execute my playwright tests in Azure DevOps Test Plans

I am trying to use Azure DevOps TestPlans in our organisation but I didn't find any option to run my Playwright tests in Azure Test Plans. Any suggestions if I can somehow manage to execute my playwright tests? I am expecting to run my automated…
3
votes
3 answers

Playwright test drag

I am working on this template where I am using dragTo() function for dragging and dropping. When I run my tests on headed mode, it works fine. But when I run the tests in headless mode, it simply wont drag anything and the test will pass with the…
user9857359
  • 57
  • 1
  • 6
3
votes
1 answer

In Playwright, can't use page.goto with headless webkit

I'm trying to write a test for a Drupal website in Playwright. I'm running on Ubuntu 20.04 via WSL2. I set a base url (https://www.example.com) in my Playwright config file. I have a few simple steps: await this.page.goto('/user/logout'); await…
Patrick Kenny
  • 4,515
  • 7
  • 47
  • 76
3
votes
1 answer

Playwright upload file on non-input element

So I'm currently trying to automate uploading a profile photo on an Electron App using Playwright and I'm running into issues with 'filechooser' event. await windowA.click('data-testid'); const [fileChooser] = await Promise.all([ …
3
votes
0 answers

Playwright is not running tests on Selenium Grid + Docker

I'm trying to run some Playwright (Node.js) tests on Docker through Selenium Grid, but the tests are failing because of timeout. Chrome is apparently not starting. Locally without Docker everything is fine. According to the Playwright documentation,…
3
votes
3 answers

Playwright: Failed to Read the localStorage property from Window: Access is denied for this document

I have this script to modify localStorage of my browser instance (assuming all definitions are correct). it returns this Error. I have a feeling that this is because Playwright is launching a browser in incognito mode. Is there a way for me to…
MagsTester
  • 35
  • 1
  • 1
  • 3
3
votes
1 answer

Playwright SelectOption is not selecting a value

When attempting to use page.SelectOption with Playwright, im getting an issue where my chosen value is not being selected, it doesnt matter if I use index, value, or label to try to select. I know the selector is being found as when I debug using…
OrdinaryKing
  • 411
  • 1
  • 7
  • 16
3
votes
1 answer

globalSetup to reference baseUrl from playwright.config

Im currently using a global-setup.ts file to load a url via playwright. await page.goto('https://test1.com/'); I am also doing extra code inside here and storing the state of my object (All works as expected) My playwright.config.ts file references…
OrdinaryKing
  • 411
  • 1
  • 7
  • 16
3
votes
1 answer

How to move from jest with user journey like tests to @playwright/test using fixtures?

Personally I see playwright as a tool that goes into the direction of system/end-to-end tests. So I used playwright + jest to build-up user journeys and integrated them in a CI/CD process. Since playwright created it's own test runner with useful…
ysfaran
  • 5,189
  • 3
  • 21
  • 51
2
votes
2 answers

In playwright asserting for the existence of a text in a element

There is an element that loads up after a few seconds the form is submitted(page doesn't reload after submission). I want to assert that this element has some text value in it. Value doesn't matter but there should be some text in the…
utkarsh-k
  • 836
  • 8
  • 17
2
votes
1 answer

Custom message for failed assertion in playwright (using cucumber.js)

In project I use node js 20.5.1, playwright 1.37. with cucumber 8.0.0. I want to add own customer message if expected method return me a failed. I thought I could do it like below: expect(3),"My custom message").toBeLessThanOrEqual(2); And in test…
Marcin
  • 97
  • 7
2
votes
2 answers

locator.waitFor: Target closed in Playwright error even though the "Wait" handled

Im trying to implement Playwright/TS Page Object Model framework for a web app. So in this case Im automating login successful scenario by asserting user can see the Dashboard text. But Im getting the following error. Error: locator.waitFor: Target…
2
votes
1 answer

E2E Playwright (JS, TS): how can i wait a loader disappear when have more than 1 element on page? it's need to wait all elements

(JS) I'm trying to wait a loader (div class="loader" data-testid="form-loader") disappear on my page. The test is failing because the loader doesn't allow saving the form but my methods isn't working. I too have tried to use a function and…
2
votes
1 answer

How can I take a screenshot of a full page with Playwright (visual comparison)?

I'm trying to capture a full page screenshot for visual regression with Playwright. Per their docs, it can be done like so: import { test, expect } from '@playwright/test'; test('example test', async ({ page }) => { await…
Kode_12
  • 4,506
  • 11
  • 47
  • 97
1 2
3
21 22