https://cypress.io logo
Join DiscordCommunities
Powered by
# e2e-testing
  • m

    mysterious-belgium-25713

    10/10/2022, 6:02 PM
    Also why i like the cypress approach better is i don't need to wait until webdriver opens the browser and navigates a page. In Cypress it opens cypress that is your browser does a healthcheck to see the url is reachable and then you start your tests
  • l

    limited-barista-33480

    10/10/2022, 6:10 PM
    @mysterious-belgium-25713 ok, I understand you and it is true that cypress does not require webdriver, what is happening to me is that when I perform the manual test in chrome and before that I execute a bash to enable some fields, it does it well. But when I do it automatically, the test does the same as it does when it is done manually, but the fields are not enabled. then therein lies the problem. and I think that when running in cypress with chrome it does not do it well.
  • m

    mysterious-belgium-25713

    10/10/2022, 6:14 PM
    Maybe you can give us more details on the manual steps you are doing including the execute a bash to enable fields. Maybe other people can also help if we have a bit more details of the manual steps and maybe also results.
  • l

    limited-barista-33480

    10/10/2022, 6:17 PM
    @mysterious-belgium-25713 ok give it perfect, I'm going to share some images of the manual test and the automated test so you can see the comparison
  • l

    limited-agency-13286

    10/10/2022, 7:55 PM
    Hi team I updated my cypress version to 10.7.0. Previously I have multiple-cucumber-reporter. How can I generate a html report for my cypress cucumber scenarios? Any help would be appreciated?
  • v

    victorious-father-41976

    10/11/2022, 6:02 AM
    Hi team I updated my cypress version to
  • c

    careful-cpu-45530

    10/11/2022, 8:07 AM
    Hey. I want to check a page for links to product collections, then visit each collection page and check it for products. When the test visits these pages,
    cy.get
    cannot find anything in the DOM. I am new to Cypress, so maybe my assumptions about how thing work are wrong. The code is in the comment.
    • 1
    • 1
  • b

    busy-dusk-58025

    10/11/2022, 9:32 AM
    Hello! I need some help. My app have some feature. This feature works if an element have attribute A or B. There is no methods to test this feature else to check existence A or B attribute (exist, but very difficult, flaky and PM says that attr check will be enough). Is exist method like: cy.get('#element').should('have.arrt', A or B) Regex is doesn't works.
  • q

    quick-school-90424

    10/11/2022, 10:02 AM
    Hello everyone. I am having trouble after migrating to version 10 of Cypress. I have been using Cucumber with Cypress. And I have also been using the Gherkin keywords Given, Then, and When. I was using 'And' alongside some of those key words, but ever since I have updated to version 10, I have been getting the error in the image provided. Is 'And' not supported anymore in Gherkin? Has anyone ever come up against an issue like this? Here is a link to my question on Stack Overflow for more detail: https://stackoverflow.com/questions/74017436/cypress-when-using-cucumber-on-cypress-version-10-the-gherkin-keyword-and-do Thanks. 🙂
  • m

    mysterious-belgium-25713

    10/11/2022, 10:10 AM
    This is not because of cypress 10. You also updated the cucumber plugin. In the release notes its said they removed the And statement
  • m

    mysterious-belgium-25713

    10/11/2022, 10:14 AM
    v13.0.0 Add a very rudimentary way of diagnosing validity of steps, IE. whether each step is matching one, and only one, step definition, fixes #754. Remove And and But from the public API, fixes #821. Output snippet suggestions upon missing step definition, fixes #799.
  • q

    quick-school-90424

    10/11/2022, 10:19 AM
    Ahh yes, I can see that in the release notes now. Thank you for the heads up.
  • g

    gray-kilobyte-89541

    10/11/2022, 11:29 AM
    it seems like a not very deterministic test, but you can write any kind of assertion yourself by using
    should(callback)
    https://glebbahmutov.com/cypress-examples/9.7.0/commands/assertions.html#should-with-callback-function
  • b

    busy-dusk-58025

    10/11/2022, 12:22 PM
    We found this solution: cy.get('#element').then(($field) => { let isAExist = haveAttr($field[0].attributes, 'A') let isBExist = haveAttr($field[0].attributes, 'B') if (isAExist == false && isBExist == false) { expect(true).to.be.equal(false) console.log("There is no attr") } console.log("Attr exist") })
  • g

    gray-kilobyte-89541

    10/11/2022, 12:53 PM
    you can just throw an error
  • m

    mysterious-belgium-25713

    10/11/2022, 12:54 PM
    I have been reading along today but the haveAttr is that a function you created yourself?
  • b

    busy-dusk-58025

    10/11/2022, 12:56 PM
    Oh. I'm forgot about this. There: function haveAttr (object, attrName) { let isHave = false for (let j = 0; j < object.length; j++) { if (object[j].name == attrName) { isHave = true break } } return isHave }
  • m

    mysterious-belgium-25713

    10/11/2022, 12:56 PM
    Thx i thought there was something missing 🙂
  • n

    nutritious-army-46708

    10/11/2022, 1:12 PM
    Does Anyone know how to download a pdf file? The download button in my app will show a second tab (D2000.pdf). I need to click the download button in the second tab. The problem is cypress could not show the second tab in the main test screen. Thank you so much! I already tried cy.get('.btn-basic').invoke('removeAttr', 'target').click(), it could not work.
  • g

    gray-father-52711

    10/11/2022, 2:32 PM
    Hi, I need some help. I have an app that after visiting the base URL it fetches some endpoint. The GET request was called three times. The issue was fixed and the request is called only once. I want to write Cypress test that will spy on the request and confirm that was called only once. How to do it? Any ideas?
  • f

    fresh-doctor-14925

    10/11/2022, 2:39 PM
    Yeah, you can do that using
    cy.spy()
    Copy code
    cy.intercept('/api/v1/tradeareas/states'), cy.spy().as('statesEndpoint'))
      cy.get('@statesEndpoint').should('have.been.calledOnce')
    I learned how to do this from @gray-kilobyte-89541 's advanced Cypress network testing exercises. I cannot recommend them enough https://cypress.tips/courses/network-testing
  • g

    gray-kilobyte-89541

    10/11/2022, 2:52 PM
    I would use
    hasAttribute
    https://glebbahmutov.com/cypress-examples/9.7.0/recipes/or-attributes.html
  • g

    gray-father-52711

    10/11/2022, 3:07 PM
    Thanks @fresh-doctor-14925 . That's the solution that I want. And big kudos to Gleb 👏
  • a

    acceptable-solstice-90676

    10/11/2022, 7:32 PM
    Hey guys, how can I run my app locally with Cypress, do you know?
  • f

    fresh-doctor-14925

    10/11/2022, 8:32 PM
    You're going to need to share some more information in order for us to be able to give you a helpful answer. Are you talking about an iOS app, React app?
  • r

    rough-night-37887

    10/12/2022, 6:42 AM
    Hi Everyone, I am trying to be able to reuse Steps in Cucumber with Cypress. by using something like this
    Copy code
    Then('I set {string} field {string} to {string}', (page: string, locator: string, value: string) => {
      searchGuestPage.getMyLocator().type(value);
      // eslint-disable-next-line no-eval
      (0,eval)(`${page}Page.get${locator}().type('${value}')`);
    });
    but I am getting a error that its not finding searchGuestPage, the previous line to the eval works properly and its exactly to what the eval will run, can someone guide me on how to make it work?
  • a

    acceptable-hamburger-48790

    10/12/2022, 7:44 AM
    Did you import the searchGuestPage object reference in the step definition file
  • r

    rough-night-37887

    10/12/2022, 7:45 AM
    Yes, the firs line after the Then for example works properly, its the eval one that gives the error
  • a

    acceptable-hamburger-48790

    10/12/2022, 7:48 AM
    I believe you are aware of the Cypress chaining and the nature the code call happens in cypress. I suggest you relook the way you are calling or call this within cy.then() and see if that solves the problem
  • r

    rough-night-37887

    10/12/2022, 7:51 AM
    tried with cy.then like this, and same error..
    Copy code
    Then('I set {string} field {string} to {string}', (page: string, locator: string, value: string) => {
       // searchGuestPage.getMGMRewards().type(value);
      cy.then(()=>{
      // eslint-disable-next-line no-eval
      eval(`${page}Page.get${locator}().type(${value})`);
      }
      );
1...118119120...192Latest