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

    most-baker-72677

    09/27/2022, 12:59 PM
    Hello all đź‘‹ I am currently working on
  • g

    glamorous-country-57678

    09/27/2022, 1:00 PM
    Let me read up on sudo first because I’m pretty sure I installed yarn with sudo. What is the best way to install yarn then?
  • m

    mysterious-belgium-25713

    09/27/2022, 1:02 PM
    Are you using Yarn 1 or Yarn 2. Yarn 1: https://classic.yarnpkg.com/en/docs/install#windows-stable Yarn 2: https://yarnpkg.com/getting-started/install
  • g

    glamorous-country-57678

    09/27/2022, 1:27 PM
    So I removed my yarn and cypress packages I installed on my machine and installed yarn through core pack. Yarn works. When running a yarn command in a project that uses docker for some processes I get permission denied from docker.
  • m

    mysterious-belgium-25713

    09/27/2022, 1:33 PM
    I think for docker you need to add your user to the docker group. https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user
  • m

    melodic-bear-95863

    09/27/2022, 1:37 PM
    Hello Guys, i have updated cypress to the new version and when i run the tests i can not see left window with the test description, errors etc. Please look at the photo
  • g

    glamorous-country-57678

    09/27/2022, 1:38 PM
    When running
    getent group
    it lists docker as part of the group but still get permission issues when running docker without sudo. Also, when running
    sudo groupadd docker
    it states docker already exists.
  • m

    millions-butcher-58164

    09/27/2022, 1:38 PM
    I think you need to run the app locally as well
  • m

    melodic-bear-95863

    09/27/2022, 1:45 PM
    So do I have to run the test locally first, using the command line and then i will be able to do it using cypress application?
  • n

    numerous-kangaroo-93739

    09/27/2022, 3:00 PM
    So running into a issue with finding the correct way on how to validate the current date is showing correctly in a date picker. For example today is Sep 27, 2022 and that is what the calendar is showing but don't know how to actually implement that in a test case. If anyone has a idea. can you point me in the right direction.
  • g

    glamorous-country-57678

    09/27/2022, 3:50 PM
    @mysterious-belgium-25713 thx for helping me debug. I followed the steps here to add docker to my user group. https://stackoverflow.com/questions/48957195/how-to-fix-docker-got-permission-denied-issue
  • n

    nutritious-army-46708

    09/27/2022, 3:54 PM
    It is our first project with cypress. Now some elements have not "id", and we could not catch it correctly when running test. Some engineers think that we could not achieve the test stability if we do not add "id" to the elements. My question is : Can we realize stability by improving our cypress code? Should we add "id" or improve our cypress code? Thank you so much!
  • g

    glamorous-country-57678

    09/27/2022, 3:57 PM
    darn still having cypress issues though. Cypress is not installed on my computer anymore but installed it in my project using yarn. I still get this: @mysterious-belgium-25713
  • m

    mysterious-belgium-25713

    09/27/2022, 3:58 PM
    Hi yanyan, There are really multiple ways into doing test automation, the need for ID is not always there. You can use ID/Classes/Field+attributes all things unique. Next to that cypress has also a preffered way and that is using data-cy. Please look at the best practices. https://docs.cypress.io/guides/references/best-practices#How-It-Works
  • m

    mysterious-belgium-25713

    09/27/2022, 3:59 PM
    Maybe do a yarn install in the folder again or yarn run cypress install. I think that should resolve this issue
  • g

    glamorous-country-57678

    09/27/2022, 4:07 PM
    this may be a yarn version issue -- checking on this now
  • n

    nutritious-army-46708

    09/27/2022, 4:26 PM
    Thank you so much!!
  • g

    glamorous-country-57678

    09/27/2022, 4:31 PM
    i recloned the project, installed with yarn v1.22.19, and was having some issues but then i just rebooted my machine and everything is working.
  • d

    delightful-microphone-80931

    09/27/2022, 4:51 PM
    Hi , is there a robust way of integrating Cypress with Testrail? The thing is I jave junit xml test results which are also published in AzureDevOps, but I would like to publish those test results in a new Testrail run, as well. TRCLI is not suitable for me because I need to link existing testcase IDs to Cypress tests. Any idea how I can manage it? Somehow cypress-testrail-reporter and cypress-testrail-simple both giving errors
  • m

    mysterious-belgium-25713

    09/27/2022, 5:20 PM
    Nice to hear everything is working.
  • n

    nutritious-army-46708

    09/27/2022, 6:26 PM
    I need to click a "send" button to send an email to an email address, and then after cy.wait(10000), cypress can request the email message from the email address. My question is how I can wait for the email message without using cy.wait(10000). I want cypress to check it automatically. Thank you!
  • g

    gray-kilobyte-89541

    09/27/2022, 6:52 PM
    check periodically using cypress-recurse plugin
  • k

    kind-baker-548

    09/27/2022, 7:53 PM
    Hello, I was previously using cypress v7 for a while. I had a few custom cypress commands to mock my login state, and other small things. I recently upgraded to v10 and I can’t get any of my commands to work anymore. “Command is not a function” is all that happens. The docs look as if I’m doing everything exactly correct too, I need a bit of help getting passed this road block
  • n

    nutritious-army-46708

    09/27/2022, 8:03 PM
    Thank you so much! I will check it.
  • p

    polite-salesclerk-28948

    09/28/2022, 4:27 AM
    hi guys, I am trying to use cy.session for login test case but the cy.session doesnt seem to work. I am using cypress10.6 version.Can someone one help
  • p

    polite-salesclerk-28948

    09/28/2022, 4:29 AM
    Copy code
    Cypress.Commands.add('login', (username, password) => {
      cy.session([username, password], () => {
        cy.visit('/');
        cy.contains('Login').click();
        cy.findAllByLabelText('Username').should('exist').click().type(username);
        cy.findAllByLabelText('Password').should('exist').click().type(password);
        cy.contains('Sign in').should('be.visible').click();
    
        cy.intercept('GET', '/api/v1/oktaConfig').as('exp');
        // once a request to get authentication responds, 'cy.wait' will resolve
        cy.wait('@exp').then(intercept => {
          expect(intercept.response.statusCode).to.be.eq(200); //should work
        });
    
        cy.url().should('contains', '/login/callback');
      });
      cy.visit('/');
    });
  • s

    stale-optician-85950

    09/28/2022, 8:56 AM
    Firstly you should move
    cy.intercept('GET', '/api/v1/oktaConfig').as('exp')
    outside of your function, as you are declaring it too late (after this click/submit is too late). i.e.
    Copy code
    cy.intercept('GET', '/api/v1/oktaConfig').as('exp')
    Cypress.Commands.add('login', (username, password) => {
    ...
  • s

    stale-optician-85950

    09/28/2022, 9:26 AM
    And I don't believe your intercept URL syntax is correct. But the solution depends on your full request URL. You are obviously chopping off the URL origion, so let's add
    **
    at the beginning, try this:
    cy.intercept('GET', '**/api/v1/oktaConfig').as('exp')
    and I don't know if you are chopping off the end URL path, if yes then try this:
    cy.intercept('GET', '**/api/v1/oktaConfig/*').as('exp')
    And as mentioned above this should be moved before the first
    cy.visit()
    Copy code
    Cypress.Commands.add('login', (username, password) => {
      cy.session([username, password], () => {
        cy.intercept('GET', '**/api/v1/oktaConfig/*').as('exp')
          cy.visit('/');
          ...
  • a

    adorable-kilobyte-871

    09/28/2022, 10:24 AM
    Hello everyone, I'm struggling to change the following lines to one test per found link :
    Copy code
    it('check all links', () => {
      cy.visit('/')
      cy.get("a:not([href*='mailto:'])").each(page => {
        cy.request(page.prop('href'))
      })
    });
    I tried the following :
    Copy code
    var links = []
    it("setup", () => {
      cy.visit("/")
      cy.get("a:not([href*='mailto:'])").each((page) => {
        links.push(page.prop("href"))
      })
    })
    
    links.forEach((link) => {
        it(`Checking ${link}`, () => {
            cy.request(link)
        })
    })
    But only the very first test "setup" is run and the loop does not execute any test. What would be the good approach to do it correctly ?
  • c

    cold-van-45410

    09/28/2022, 11:15 AM
    How to clear cypress cache??
1...107108109...192Latest