117 questions
1
vote
1
answer
84
views
Cannot test throwing error inside event handler using Jest and Puppeteer
I'm trying to test that a particular element's event listener successfully throws an error. I want to catch the error so that my test does not automatically fail, but I'm not able to for some reason.
...
0
votes
1
answer
60
views
Jest/puppeteer test fails when importing helper function
I'm bumping into an issue importing a helper function, which calls Puppeteer methods, into a test file. I've created a simplified example of my problem.
I have a test in a file called my-test.test.js:
...
0
votes
1
answer
99
views
Puppeteer - Unable to select an input box based on -p-aria and -p-text
I am automating an web application and I need to type in a value in an input text box.
My plan is to develop an friendly function, where in if I pass the label associated with the text , I should be ...
0
votes
1
answer
61
views
Starting the Server to Test an Express-Backed React App Using jest-puppeteer
I have an express server that serves a React app for GET requests and runs other processing for POST. I'm using light-my-request to test all of the POST functionality. The server.js file contains the ...
0
votes
1
answer
184
views
Cannot access puppeteer Proxy in my Jest test (TypeError: Cannot read private member #frameManager from an object whose class did not declare it)
What could be the reason of me not being able to access the Proxy of the CustomPage class in my test file? I get this error...
enter image description here
const puppeteer = require("puppeteer&...
-3
votes
1
answer
657
views
Stuck on generating a coverage report for the e2e test
I have written E2E tests using Jest, Puppeteer, and ReactJS for a Chrome extension. And I am not getting how can I generate its coverage report. Nothing seems to be working.
I tried generating ...
0
votes
1
answer
1k
views
Running tests in parallel on GitHub does not generate Allure report for all test file. Only generate for the last test file
When I run these tests locally or in sequence on GitHub it generate Allure Report but when I run it parallel using three different GitHub instance it generate only result for the last executed test ...
0
votes
0
answers
3k
views
Puppeteer TimeoutError: Navigation timeout of 90000 ms exceeded
I'm running into a timeout error when using Puppeteer to navigate to a heavy website with lots of videos. I've increased the timeout to 690000 ms using page.goto(), and set the default navigation ...
1
vote
1
answer
406
views
jest puppeteer how to use setTimeout
I am a newbie at running Jest puppeteer.
I'm trying to run a test suite locally that I did not write.
All the tests fail to run and I get this error pointing at beforeEach...
"beforeEach(async () ...
0
votes
1
answer
492
views
How to run all my puppeteer tests in a single tab with jest-puppeteer?
I setup jest-puppeteer and it was really easy to make it work, and it is fast enough for what I was looking for.
The issue that I am having is that, at the moment I have two tests and both have the ...
0
votes
2
answers
398
views
reset puppeteer's page for each test
I'm running jest tests using puppeteer. On some of them I manually add some specific css styles and other tweaks like the following:
const content = `
*,
*::after,
*::before {
...
1
vote
1
answer
554
views
How can i use Extent report with puppeteer-Jest automation similar to Selenium
I am using Puppeteer for UI automation with jest Framework.
i had worked previously selenium and used extend report i want similar kind of reporting with puppeteer.
Is there a way i can use extent ...
0
votes
0
answers
2k
views
Puppeteer timeout on waitforselector
So I created my first web scrapper with Puppeteer and it works fine. I call the scrapper function in my server at 5mins time intervals but after calling it a couple times about 10 to 15 times, i begin ...
1
vote
0
answers
91
views
Run test cases with Device emulators in Puppeteer
I have 10 test cases in jest (Note: all tests are in .test.ts extension, for eg: frontPageTest.test.ts). I want to run the 10 test cases in Desktop view first, then the 10 test cases should run in ...
2
votes
1
answer
255
views
Using Jest with Puppeteer : EReferenceError : xxx is not defined
when learn puppeteer/jest, many tutorial articles example are the same,like:
const timeout = 10000;
beforeAll(async () => {
await page.goto(URL, { waitUntil: "domcontentloaded" });
})...
1
vote
2
answers
2k
views
Storyshots doesn't work on local storybook-static folder
Problem Summary
Storybook snapshot test on static storybook returning blank screenshots even though they look fine on localhost:8080 when I ran npx http-server storybook-static
Tech stack and relevant ...
0
votes
0
answers
187
views
Make multiple API calls with Jest-environment-Puppeteer
How to intercept multiple http requests (API calls) with jest & puppeteer environment?
I have the following code but I get error Request already handled when I make more than one API call.
Code:
...
1
vote
1
answer
717
views
How to not skip tests in a suite upon failure?
I have a large number of tests, contained in "suites" or files, probably about 10-15 tests in each suite. The issue I'm having is that if the first test in a suite fails, then it just skips ...
-1
votes
2
answers
1k
views
Why does puppeteer headless testing open browser?
I thought I understood what headless was in jest-puppeteer. I understood it to be a way to run tests without running through the tests in the browser. When I look at this documentation headless ...
1
vote
1
answer
1k
views
How to setup jest and puppeteer to work with a react app?
I want to use jest and puppeteer to do e2e testing on a react app. I want the dev server to start up as part of the command to start the tests. In other words, I dont want to have to start the dev ...
2
votes
0
answers
699
views
Running test directly in the browser context
I have recently started to write some tests using jest and I need to run some code in a real browser, so I decided to go with jest-puppeteer, the problem I have with the package is when we use jsdom ...
0
votes
0
answers
1k
views
Read a page stylesheet and check a specific property with puppeteer
What I am trying to do is:
Load the page
Gain access to the contents of an external css named "mystyle.css"
Check if ".some_class" border has the value "2px"
I have ...
1
vote
1
answer
458
views
Jest calls async jest.config.ts twice
In my Typescript repository containing Puppeteer UI tests, i have a jest.config.ts file that was recently updated to export an async object because we had to make api calls to fetch information that ...
2
votes
1
answer
683
views
Building and starting 2 apps in GitHub Actions using jest-puppeteer causes issue reading environment variables
I have a Next.js app with a separate Express API.
I Want to run an e2e test using Jest with puppeteer in Github Actions to automatically build and run both apps and then test them.
Building, running ...
0
votes
0
answers
47
views
Button is clicked, but no js code is triggered
I have a stepwizard where the next button triggers a post request before navigating to next the step.
await page.click('[data-test-next-step]');
await page.waitForSelector(['data-test-address-...
0
votes
0
answers
123
views
How to transverse from parent element to child element in puppeteer
<div class="MuiGrid-root jss62 MuiGrid-item MuiGrid-grid-xs-12"><div class="MuiGrid-root jss107" style="background: linear-gradient(to left, rgb(244, 67, 54) 40%, lightgrey 150%); box-shadow: ...
0
votes
1
answer
753
views
Puppeteer: How to write XPath for button in puppeteer
var eleLoginButton = await page.waitForXPath("//input[@class='._ant-btn._ant-btn-primary']")
await eleLoginButton.click()
My Code is not getting Excuted if I have written it like this.
0
votes
2
answers
589
views
XPath with ancestor returning the parent, not the node expected
I have the following code
<div class="editor-options">
<div class="editor-item">
<label>Name</label>
<input type="text" ...
1
vote
1
answer
311
views
Unable to run Jest Snapshot tests with jest-puppeteer
I just added jest-puppeteer to include it in my testing suites. Part of the setup is to remove testEnvironment:"jsdom" in my jest.config.js according to https://github.com/smooth-code/jest-...
0
votes
1
answer
197
views
Fixtures (JSON file) for UI Testing
Has anybody used fixtures (json file) to load the data in postgres database and execute UI testing ?
1
vote
0
answers
1k
views
how to catch loaded script errors using puppeteer
im currently trying to catch an error occured by injected script.
what ive done
const path = require('path');
const puppeteer = require('puppeteer');
describe('Test page', () => {
it('should ...
0
votes
0
answers
51
views
I am trying to automate homepage of paytm using jest-puppeteer but test is getting failed with out any error. And getting passed with puppeteer
The scenario is like:
Go to : https://paytm.com/
Click on signup button [frame window will be opened]
click on watchVideo button
click on close button
close the frame by clicking on X button.
note: ...
6
votes
2
answers
930
views
Jest-Puppeteer test randomly fails without output
I have the following testcase:
it('User can logout', async () => {
await helper.navClick('.header-user-action__logout');
const url = page.url();
console.log(url)
await expect(url)....
2
votes
2
answers
2k
views
How to tune Typescript StencilJS with Jest to support ES6 dynamic module imports
Many Similair questions here (...), but none that help me to get a pure Stencil configuration. The config-administration should be left to Stencil as much as possible IMO (...)
My Stencil component ...
1
vote
1
answer
1k
views
Puppeteer: how to listen for http responses until you get to the right one?
Goal:
I am writing a Puppeteer test which needs to listen for a certain response, check that the response url is of a certain format, and then save the response so that the values in the body can be ...
1
vote
0
answers
278
views
Webscrape testing on a text field with jest-puppeteer
I am attempting to write a test using Jest and puppeteer for an email field. The problem is that I cannot seem to figure out how to get this test working. What I want to test is that if a user types ...
2
votes
0
answers
790
views
how to get WSendpoint of a puppeteer-cluster browser
in a project that requires:
Starting each session with logging in credentials + notification/OTP
work with multiple accounts asynchronously
remote debugging or monitoring of the session
5+ different ...
1
vote
2
answers
736
views
how do you loop through checkboxes using puppeteer?
I have a list of checkboxes , every time puppeteer run the test I need to :
if a box is already selected then
move to next box and select it , and if the next is selected move to the next checkbox ...
4
votes
1
answer
65
views
Is it possible to enable in browser settings 'On startup - Continue where you left off' with Puppeteer?
I need to open a browser and switch to the current page (e.g. stackoverflow.com) then close the browser and open it again with this saved page (e.g. stackoverflow.com).
I know that in the browser ...
0
votes
1
answer
369
views
Trouble-shooting "Cannot use import statement outside a module"
I am trying to use puppeteer for e2e testing on a react app. I'd prefer to use TypeScript, so I've tried to start with a file that begins with:
import puppeteer, { Browser, Page } from "puppeteer&...
2
votes
1
answer
3k
views
How to check the disabled property on an element handle in puppeteer?
I am having the code as given below:
let btns = await page.$$(".move-to-preview-env");
let addToRepl = await btns[0];
let moveBtn = await btns[1];
console.log('addtoRepl ', addToRepl) // I ...
2
votes
0
answers
952
views
how set geolocation to block in chrome using puppeteer
I am looking for a way to respond block when being asked about sharing my location
I got to the point that I do
const context = browser.defaultBrowserContext();
context.clearPermissionOverrides();
I ...
0
votes
1
answer
371
views
The puppeteer closes the page after an error
While testing my page, an error is thrown from the dependency. The error is not critical and does not interfere with my application. But when testing with a puppeteer, with this error, he simply ...
1
vote
0
answers
164
views
switch extension toggle button
I'm working on automation project , and I need to know how to use puppeteer-Jest to check if the chrome extension is enabled or disabled?
if the extension is enabled run these steps , if not run other ...
0
votes
1
answer
254
views
How to target multiple identical "input[type="file"]" in Pupeteer?
I have a page in pupeteer in which I'm trying to initiate a file upload and it has to uploading buttons. the problem is both buttons that initiate the file upload have the same type and selector. This ...
0
votes
0
answers
617
views
How can I work with Jest and puppeteer-cluster
I am currently doing 40+ tests (they can take up to 20+ minutes and will grow unfortunately) for a web-app, and was thinking of running multiple browsers in order to run tests in parallel.
I am ...
5
votes
0
answers
514
views
Jest testing errors after upgrading to Big Sur
After upgrading to Big Sur, some of my jest tests throws this error. It also spams the console with
Chromium[29916:572689] Warning: Expected min height of view: (<NSButton: 0x7ffe74b9ac90>) to ...
0
votes
1
answer
399
views
Automated browser testing with puppeter and jest
I came across one big issue combining puppeteer with jest. Whenever I hit "npm run test" this test fails displaying: "Timeout - Async callback was not invoked within the 5000 ms timeout ...
0
votes
1
answer
612
views
Puppeteer script with jest is failing with Error: Cannot find module 'P:\jest\bin\jest.js'
I am trying to run a simple puppeteer script with jest.
Below is my package.json contents:
{
"name": "jest-puppeteer-project",
"version": "1.0.0",
&...
2
votes
0
answers
469
views
Snapshots tests locally vs on Percy
I have a problem with snapshot testing.
Tests I take locally are generating snapshots that look like they supposed to (i.e a table in the right place, popups, etc..). But then when Percy.io runs the ...