Questions tagged [jest-puppeteer]
121 questions
1
vote
1 answer
ReactJS Jest Puppeteer tests no longer working: ReferenceError: document is not defined
Scenario
npm test used to work without issue. Over the course of a month or so (I neglected tests) something changed and now I receive ReferenceError: document is not defined when trying to run Jest-Puppeteer tests via npm test.
This error shows up…

Jacksonkr
- 31,583
- 39
- 180
- 284
1
vote
1 answer
Run tests with Multiple Configurations on jest and playwright
I am currently attempting to run automation tests with playwright and jest. I am trying to load multiple configurations(browsertype, resolution, device, url) from a csv file and run tests based on each configuration or test case. Does jest and…

SWarr
- 139
- 2
- 9
1
vote
2 answers
Pupeteer click on bootstrap card
I'm trying to use puppeteer to write react tests but having hard time click on elements, except simple buttons and links. I'm trying to click on a bootstrap (reactstrap) card (or the image/text inside it) to add an item to a cart. Then I have to…

Caner
- 1,448
- 23
- 38
1
vote
0 answers
Jest-Puppeteer testing multiple cases in one file
I just got into puppeteer testing and I have no problem writing one test case where chromium opens a new tab to a website and test the signup process. But when I try to add another test case where I test the sign in process, I have problem getting…

Scooby Doo
- 11
- 1
1
vote
2 answers
Jest-Puppeteer > Trying to get textContent of last h4 on page
I am trying to get the textContent of the last h4 on a page.
Following is my code snippet.
when I console.log models.length it is 0. There are actually 39 h4s on the page.
Please advise
page.waitForNavigation({ waitUntil: 'networkidle0' })
…

Steven Greenbaum
- 311
- 4
- 17
1
vote
1 answer
Jest-Puppeteer Why warning "Jest did not exit one second after the test run has completed
I finally got my first jest-puppeteer test to pass. - code below.
However I am getting the warning shown.
Jest did not exit one second after the test run has completed.
This usually means that there are asynchronous operations that weren't stopped…

Steven Greenbaum
- 311
- 4
- 17
1
vote
1 answer
Spying on puppeteer calls
I'm building a web scraper that uses puppeteer. I'd obviously like to ensure that I don't break things as I work the kinks out and so I'm writing some implementation tests.
How would I go about testing out the code below? The issue is that…

Justin Young
- 2,393
- 3
- 36
- 62
1
vote
0 answers
jest-puppeteer: Access IndexedDB from window
I'm trying to access indexedDB from the window object, however I keep getting the below error.
DOMException: Failed to execute 'open' on 'IDBFactory': access to the Indexed Database API is denied in this context.
This is how I am trying to do…

user2302566
- 181
- 3
- 13
1
vote
1 answer
Puppeteer finds the element in the wrong tab
When ever I tried to click on the product, it opens in a new tab, where I perform text content operation. It returns null as puppeteer is searching the element in wrong tab
const puppeteer = require('puppeteer');
(async () =>…

Rajesh G
- 473
- 3
- 6
- 20
1
vote
1 answer
Run Jasmine tests (coupled to DOM/jquery etc) via command line for CI
We have a set of Jasmine tests that run successfully in the local web server. http-server.
We would like to run these tests from the command line during the TeamCity build process without having to start a webserver.
Opening the html file with…

Alper
- 663
- 1
- 7
- 24
1
vote
1 answer
Is there a way to run test scripts one after another using puppeteer as i don't want each js file to be big
I've 2 test files, test1.js and test2.js. I want to run them in sequence, test 1 then run test2. Is there a way to do it?

Vishnu
- 11
- 2
1
vote
2 answers
Puppeteer: find iframe by class
I'm using Puppeteer with Jest and I'm trying to get the iframe element using this function:
const frame = await page
.frames()
.find(f => f.name() === 'iframe-class');
The problem is: is there a way to get the iframe by his class instead of the…

Victor
- 724
- 3
- 12
- 32
1
vote
0 answers
Puppeteer: How to scrape data on Refresh Page From Multiple Pages/Tabs
I have Below code to scrape data from one page
page.on('load',() => {
console.log('load event fired');
});
This code will work for only one Tab/Page. I need to find solution for Multiple Pages/Tabs

NA NA
- 41
- 3
0
votes
0 answers
IntelliSense doesn't recognize objects within global_this
I'm trying to deploy the Jest-Puppeteer-example from The Jest documentation here on my machine. While the test functions without a problem, IntelliSense does not seem to correctly interpret the global_this.__BROWSER_GLOBAL__ from setup.js as a…

Brillenschlumpf
- 39
- 1
- 7
0
votes
1 answer
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 file.
on:
workflow_dispatch:
jobs:
build:
…

Shadow Walker
- 31
- 7