Questions tagged [cypress-task]
15 questions
4
votes
1 answer
snowflake-sdk: Module not found: Error: Can't resolve 'async_hooks' in 'C:\projectname\node_modules\vm2\lib'
I am trying to integrate Snowflake in my Cypress tests but it keeps on throwing error while compiling.
Error:
Error: Webpack Compilation Error
./node_modules/vm2/lib/resolver-compat.js
Module not found: Error: Can't resolve 'async_hooks' in…

sumitsingh13
- 63
- 5
3
votes
1 answer
Validating zip file using adm-zip and cypress throws out of memory error
I was trying to validate zip file contents using adm-zip and cypress, but cypress throws out of memory error. The Zip file could contain .txt or .pdf or .ppt or .docx files. I would like to validate below in the zip file:
a) no of files
b)…

soccerway
- 10,371
- 19
- 67
- 132
2
votes
2 answers
Cypress modify screenshot path = Error: EPERM: operation not permitted, rename
I am trying the code found in the cypress document which allows cypress user to modify screenshot path.
I tried the examples they have given but i am having an issue with the permission.
Error: EPERM: operation not permitted, rename…

Christian Rudolf Tan
- 21
- 4
2
votes
2 answers
Running Cypress with MSSQL- timing out
I want to clean a database before running my test cases and I'm just having issues with it running. It just times out and I don't understand - hopefully you can help me :)
In the test case I have the following code block:
beforeEach(() => {
…

Ame
- 47
- 6
1
vote
2 answers
How to loop cy.task according to the result
I'm testing the CRUDs for a page in my application, where a registry requires an unique ID as a 5 digit number to be successfully created.
I would like to get a random available ID of that table to use in the tests, that can be achieved with the…

Leomelzer
- 135
- 7
1
vote
1 answer
How can I send a report via nodemailer with Cypress?
What would be the best way to use nodemailer with Cypress? I've been playing with the code bellow for the while now but with no avail. I am getting an error "cy.task('sendMail') failed with the following error:
sendAnEmail is not a…

Dave Han
- 35
- 5
1
vote
1 answer
how to give a custom name for lighthouse report which is generated by cypress-audit package
I need to generate multiple lighthouse reports for multiple test scenarios. by using cypress-audit package I wrote a method for generating lighthouse report.
in below you can see that method
export function lighthouseAudit(scenarioId, baseValueData)…

yasith rangana
- 196
- 2
- 12
1
vote
1 answer
How to integrate Ethereal email service with Cypress 10
I am trying to integrate Ethereal email service with Cypress for Email testing.
I followed this example project
https://github.com/bahmutov/cypress-ethereal-email-example
This project is written for Cypress version < 10. I am trying to make it work…

Ashok Negi
- 21
- 2
1
vote
3 answers
Saving data from DB and then using it in body for API in cypress
I am trying to save a token from DB and pass the token in the next API request in the body I have written the below code but it's not working, please help.
it.only('Change Password', () => {
cy.ResetPassAPI(globalThis.data.dradminemail);//…

ruffainn
- 83
- 1
- 14
0
votes
1 answer
npm package chalk is not working with Cypress
I want to use https://www.npmjs.com/package/chalk for console logs.
Now if I use with console.log it works
console.log(chalk.blue("Hello World"))
but when I run it with cy.task it doesn't give any error but doesn't show any coloring
cy.task('log',…

paul
- 4,333
- 16
- 71
- 144
0
votes
1 answer
cypress - read excel file: xlsxlsx.read is not a function
I am getting this Excel file read error:
CypressError
cy.task('readXlsx') failed with the following error:
xlsx.read is not a function
I use cypress 12.7 with typescript
I wrote in the cypress.config.ts:
on("task", {
readXlsx({filePath,…

Jonas
- 166
- 1
- 13
0
votes
2 answers
function always return undefined value in cypress
this is the cypress test file
import { Given, Then } from "cypress-cucumber-preprocessor/steps";
import { quickSignIn } from "../../../support/services/commonServices";
import { storyTableViewResultColumnCheck } from…

yasith rangana
- 196
- 2
- 12
0
votes
1 answer
How to iterate through a table and extract the values from a row and assert using cypress
let values = []
cy.visit(url)
cy.get('selector')
.find('td')
.each(($el, $index) => {
cy.wrap($el)
.invoke('text')
.then(text => {
if ($index!==0) {
values.push(text.trim())
}
})
})
.then(() =>…

sarath kumar
- 11
- 1
0
votes
0 answers
Cypress test seeding/tearing, problem with "task"
i have tearAndSeed.js that uses fixtures (users.json) and tears/updates db with this users.json by running beforeEach cy.task
}).... i also have it registered in plugins.
While it updates db, it would not proceed with the rest of the test. I cant…

nansis92
- 1
- 1
0
votes
1 answer
How to fail cypress test from inside the Promise.prototype.catch() block?
I'm using a node library to execute api calls for test data setup and teardown. The library works as follows:
someApiServiceObject
.executeApiCall({... parameters})
.then(doSomethingWithResults())
.catch(() => {
// Here I would like to fail the…

Rehalus
- 17
- 4