https://cypress.io logo
Join Discord
Powered by
# e2e-testing
  • b

    brash-scientist-28014

    11/24/2022, 10:00 AM
    expects a new page (load), but there is no new page loading
  • e

    enough-fireman-4779

    11/24/2022, 2:22 PM
    any ideas how am I suppose to click on december? Is the only button that is not disabled, i've tried with "should('no.to.be.disabled') but still nothing... i'm not sure if i am writing it correctly.
  • e

    echoing-painting-40909

    11/24/2022, 2:31 PM
    Hi please provide the related cypress code you used to click on it.
  • e

    echoing-painting-40909

    11/24/2022, 2:32 PM
    About
    should('no.to.be.disabled')
    , the syntax should be
    should('not.be.disabled')
  • e

    enough-fireman-4779

    11/24/2022, 2:54 PM
    I was selecting the current month, but after the 10th of current it's getting disabled! so i need to click on the next one ``cy.get('[type="button"]').should('not.be.disabled').click()`
  • e

    enough-fireman-4779

    11/24/2022, 2:56 PM
    when i'm trying to find through it's class it's not working either..
  • e

    echoing-painting-40909

    11/24/2022, 2:57 PM
    cy.get('[type="button"]')
    will retrieve all available buttons. try
    cy.get('[type="button"]:not(disabled')
  • e

    enough-fireman-4779

    11/24/2022, 3:00 PM
    for some reason
    cy.get('[type="button"]:not(disabled')
    also finds all buttons even if there are not disabled 🤔
  • e

    echoing-painting-40909

    11/24/2022, 3:02 PM
    sorry:
    cy.get('[type="button"]:not(:disabled')
  • e

    enough-fireman-4779

    11/24/2022, 3:04 PM
    cool this looks fine!
  • e

    echoing-painting-40909

    11/24/2022, 3:05 PM
    Mind there is only one button matching your case as we are past the 10th of november. Trying it in January will return multiple buttons, so you might want to filter with
    first()
    for example.
  • e

    enough-fireman-4779

    11/24/2022, 3:06 PM
    yeap, is there any code also for last?
    last()
    or something?
  • e

    echoing-painting-40909

    11/24/2022, 3:07 PM
    yes: https://docs.cypress.io/api/commands/last
  • e

    enough-fireman-4779

    11/24/2022, 3:36 PM
    thank you very much Gerome! it works!!
  • a

    acceptable-fall-11897

    11/24/2022, 4:58 PM
    I want to do some clearing up after all .spec files have been run by Cypress. For this I created another .spec file that does several API calls. I need Cypress to run this .spec file only after all tests form all the other files have ran. One more thing, my .spec files are being run by Cypress in parallel mode, via 4 machines. I found out there are the "after" hooks I could use, but as far as I read, these hooks apply per only one .spec file, not all of them and I read about after run but please note that the docs page says: "When running via cypress run, the event will fire each time cypress run executes. As a result, if running your specs in parallel, the event will fire once for each machine on which cypress run is called.
  • g

    gray-kilobyte-89541

    11/24/2022, 5:50 PM
    https://glebbahmutov.com/blog/spy-on-clipboard-copy/
  • g

    great-oil-15113

    11/25/2022, 12:53 AM
    thanks. i had a try, but our app is using
    import { Clipboard } from '@angular/cdk/clipboard';
    to implement copy. the window clipboard is not called. how do i verify this? thank you
  • r

    rough-jordan-79228

    11/25/2022, 9:01 AM
    Hey community, I already searched the Web for a solution. My problem: I want cypress to assert this number -> 1 500 [it has a spave between 1 and 500 or if you want  ] I tried: .should("contain", "1 500") .filter(":contains('1 500')") .filter(":contains('1 500')")
  • r

    rough-jordan-79228

    11/25/2022, 9:02 AM
    But nothing worked - what am i doing wrong?
  • f

    fresh-doctor-14925

    11/25/2022, 9:06 AM
    You tried
    .should('contain.text', '1 500')
    If that doesn't work, could you share a screenshot of the error as well as the browser console showing the element you want to get and assert on?
  • r

    rough-jordan-79228

    11/25/2022, 9:07 AM
    I will try that - thx
  • r

    rough-jordan-79228

    11/25/2022, 9:38 AM
    @fresh-doctor-14925
  • r

    rough-jordan-79228

    11/25/2022, 9:40 AM
    Sry for the Bad quality
  • r

    rough-jordan-79228

    11/25/2022, 9:40 AM
    Had to make a photo
  • f

    fresh-doctor-14925

    11/25/2022, 9:40 AM
    I love these kinds of errors 😅 I wonder if it's some weird whitespace or something so the strings don't properly match What happens if you copy the
    4 999,00
    directly from the app and place that into your cypress assertion
  • r

    rough-jordan-79228

    11/25/2022, 9:42 AM
    Same result
  • r

    rough-jordan-79228

    11/25/2022, 9:42 AM
    xD
  • f

    fresh-doctor-14925

    11/25/2022, 9:43 AM
    hahaha Alright, new tactic: what does the span look like in the developer console?
  • f

    fresh-doctor-14925

    11/25/2022, 9:46 AM
    Does
    cy.contains()
    work instead? Looking at this issue https://github.com/cypress-io/cypress/issues/9531
  • r

    rough-jordan-79228

    11/25/2022, 9:56 AM
    Cy.contains work - had to separate the asserts but it finds them and asserts them right - thx you a lot
1...152153154...192Latest