Questions tagged [cypress-testing-library]

Questions about Cypress end-to-end testing with the **Cypress Testing Library** utilities (a subset of the Testing Library).

Documentation can be found at Cypress Testing Library.

Testing Library provides additional testing commands to the Cypress framework.

214 questions
3
votes
1 answer

Cypress: Import line under commands.ts causes errors

When I add imports into the commands.ts, then I get errors by running the tests. commands.ts import 'cypress-localstorage-commands'; /* eslint-disable */ declare namespace Cypress { interface Chainable { commandA(); …
3
votes
2 answers

Cypress Cucumber, how Get to data from page in one step and use it another scenario step

Below is mine scenario where in one scenario I'm getting data from page and saving it in a variable as alias. tHen I want to use same variable/data in other scenario to put in an input field.I'm using Alias but getting this error. cy.wait() could…
3
votes
2 answers

Cypress - waiters for dependent sub elelemnts

I'm stuck with problem in cypress there is dynamic DOM:
Name1
Color1
Add
2
votes
1 answer

Cypress test setup for Azure AD B2C login with custom policy

Setup Azure AD B2C with custom policies (B2C_1A_SIGNIN) React frontend MSAL to implement the authentication (@azure/msal-browser: 2.37.0, @azure/msal-react:1.5.7) - using loginRedirect() (no MFA) Cypress (v12.5.1) for e2e tests What I did I…
2
votes
1 answer

Cypress: You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file

I'm an automation engineer trying to configure a cypress test inside an existing react application but I keep getting this error: ./cypress/e2e/googleSearch.feature 1:16 Module parse failed: Unexpected token (1:16) You may need an appropriate loader…
2
votes
0 answers

Where should I install Cypress? What are the limitations of running Cypress tests in it's own repo as opposed to within the main application repo?

I'm putting together a proof on concept for my team to make the move from Selenium over to Cypress to do E2E testing. We have front end and back end both in different repos and are deployed and released independently. I am trying to figure out where…
Joe Hale
  • 21
  • 2
2
votes
0 answers

How to avoid API requests shown when call npx cypress open?

I'm writing tests using Cypress for the UI of an application that has polling - it makes API requests every 2 seconds. I would like to run the tests in the --headed mode (by npx cypress open) and to see in the list only the steps that I wrote for…
2
votes
1 answer

cy.wrap().its()... doesn't work when the value in .its() contains a period

I am looking to extract a URL parameter from the current URL I'm testing with Cypress. I was able to basically get the answer from this SO post, however, my extracted values are not available to me when I use Cypress's .its() command. The parameters…
2
votes
1 answer

ERR_FAILED (-2) error when running npx cypress open

I have a barebone create-react-app with nothing but cypress installed through npm i cypress When I run npx cypress open I get this error: ERR_FAILED (-2) loading 'http://localhost:49770/__launchpad/index.html' Error: ERR_FAILED (-2) loading…
2
votes
1 answer

Using testing-library findby* queries with @badeball/cypress-cucumber-preprocessor

I have a react app that I'm trying to test with Cypress using the badeball/cypress-cucumber-preprocessor and testing-library but I'm getting the error cy.findByRole is not a function Here's my current setup: react-scripts: 5.0.1 typescript:…
2
votes
1 answer

Cypress.env() always returns undefined

I have my cypress.config.ts like this import { defineConfig } from "cypress"; export default defineConfig({ pageLoadTimeout: 360000, defaultCommandTimeout: 60000, env: { EMAIL: "random@mail.com", PASSWORD: "password" } }); And when…
2
votes
3 answers

Clicking on Links that doesn't contains href in cypress

I am automating my regression checklist and I am stuck in a test case in which I have to test a link that opens in a new tab, as Cypress doesn't support multiple tabs, so I want to open that link in the same tab. The problem is the button doesn't…
2
votes
0 answers

TeamCity Rest API Flaky test

I am looking to retrieve a list of flaky tests and details from builds via TeamCity API. I don't have any leads. Please suggest better options to retrieve flaky tests from TeamCity.
2
votes
1 answer

Hold and select multiple ag-grid rows cypress

I am trying to test the selection of multiple rows using drag and select through cypress. I have tried using all possible combinations of trigger commands however mousedown doesn't work together with mouseover, also the grids are not draggable but…
2
votes
1 answer

Cypress assert text while ignoring soft hyphens

I'm trying to E2E test a web application using cypress/cucumber. The page I'm testing has a H1 title I want to check the contents of. Normally I would use something like cy.get('H1').should('contain.text', 'some longpagetitle') However there is a…
1
2
3
14 15