Questions tagged [cypress-custom-commands]

111 questions
1
vote
1 answer

Can't run test after installing cypress-if plugin

Once I installed cypress-if plugin and add import "cypress-if" to e2e file Cypress is down. I have this message error : > Cannot overwite the get query. Queries can only be overwritten with Cypress.Commands.overwriteQuery(). Until now, i didn't use…
1
vote
0 answers

Unable to fix the by default blank page of cypress updated version

After updating the cypress to latest version i'm geting this error However i added the testIsloation to false in cofigration file but I'm still getting this error can anyone please help
1
vote
0 answers

How fix red error line below cy. And cypress. Keyword

The red error line are coming below cy. And Cypress. Keywords. How to resolve that issue??? No error line will come below thhat keywords
1
vote
2 answers

Cypress auto submit on login page from beforeEach in second test

I'm working on a Cypress test for the Polish Wikipedia plugin, and I have this code in my cypress test: Cypress.Commands.overwrite('visit', (orig, path, options) => { return…
jcubic
  • 61,973
  • 54
  • 229
  • 402
1
vote
1 answer

Can Cypress record audio from tests to also play it in the produced video?

As stated in the title, is it possible to record audio from a website under test using cypress. For example from an audio tag or a youtube video. Such that it is audible in the video recorded by cypress.
1
vote
2 answers

how to dynamic select today date in cypress.command()?

I have a command where I can enter a specific date for start date, please see below a part of the command I am using. and when I am calling it in the test I need to enter a dynamic date like today <=(+30 days) cy.create123((new Date().getDate() -…
Fah
  • 207
  • 3
  • 16
1
vote
1 answer

How to log HTTP response header value for all cypress requests?

One of my ideas would be to overwrite the request command, but I don't know how to handle the response object. A snippet I already have: Cypress.Commands.overwrite( 'request', ( originalFn: Cypress.CommandOriginalFn<'request'>, …
1
vote
3 answers

How can I acess content of email triggered by a test in Cypress

An email is being sent in my case ( 1. When resetting the password, 2. Adding a New member) during both API and UI tests. How can I access these emails without actually logging into my mail manual and accessing the content, so I can add them to the…
1
vote
1 answer

how to extract a portion of string in cypress

my problem statement is i am getting a text out of element something like this "stock name: apple inc","stock id: 23244" i wanted to extract the text portion after ":" colon my…
1
vote
2 answers

how to validate comment-size text from the text inserted in the comment box using Cypress

hi folks as I am new to this automation/cypress world i need your help to handle this problem statement i have a comment box something similar to this i am able to put text inside this text with cy.get('#comments').type('TEST') but there is a…
1
vote
1 answer

Cypress: How to retrieve One-time Passcode from created virtual device on Mailosaur

I have a virtual device set up on Mailosaur, as seen below. Within this image, you can see the "Reveal One-Time Passcode" button. I have checked that the passcode works with the website I am working with, and now I am trying to create a Cypress…
1
vote
2 answers

how to return a value from custom command in cypress

hi folks i am new in ui/cypress automation i am trying to create a custom command which read a data from ui and return it to calling command where i can compare it with test data and validate the result e.g. for custom command in…
1
vote
2 answers

cypress actions - initialize component beforeEach hook

I have developed the following code on an index file Cypress.Commands.add('component', (name) => { let log = Cypress.log({ 'displayName': 'component', 'name': name }); cy .window({ log: false }) .then($win…
1
vote
4 answers

How to pass locator as parameter in cypress?

I wonder if it is possible to pass locators as a parameter to make my function reusable. I tried to do it myself but I am getting "undefined" instead of working test. Cypress error: cy.click() failed because it requires a DOM element. The subject…
1
vote
2 answers

How to return HTTP response body from Cypress custom command?

I am trying to write a custom Cypress command that sends a POST request to an endpoint, & I then want to store the response body in my test. Here is what the response body looks like in Postman: Here is my custom command in…
user9847788
  • 2,135
  • 5
  • 31
  • 79