Questions tagged [playwright-test]

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

329 questions
0
votes
1 answer

Playwright extraHTTPHeaders authentication is throwing 403 for API testing

Postman works: In Postman, I use the below to generate the accessToken. It works fine and I am able to run the subsequent requests. { "userLoginData": { "email": "abc@abc.com", "password": "abc" } } Playwright, not…
williamtell
  • 301
  • 5
  • 17
0
votes
1 answer

generating multiple reporting folder in playwright

I'm trying to generate multiple reporting folders inside a folder for JUnit and HTML reports, seems like playwright will override the other folder. after tests, I can see only the HTML report folder and other JUnit results won't be available. is…
Sujith
  • 163
  • 1
  • 1
  • 7
0
votes
1 answer

Playwright lighthouse integration - Error: Cannot find module 'lighthouse/report/generator/report-generator'

I'm trying to implement Playwright tests with lighthouse to get performance metrics. using library and using the sample code - https://github.com/abhinaba-ghosh/playwright-lighthouse. but I'm getting error, please refer attached image.
0
votes
1 answer

Playwright: Asserting DOM after printer dialog opens

I am looking to make assertions on the DOM once I open the printer dialog option on a PDFjs page What I am looking to do: Load the page (https://mozilla.github.io/pdf.js/web/viewer.html) Wait for the .page class divs to load (waitFor({ state:…
kmancusi
  • 591
  • 3
  • 20
0
votes
1 answer

Playwright Javascript Testing Locator function

I'm trying to use Playwright with Javascript and struggling to get the page.locator (https://playwright.dev/docs/locators) function to work. I've created the file testLocator.js that I run with node .\testLocator.js in the command terminal of visual…
Todd Baker
  • 41
  • 1
  • 9
0
votes
1 answer

Exporting a Test To Another File?

I have a file structure that looks like this Folder Structure I have a file called "login.js" that will contain a function that logs into the page. Currently it looks like this // login.js const { chromium } = require('playwright'); async…
0
votes
0 answers

TypeScript Playwright: Saving Storagestate via Sign in via API request and then using inside BowserContext does not work - takes me back to login page

I need to decide whether to go with Playwright as an E2E Automation tool or not. The following piece of code using backend API for sign in is working fine. But when I use the saved Storagestate file inside the BrowserContext, then it fails to sign…
Ashis Raj
  • 53
  • 4
0
votes
1 answer

How to pass a variable dynamically to a URL in playwright page.goto function?

I want to pass a variable in the URL, here is my code: url_id = ["253443","456545"] for id in url_id : print("Inside For loop", id) # this print the correct id (253443) …
0
votes
1 answer

How to create multiple html reports in playwright for multiple spec files ? Kindly assist

I'm fairly new to Playwright, and I'm stuck and unable to generate HTML reports. I'm using basic playwright report (index.html) which gets updated every time in run a different spec file. Also if I share the index.html file, the other person cannot…
0
votes
1 answer

Playwright cant find a located file using a wsl

I want to upload a file using playwright, but as I'm using a wsl, I don't know where I should put the file, for sure not in the windows folder, but where? Cause I tried to put it in the mounted disk in ubunbtu, but it isn't editable, I'm using…
Niky
  • 27
  • 5
0
votes
0 answers

Failed to load extension and manifest file is missing or unreadable while trying to test Chrome extensions with Playwright

I am trying to add a Chrome extension to Chromium using Playwright. Use Playwright docs for that purpose with pretty small amendments. path_to_extension = "/Users/name/projects/test_me/src/my_extensions/mm.crx" user_data_dir =…
0
votes
0 answers

E2E test Code coverage for the application using Playwright in .NET

I have E2E testing using playwright in . NET core 6 application. Is there any way to get the report for code coverage. There is a way for JS application https://playwright.dev/docs/api/class-coverage Using the package…
San Jaisy
  • 15,327
  • 34
  • 171
  • 290
0
votes
1 answer

Can we run IP based testing for geo location in playwright?

Playwright provides geolocation support using latitude and longitude, however it only changes location at client. In my use-case, I need IP address needs along with APIs and urls so fetch and render content based on IP address
0
votes
0 answers

Playwright : waitForResponse timesout even when the api call has actually completed successfully

I am using Blazor WebAssembly SPA app. WaitForResponse is failing with TimeoutError, even when before the timeour API has completed successfully. On click of button, my app makes an API call. What am i doing wrong here ? await Promise.all([ …
NSS
  • 1,835
  • 2
  • 29
  • 66
0
votes
1 answer

How can I generate a constant (JS) in Playwright without changes while passing all the tests

I tried const randomName = (Math.random() + 1).toString(36).substring(2); export const NEW_PERSONALIZATION_NAME = randomName; If the test is passed, everything is fine. If the test fails, the constant is generated again. Look at my screen How can I…
Leonid
  • 1
  • 2