Codeceptjs+puppeteer tests are hanging if testing application is down #3017
Replies: 2 comments 1 reply
-
I'm fairly sure this is a puppeteer issue, but you can solve it adding a custom helper and using this function instead of class CustomHelper extends codecept_helper {
// find a better name for this function
amOnLocalPage(url, timeout) {
const { page } = this.helpers.Puppeteer;
return Promise.race([
page.goto(url),
new Promise((_, reject) => {
setTimeout(() => {
page._client.send('Page.stopLoading').then(reject);
}, timeout);
}),
]);
}
}
module.exports = CustomHelper; In your module.exports = function() {
return actor({
async login(user) {
I.amOnLocalPage('/signin', 2000);
... |
Beta Was this translation helpful? Give feedback.
0 replies
-
I fixed this when added await for checks in async login in steps_file.js |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Sometimes when I run tests my testing application is down, but I don't know about it. I waited that my tests will fail
My tests are hanging and will never end
Details
steps_file.js
Beta Was this translation helpful? Give feedback.
All reactions