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

    mysterious-belgium-25713

    10/31/2022, 3:59 PM
    Does your test start with this command? If so then your cy.visit is automatic redirecting you to the https://connect.identity.stagaws.visma.com/ If so then your first domain is https://connect.identity.stagaws.visma.com/ and not the cy.visit url. So if you remove the origin part it will just fill in the loginfields without any problems.
  • a

    acceptable-fall-11897

    10/31/2022, 7:21 PM
    Please check if you find or what should I tell
  • h

    handsome-army-58690

    10/31/2022, 7:46 PM
    Is there any way to provide the deployed test cases to testers, by providing some URL like that, so they can just launch the URL and select specific test files and watch the execution like we used to do on the local machine?
  • m

    mysterious-belgium-25713

    10/31/2022, 8:01 PM
    Do you already have a dashboard project. If you dont have that you cannot use the cypress parallel features. Also know that the free tier of the dashboard only allow 500 test results If you are not using the dashboard you have to create a project structure where you can run your test from. so folder based.
  • m

    mysterious-belgium-25713

    10/31/2022, 8:07 PM
    If you have time then i would also watch my meetup video. Here we discussed how to use the dashboard.

    https://www.youtube.com/watch?v=qu0qVVQoEAI▾

  • s

    stale-optician-85950

    10/31/2022, 8:14 PM
    Follow what @mysterious-belgium-25713 suggested regarding the dashboard project setup, because you previously said "Basically I don't have cypress dashboard in my company project". All this info is in the docs, please read all the sections under: https://docs.cypress.io/guides/dashboard/introduction Also, your command is omitting the
    --key
    value in your CLI, and I don't see it being passed as an env var in that image.
  • c

    chilly-queen-22182

    10/31/2022, 9:05 PM
    Hi Team, Is there any way to handle 2FA(2 factor authentication) using cypress?
  • s

    stale-optician-85950

    10/31/2022, 9:36 PM
    @big-judge-93427 Does this help you https://discord.com/channels/755913899261296641/763070261720645642/1036705543781359667
  • q

    quaint-kilobyte-18208

    11/01/2022, 11:16 AM
    Hi, I am creating a class for reuse testing, I have a parent cy object for this class, but it’s always chainable for the parent. How can I do? example: parent = cy.get (‘[data-cy=“form-render”]’) Class Dropdown{ constructor(name, parent?){ this.name=name this.parent=parent?? this.component= this.parent.find(‘[data-cy=“${this.name}”]’) } setValue(value){ this.component.type(value) } }
  • r

    red-bird-50588

    11/01/2022, 12:26 PM
    I would like to convert the variable 'isText' into a global variable to use the 'new' value variable 'text' in while. At the moment the variable 'text' is empty.
  • s

    stale-optician-85950

    11/01/2022, 12:47 PM
    While and do while loops do not behave as you would expect when used with Cypress, so it's recommended to avoid them

    https://www.youtube.com/watch?v=5Z8BaPNDfvA▾

    I highly recommend Cypress Recurse package instead https://github.com/bahmutov/cypress-recurse
  • r

    red-bird-50588

    11/01/2022, 12:50 PM
    Thank you. Is in this link a solution of my problem (make variable 'isText' in then global) or only a solution for loops?
  • s

    stale-optician-85950

    11/01/2022, 12:54 PM
    The solution for loops. For the empty text I think you are using
    invoke
    incorrectly here, it might not be a text, maybe a
    .invoke('val')
    . You'll need to check your html again to be sure.
  • r

    red-bird-50588

    11/01/2022, 12:58 PM
    I use invoke correctly, because the log in the '.then' section displays the right string. Outside '.then', I get 'text' is empty.
  • m

    melodic-energy-94905

    11/01/2022, 1:40 PM
    Visma Home
  • g

    gray-kilobyte-89541

    11/01/2022, 1:43 PM
    Cypress commands are queued up, so using
    while
    loop is not going to work, since it will always be empty until max stack size is exhausted Cypress recurse plugin is your best bet
  • c

    crooked-yak-38149

    11/01/2022, 4:15 PM
    Hi all, I am trying to write some code that asserts the following: I have a page that will contain a number of elements with
    [data-automation-id=tagging-image-<number>]
    eg I may expect
    [data-automation-id=tagging-image-1]
    ,
    [data-automation-id=tagging-image-3]
    and ``[data-automation-id=tagging-image-5]` to exist, and I want to assert that no other
    [data-automation-id=tagging-image-<number>]
    elements exist. The elements which should be present are in an array - how could I write the below code so that the
    .not()
    commands are built up from the array? (The 3 lines after the
    -->
    comment)
    Copy code
    const assertTaggingPageContainsImages = (selectedImages) => {
        for (var i=0; i < selectedImages.length; i++){
          //cy.log(`Checking for existence of tagging-image-${selectedImages[i]}`)
          // Check that this image exists
          cy.getTestTag(`tagging-image-${selectedImages[i]}`)
            .should('exist');
        }
        // ToDo: Assert that no other tagging-image- elements exist, other than the ones that should
    
        cy
          // Get list of all tagging-image elements
          .get(`[data-automation-id^="tagging-image-"]`)
          // Filter out ones that we SHOULD see
    // --> How do I re-write the below commands to dynamically build depending on the number of elements in the array?
          .not(`[data-automation-id=tagging-image-${selectedImages[0]}]`)
          .not(`[data-automation-id=tagging-image-${selectedImages[1]}]`)
          .not(`[data-automation-id=tagging-image-${selectedImages[2]}]`)
          // Assert that no others exist
          .should("not.exist");
      }
  • c

    crooked-yak-38149

    11/01/2022, 4:27 PM
    duh, think I worked out a simpler way:
    Copy code
    cy
          .get(`[data-automation-id^="tagging-image-"]`)
          .should("have.length", selectedImages.length);
  • c

    crooked-yak-38149

    11/01/2022, 4:28 PM
    But if anyone knows the answer to my original question, I would like to hear it, as it may be useful
  • b

    billowy-librarian-83114

    11/01/2022, 5:02 PM
    anyone know why should('be.visible') would pass even though when I click on that assertion in cypress and inspect the element it has display:none?
  • h

    handsome-army-58690

    11/01/2022, 5:22 PM
    You can do this way also, checking all the elements are visible and should have length 1. cy.getByDataTest('document-list').should('have.length', documentsLength); documentsTypes.forEach(element => { cy.getByDataTest('document-description').filter(
    :contains(${element.displayName})
    ).should('have.length', 1) });
  • c

    crooked-yak-38149

    11/01/2022, 5:27 PM
    What's
    cy.getByDataTest('document-list')
    ? Is that just implying a custom command that expands to
    cy.get('[data-automation-id=document-list]')
    ?
  • h

    handsome-army-58690

    11/01/2022, 5:28 PM
    Ya, that is the custom command to get the "data-test" attribute element.
  • c

    crooked-yak-38149

    11/01/2022, 5:29 PM
    I take it that there's no built-in mechanism to do this? You have to roll your own? I have one of those, just wondering if there is anything built-in which does that and I missed it
  • c

    crooked-yak-38149

    11/01/2022, 5:32 PM
    Well, in fact i have two of them - one that does
    [<automation tag>=<value>]
    and one that does
    [<automation tag>^=<value>]
    - just wondered if there was maybe a more elegant / standardized way
  • c

    cold-eye-66538

    11/01/2022, 6:48 PM
    I am using cypress-cucumber-preprocessorrc.json and when I run my tests on the dashboard I am finding the feature file, and running my hooks (beforeeach after all) but it is not finding the individual steps. I am using the stepDefinitions property as defined in the documents. My step_definitions folder is in my cypress/e2e/step_definitions. I have tried multiple combinations even hard coding where the .js file is but it is not finding my steps. I believe the issue might have to do with the fact i am using common steps in a common.js file. Any ideas?
  • q

    quaint-kilobyte-18208

    11/02/2022, 6:30 AM
    Have any suggestions?🥹🥹🥹
  • c

    clever-salesmen-46486

    11/02/2022, 12:00 PM
    Hey everyone! I've been going crazy with this error for a few days. It's working fine on local but it fails on GitHub actions. Any advice?
  • c

    clever-salesmen-46486

    11/02/2022, 12:04 PM
    All I could find about this error is this https://ittutoria.net/solving-error-write-eproto-34557064error100000f7ssl-routinesopenssl_internalwrong_version_number/ But I don't see anywhere that my test is trying to access an https URL
  • r

    red-honey-44438

    11/02/2022, 12:09 PM
    I had observed this error when working in local but not in any CI tool reason was while deployment of application the necesssary hosts were not added as egress rule so the agent was not able to communicate to such hosts. Can you please double check your Development repo's configurations to allow such requests
1...135136137...192Latest