Questions tagged [playwright-test]

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

329 questions
1
vote
1 answer

Playwright tests inside docker fails to load fonts

Currently I have Playwright tests that I am running inside Docker container both locally and in the CI. Unfortunately the tests fail on the CI with screenshot comparison error. Upon investigation I can see that the fonts on the CI screenshots are…
1
vote
1 answer

Playwright-Getting text from locator element

I am trying to grab just the order number in the h1

Order #1004066
Sundar
  • 11
  • 3

1
vote
1 answer

Switch context to new page in Playwright (c#)

I want to create a method to Click on given element and open it in new tab. I manage to open new tab on click: public async Task ClickMenuItemNewTab(string menuItem, string section, string header) { var context =…
1
vote
1 answer

How to get the value from a span tag using javascript or playwright tool?

I have a span tag where we have a value 2 which keeps changing. I want to store this value in a variable either using javascript or playwright (a testing tool). 2 Note: Even class name…
1
vote
0 answers

how to generate playwright report of web vitals performance checks for different network conditions

I want to generate a playwright report for one of the test cases for slow 3g and other different network conditions but as a result, I need the FCP,LCP, and other metric results in HTML Report to be generated which I am not able to achieve…
ali
  • 492
  • 2
  • 7
  • 18
1
vote
0 answers

How to map custom report ts file from node library in playwright.config.ts?

I came across custom report feature in Playwright(node js). I would like to use the custom-reporter.ts class from the external node library installed. Please help me to know, How to map that file in Playwright.config.ts? (playwright.config.ts) …
1
vote
3 answers

How to give Fixed wait in playwright With out any condition Like we had in cypress : Cy.wait(600)

How to give Fixed(Implicit Wait) wait in playwright With out any condition Like we had in cypress : Cy.wait(600); Thank You Like we had in cypress : Cy.wait(600);
pratap88bhanu
  • 31
  • 1
  • 2
1
vote
1 answer

Playwright resolve relative path outside test directory

I have this problematic import. import * as Collection from '../../lib/collection.js' root > lib >> collection.js > tests >> folder1 >>> collection.spec.js how can resolve this relative path with something like import * as Collection from…
Tadas V.
  • 775
  • 1
  • 11
  • 22
1
vote
1 answer

PlayWright Electron: Is it possible to get BrowserWindow from Page?

I'm trying to find the electron window object that contains the loaded page. I want to take the following action: let window1 : BrowserWindow | null = null let window2 : BrowserWindow | null = null electronApp.on("window", async (page) => { …
Nikhil
  • 181
  • 1
  • 15
1
vote
0 answers

npm install after run the playwright image for docker getting below error

npm ERR! Tracker "idealTree" already exists npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2022-11-19T05_41_58_533Z-debug-0.log I am setting up docker to execute playwright test
1
vote
1 answer

playwright-test: test that input is required

I have an input for a login form that is required:
J. Hesters
  • 13,117
  • 31
  • 133
  • 249
1
vote
1 answer

Playwright configuration: POM fixtures for projects

I need to configure Playwright to use different POM fixtures for different project settings. All examples I find configure the POM while extending the base test. This works, but this way Playwright would use the same POM fixture for all…
Reynicke
  • 1,407
  • 1
  • 11
  • 21
1
vote
0 answers

re-use new page object for each test

So I am using playwright/test with Typescript I have a testapp.ts setup which contains all my methods eg for logging in, navigating etc Inside my test example.spec.ts each test looks like this: const testapp = new TestApp(page); await…
1
vote
0 answers

How to wait until one of the multiple conditions becomes true in Playwright

In playwright is there a way for waiting until one of specified condition becomes true similar to one in webdriverio : browser.waitUntil( () => this.twoFactorHeader.isExisting() === true || this.tosTitle.isExisting() === true ||…
1
vote
1 answer

how to run the test using the right browser and device?

I need to assign specific browsers and devices to multiple tests. How to indicate this in the test? Chromium Android, Pixel 5 device WebKit Desktop for Mac And won't there be a conflict with the fact that I already have settings in the…