I have a web page and there is a list with multiple elements: First type of element: Second type of element: As you can see the second one does not contain the “imstuck” class as well as the “Something” text. (this is an example, in real case the second line of code is nested deeper) I want to find out
I need to verify if the sum of two elements is equal to the result shown on the UI. Below is the html structure for the three elements and need to do the calculation on the h1 tags. Below is the code I am trying to execute but nothing comes up in the test. The test runs and passes but
I have the following code working and I’m able to login with username and password. I am working with Cypress to login to a webapp with MSAL. In the e2e Testfile: Command.js: Imported auth.js Got credentials in authSettings.json As you can see I am able to login with the credentials which were saved as variable in the authSettings.json file. This
so I want to be able to get “Text B” from the table below using Cypress but have tried many things and I can only get “Party B”. I have been using cy.get(div[class=”table”]).contains(div[class=”label”], “Party B”).click() to click on the text for “Party B”, but don’t know how to click on the other child of the same parent. Answer To get
I have the following plugin file for cypress: frontend/cypress/plugins/index.ts: When I run it on my machine it’s working but when I use cypress-io/github-action@v2 in my github actions I get the following error: This is my .github/workflows/cypress-tests.yml: My frontend/cypress.json config file is empty. This is my frontend/cypress/tsconfig.json in the cypress folder: This frontend/cypress/plugins/tsconfig.jsonis inside the Plugins folder: I have copied this
Issue occurs when I need to check for example that 11AM was 2hours before 1PM as my code takes difference as 10.(11 vs 1) as we have 12 hour time. Answer I notice you have the dayjs library. To handle parsing strings with various, add the customParseFormat plugin. Your dateString is passed into dayjs(dateString, format) as 1st parameter and format
I want to verify the checkbox is checked. This is the HTML for the checkbox the js for it: Then on step definition: strangely Cypress shows that the expected value was true but the value was true Answer You have to change true to ‘true’. The true is a string.
I am testing a react-leaflet based application in cypress. To avoid making tons of real maptile requests, I am trying to intercept calls to the mapbox maptile server, and replace with a dummy tile. I do this in my cypress/support.index.js file: A simple test: I took a look at Mock leaflet resources in Cypress, and this tactic seemed to work
Due to a lack of knowledge in JS, I do face with below problem. I do automation testing with cypress and for external API endpoints, I need to use Dynamic Token that expires every 3600 secs. I did some short research and find out that, for reaching to JWT Token I will need 1st SSO login (that my app has).