Skip to main content

Questions tagged [playwright-test]

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

playwright-test
Filter by
Sorted by
Tagged with
1 vote
2 answers
42 views

Playwright API fixture gets timeout

I am trying to implement a fixtures helper file in Playwright so that certain data setup commands used by many tests can be better maintained v having all of these in every test spec that needs to ...
knr's user avatar
  • 11
0 votes
0 answers
16 views

Unable to run playwright tests in Jenkins

I am trying to run playwright tests using Jenkins pipeline. Here is the pipeline script: pipeline { agent any // Define the custom workspace directory environment { CUSTOM_WORKSPACE = 'C:\\...
Success Shrestha's user avatar
0 votes
0 answers
36 views

waitForUrl behaviour in Playwright

I am using page.waitForUrl method to wait for desired url. After clicking the submit button, I am trying to wait for url using page.waitForURL("/my-test-url/v1/foo/") but getting time out ...
Yoda's user avatar
  • 93
0 votes
0 answers
11 views

run vue playwright e2e tests in GitHub actions

While trying to write my CI using GitHub actions, This is one step that I'm not able to do, run the e2e tests. steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 ...
Rami Hassan's user avatar
0 votes
1 answer
15 views

PlayWright VS Code Inspector doesn't open inspector

I'm trying to record a test from the vs code extension. When I click on record new, it opens chromium and new file, but dosn't open any isnpector or something like this, and when I navigate it dosn't ...
delfosk9's user avatar
1 vote
0 answers
25 views

PerformanceObserver On Page Refresh

I have been using PerformanceObserver API with PlayWright to capture several metrics in my application which. My application has multiple browser instances on Button/link clicks. Metrics like FCP, LCP,...
harsha.cs's user avatar
  • 132
0 votes
1 answer
89 views

Using Playwright - how to test SVG image by d values?

In the website I'm automating, there are SVG images with icons. In once scenario, the SVG has a special arrow that points up and right. <svg class="SecretClass" focusable="false" viewBox="0 0 ...
Tal Angel's user avatar
  • 1,600
1 vote
1 answer
249 views

Playwright is not locating data-testId

I'm using data-testid to locate a title entry field on a page. The input field has the tag "createTitle", however when I use the getByTestId method to locate it, the element cant be found ...
sam evans's user avatar
0 votes
1 answer
32 views

Excel File is not getting downloaded using waitforEvent('download')

await this.page.waitForEvent('download').then(blobFile => { blobFile.saveAs(testFolder + '/' + testCaseFileName + blobFile.suggestedFilename()) this.page.waitForTimeout(10000); fs....
revathi jakkula's user avatar
1 vote
0 answers
38 views

How to switch between multiple videos as webcam mock in Playwright tests?

I'm working on a test automation project using Playwright where I need to simulate reading QR codes from the webcam. The test scenario involves reading QR codes from different video files. I'm trying ...
Ken Watanabe's user avatar
1 vote
1 answer
52 views

Is it possible to write a "isAlertDisplayed" method on a separate AlertHelper file?

I am trying to write a "isAlertDisplayed" method on a separate AlertHelper file using Playwright TypeScript. My test scenario is when a button is clicked for 5 seconds there is no alert. It ...
Ceyhun Ganioğlu's user avatar
0 votes
1 answer
123 views

How to log detailed output log for playwright tests while running in CI

I would like to output detailed playwright tests while running in CI using github actions. Following is my playwright.yml file. Something like this: jobSearch.spec.js:39:3 › Search functionality › ...
soccerway's user avatar
  • 11.4k
0 votes
2 answers
178 views

How to use Playwright fixture to modify or add custom command?

I want a custom Playwright command for page.goto called page.gotoDOM that automatically passes the waitUntil: 'domcontentloaded' parameter so I don't have to code it in every test. I have followed the ...
Michael Durrant's user avatar
1 vote
0 answers
27 views

Is there a way that playwright can run the teardown of a playwright project even if test gets interrupted by using cmd + c

projects: [ { name: 'citizen-users-teardown', testMatch: '**playwright/tests/bootstrap/users/citizen-users.teardown.ts', }, { name: 'citizen-users-setup', testMatch:...
kda_100's user avatar
  • 157
1 vote
0 answers
45 views

Is there a way to configure credit card details by visiting chrome://settings/payments?

When I try to visit chrome://setttings/payments I am getting error: Error: page.goto: Target page, context or browser has been closed Call log: navigating to "chrome://settings", waiting ...
Damaon's user avatar
  • 612
-1 votes
1 answer
41 views

Playwright - Page elements hierarchy [closed]

An HTML page is essentially a hierarchy of nested nodes. For example, I might have a panel that displays a dialog containing a form, and within that form, a confirmation button. When locating this ...
lmanske's user avatar
0 votes
1 answer
40 views

Playwright test failing: props return different values in Playwright testing UI and actual React app on Chrome browser

I am creating an e2e testing for my application using Playwright (version 1.44.1). I have a react 18 application (created with Vite) for a blogs app. When I run the application the UI shows correct ...
qqq's user avatar
  • 812
0 votes
0 answers
15 views

Change runsettings file for Cross Browser Testing in Playwright Dotnet

Is there any way for us to just change the runsettings file for Cross Browser Testing in Playwright with dotnet (any Test Runner)? I want each test to run in multiple browsers, so that each test is ...
Theophilus Timothy Ruben's user avatar
0 votes
2 answers
151 views

How to continue tests using existing browser session in Playwright with Typescript?

I am trying to use Page Object Model for Playwright UI tests. I have created a setup file for login, as this is always the first step in each test. import { test as setup, expect } from '@...
RShome's user avatar
  • 507
1 vote
0 answers
77 views

How to run tests in parallel in playwright having access to the test parameters

Playwright has documentation about how to parametrize tests from using project/fixture options: import { test as base } from '@playwright/test'; export type TestOptions = { person: string; }; ...
Danielo515's user avatar
  • 6,799
0 votes
0 answers
44 views

Not able to see context menu dialog on UI and trace mode (Playwright with Typescript)

Trying to verify and expect dialog messages. but can't able to visualize in ui and trace mode. it displays the page context menu dialog when I run & open the Chromium browser (VS code Extension). ...
Bhushan Trivedi's user avatar
0 votes
1 answer
46 views

How could I setup a single ws endpoint for multiple browsers in playwright?

Essentially, I'd like to run my playwright browsers in a container for a cloud application. The test options do offer the setting to setup a remote wsEndpoint but this is for each browser. Is it ...
Isaac Anatolio's user avatar
2 votes
1 answer
176 views

Playwright: Unable to capture URL address of a new tab in headless mode

The test fails in headless mode, but when mode is headless: false test passed. await productAttachment.element.click(); // this action opens a new page with a pdf attachment const newPage = await ...
Michał Ziętek's user avatar
1 vote
1 answer
273 views

Playwright: how to create a static utility method?

I'm trying to think of the best way to make a utility method that utilizes the page.waitForResponse from Playwright. See: https://playwright.dev/docs/api/class-page#page-wait-for-response Essentially, ...
msmith1114's user avatar
  • 3,071
0 votes
0 answers
47 views

Can't implement playwright in behave steps file

So In steps file I wrote this code and it just stops. Nothing really happens. It opens and closes down in seconds, I can't understand why? Error: raise Error("Event loop is closed! Is Playwright ...
AbdulRehman Rizwan's user avatar
0 votes
0 answers
13 views

Maintaining Parameters Across Page Redirections in Playwright Automation

Is it feasible to consistently append parameters to URLs in Playwright automation, ensuring they persist through redirects and subsequent page transitions? When initiating automation with a URL like ...
Gireesh K K's user avatar
1 vote
0 answers
130 views

After hooks in playwright takes time to finish

Playwright version: 1.43.1 I am currently investigating why some of my e2e tests are very slow; if it needs to be rewritten or just need to increase the default timeout. I recognize some tests that ...
Leicester Digitalis's user avatar
0 votes
0 answers
23 views

Unable to get textcontent of an element using page.evaluate

I am updating firstname and trying to verify it . I am unable to see the updated firstname in DOM but it is visible in UI. Below is the code I am using var updatedFirstName = await page.evaluate(() =&...
Saharsra's user avatar
0 votes
0 answers
55 views

Playwright (1.43.1) trace Viewer fails to render UI

I have encountered a weird issue while testing a specific page on a website. All the tests work as expected, capturing a screenshot to a file works fine, but at some point, after the page gets ...
Nisim Naim's user avatar
0 votes
0 answers
32 views

When script is in headless mode facing error: ERR_ABORTED; maybe frame was detached

[2024-04-12 13:22:30,522: INFO/ForkPoolWorker-8] Facing Error: ['Traceback (most recent call last):\n', ' File "/home/venv/lib/python3.10/site-packages/playwright/_impl/_frame.py", line ...
root2ja's user avatar
0 votes
0 answers
196 views

Playwright dotenv: Unable to pull values form env file

While integrating environment variables from a .env file at the project’s root directory into Playwright, I’ve encountered an anomaly where the variables are not being recognized during test execution,...
DarkShadows's user avatar
0 votes
2 answers
68 views

Playwright automation exception - Page.LocatorOptions().setHasText() giving 2 elements. How to identify uniquely

I am trying to select a value from an Angular dropdown using Playwright-Java. It is failing due to multiple values found. How to uniquely identify by text. getPage().locator(obj).click(); ...
rajesh k's user avatar
0 votes
0 answers
50 views

How to click button with Playwright without id [duplicate]

I am using Playwright to log into a site and extract some data. After logging in, I have to click a button to specify what type of user I am. There are two of these buttons, and after inspecting the ...
msb's user avatar
  • 3
0 votes
1 answer
576 views

Error: No tests found. Make sure that arguments are regular expressions matching test files

Got this error when I tried to run the playwright test in my vs code -- "Error: No tests found. Make sure that arguments are regular expressions matching test files. You may need to escape ...
Vithyatharan Surya's user avatar
0 votes
0 answers
18 views

Playwright sometimes reports false Pass in default report?

async clickSearchReult(context: Context, testInfo:TestInfo,enteredValue: string) { const [newPage] = await this.newWindowNavigate(context, enteredValue); //this.addNotestToAccount(...
ChanGan's user avatar
  • 4,346
0 votes
1 answer
68 views

Playwright - asserting expected validation is matching validation result

I have the following code for asserting that the validation error messages are matching with the elements text contents test('Assert validations are present on the checkout page', async ({ page }) =&...
Amar's user avatar
  • 45
0 votes
0 answers
47 views

Playwright integration with github: [WebServer] Error: supabaseUrl is required

Im'm new to Playwright and I have been struggling with the integration with github. On the jobs executed on github actions I have the following error after previous jobs are passed: Run npx playwright ...
ignacio rosenberg's user avatar
1 vote
0 answers
219 views

What is the difference between `expect(locator).toBeVisible()` and `locator.waitFor()` in Playwright?

I have seen examples of using await locator.waitFor(), to assert whether an element is visible on the page. I would like to know if it should be used this way. await locator.waitFor() await expect(...
kosteklvp's user avatar
  • 190
1 vote
1 answer
35 views

Page refreshes after clicking a button that updates the page; test/assertion times out with two headings but not one

https://youtu.be/dpYMGGSmRaw I created a simple test that clicks a button, which adds two headings to the pages. This works if I check the text with toHaveText(). However, if I check number of ...
Kai Xu's user avatar
  • 13
0 votes
0 answers
117 views

Avoid Authentication for Every Test in Playwright

Framework: Nodejs, typescript, Angular This is the setup of my test: Using fixture estimatePage in test.beforeAll. The estimatePage fixture used homePage fixture, where the authentication stage ...
diogenes31's user avatar
-1 votes
1 answer
107 views

Test timing out waiting for click when using Playwright

I am having trouble with my test not working when using playwright. After I run npm i playwright i proceed to create a new file called 'record1demo.spec.js' in my tests folder. I then run npx ...
user24412697's user avatar
0 votes
1 answer
219 views

Integrating Allure Reporting into Playwright Tests Azure Pipeline

I am practicing with Playwright automation and learning to integrate it with CI/CD pipelines in Azure. I have managed to create a Repo and Pipeline in Azure that runs my Playwright code, but I am a ...
Amar's user avatar
  • 45
0 votes
1 answer
127 views

Playwright test with file uploading says : Target is closed

I have a playwright test that consists in uploading a file. The test passes under my local environment (Windows, Playwright 1.35.1 with up-to-date deps) on both projects (Chromium and Firefox) ...
user24389190's user avatar
1 vote
0 answers
39 views

How to share the locators which are page constructor to other page in playwright?

export class AlertsPage { readonly page: Page; readonly alertsToBeApprovedTab: Locator; readonly alertsToBeReviewedTab: Locator; readonly allAlertsTab: Locator; readonly ...
ChanGan's user avatar
  • 4,346
2 votes
1 answer
135 views

How to execute test by exact name (equals) via command in playwright

I'm trying to execute a specific test by it's name. The problem is that when I'm executing npx playwright test -g "test" grep (-g) executes all test that has the given string ("test&...
I.sh.'s user avatar
  • 1,253
0 votes
1 answer
244 views

How to enable Camera and microphone permissions for Safari (webkit) and firefox using playwright?

For my automation test using playwright, my browser need to have camera and microphone permissions. I am able to grant it for chromium browser but unable to do it for Firefox and safari (webkit). ...
Bhawin Joshi's user avatar
0 votes
1 answer
246 views

Is there some command or api to see which browser version was installed for a specific playwright version?

I would like to know which browser versions where installed by Playwright after running npx playwright install —with-deps chromium firefox Is there some command to see that or is there some playwright ...
Thomas Haider's user avatar
0 votes
0 answers
73 views

How to run all the tests across all spec files on single browser instance?

In our scenario, all the tests across different spec file should run on one single browser context.I should open a browser and run all the test cases on the same browser session.How to achieve this ...
satish polisetty's user avatar
1 vote
2 answers
389 views

how to log request object in playwright API testing

I am using Playwright for API testing and to log request object in Playwright using the code below. I tried a few options but none of them worked. Can someone suggest how to do that? Thanks! test(&...
pk786's user avatar
  • 2,270
0 votes
0 answers
308 views

How to use custom Playwright Test Page fixture from separate repository with Typescript?

I am trying to create framework on top of playwright where custom fixtures and other methods can be there. All my tests related project can use framework repository. With that, I maintain a repository ...
Ankit Patel's user avatar

1
2 3 4 5
9