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

    bright-park-76512

    11/09/2022, 11:38 AM
    I am connecting to deployed application. Not one served locally
  • g

    gray-kilobyte-89541

    11/09/2022, 11:38 AM
    you can use all three options, depending on how precise and stable you want your test code to be. See examples of querying at https://glebbahmutov.com/cypress-examples/commands/querying.html As far as redirect - the Link component probably expands to some "a" element, you can check its attribute to verify it points at
    /deleteGame
  • g

    gray-kilobyte-89541

    11/09/2022, 11:39 AM
    You can find https://glebbahmutov.com/blog/code-coverage-for-nextjs-app/#tests-in-a-separate-repo if you search at https://cypress.tips/search
  • g

    gray-helmet-2693

    11/09/2022, 11:41 AM
    is there any way to add a custom message to the slack report generated after the test run ?
  • s

    steep-scientist-25280

    11/09/2022, 12:07 PM
    Hello everyone. I'm just getting started with Cypress and I'm having problems with Microsoft login. When I open the project web page, another pop-up opens in which I have to select the logging account twice in order to get to the landing page. Currently, we do not have test users that do not require a double logging process. Does anyone experienced something similar when with Microsoft authentication? Thanks you!
  • b

    bright-park-76512

    11/09/2022, 12:25 PM
    I will check thankss
  • s

    stale-policeman-71052

    11/09/2022, 4:12 PM
    Do we have anything in Cypress to calculate Test coverage ?
  • e

    enough-truck-68085

    11/09/2022, 4:25 PM
    There's extensive documentation on how to calculate code coverage with cypress. Does this help? https://docs.cypress.io/guides/tooling/code-coverage
  • r

    rough-petabyte-49242

    11/09/2022, 5:41 PM
    Hello. How write method (constructor) choosing different DOM elements? I tried as aliases but it doesn`t work.
  • j

    jolly-musician-21682

    11/09/2022, 9:07 PM
    I'm using the cypress docker image
    cypress/included:10.3.1-typescript
    I am wondering if there's anything I can do to improve this? I commented out the cypress/package.json part because I was getting an unknown file extension error.
    Copy code
    FROM cypress/included:10.3.1-typescript
    
    ARG PIX_UI_NPM_TOKEN
    
    # Copy the pix-one source files into the container in the name of peace and sanity
    COPY . /app_root
    WORKDIR /app_root
    
    # Since we only need a subset of dependencies to run cypress, we overwrite the pix-one package.json with this cypress-specific one
    # RUN mv cypress/package.json /app_root
    
    # This will result in a node_modules directory being created within the container, inside the /app_root folder
    RUN yarn
    ARG CYPRESS_PIPELINE
  • a

    adorable-smartphone-87280

    11/09/2022, 9:13 PM
    I included the
    --parallel
    flag in my run script, but in the terminal output from the Github Actions job, I don't see that flag included. Any idea why that wouldn't be getting picked up?
  • e

    enough-truck-68085

    11/09/2022, 9:35 PM
    Do you have a code-example of what isn't working? I typically only grab DOM elements using
    data-testid
    attributes. I'd recommend this approach if what you are doing isn't working but please share more details if this isn't a viable solution. https://docs.cypress.io/guides/references/best-practices#Selecting-Elements
  • n

    nutritious-megabyte-64190

    11/09/2022, 11:59 PM
    hey all cy.origin() question regarding redirects --- here is my scenario
    Copy code
    // suedo code detailing the redirects as soon as cy.visit() hits 
    
     cy.visit(https://baseurl/3rdPartyVendor/)
       
     -> 301: https://companyName--dev.DOMAIN1.com/wizardry/services/auth/sso/OauthClient
    
      -> 302: https://baseurl/auth?response_type=gobblygook=redirect_uri=companyName--dev.DOMAIN1.com
    
       -> 302: https://baseurl/something
    
       after the last 302 we land on 
       https://companyName--dev.DOMAIN1.com/comms/aaaa
    
    //the code
               cy.visit(https://baseurl/3rdPartyVendor/);
    
                    cy.origin('companyName--dev.DOMAIN1.com', () => {
                        //url assertion below works
                        cy.url().should('contain', 'https://companyName--dev.DOMAIN1.com/comms/aaaa');
    
                        //but cant do any ui actions because page is blank
                    });
    any ideas why the page is blank i cant tell if im doing it wrong, i do know that other tests I have that dont have multiple redirects work as intended
  • g

    gentle-processor-97604

    11/10/2022, 12:10 AM
    Hi , I receive an interesting error and could not find the answer. I am able to test 1st page but when I click on a button on that page I receive following error
  • g

    gentle-processor-97604

    11/10/2022, 12:10 AM
    " Something went terribly wrong and we cannot proceed. We expected to find the global Cypress in the parent window but it is missing! "
  • g

    gentle-processor-97604

    11/10/2022, 12:10 AM
    Any idea?
  • s

    stale-ambulance-65138

    11/10/2022, 6:18 AM
    hi, I would like to ask how is it possible to successfully assert that an element is visible and when I try to click on it right away it fails because apperently it's hidden from view which in my opinion contradicts itself
  • r

    rough-petabyte-49242

    11/10/2022, 8:43 AM
    Hi. Thank you for your attention for my problem.
  • r

    rough-petabyte-49242

    11/10/2022, 8:43 AM
    My code is: import {agentList} from '../pageObjects/agent-list'; class AgentProfile { constructor() { this.agentNameExpect = () => cy.get('.col-lg-6:nth-child(1)') this.firstLastNameExpect = () => cy.get('tbody > :nth-child(1) > :nth-child(2) > a') this.editInformationBtn = () => cy.get('[data-action="edit-info"]') this.firstNameEdit = () => cy.get('#agent_info_user_first') this.lastNameEdit = () => cy.get('#agent_info_user_last') this.dbaNameEdit = () => cy.get('#agent_info_dbaName').as('dban') } typeField(nameField, test) { this.editInformationBtn() .click(); // How can I use different locators (this.firstNameEdit, this.lastNameEdit, this.dbaNameEdit e.t.c.) to make the method 'typeField' universal? // It doesn`t works below cy.get(nameField) // or It doesn`t works too this.(nameField) // or It is not universal method this.dbaNameEdit() .clear() .type(test) this.saveBtn() .click() }; } export const agentProfile = new AgentProfile;
  • e

    enough-fireman-4779

    11/10/2022, 8:52 AM
    hello team! last few days i'm facing one issue. After launching a website which needs log in, i'm receiving blank page! I'm using cypress 1 year for the same project and suddenly shows a blank page... i don't receive any issue or something. I search for it but didn't find solution yet for me to work.. any ideas regarding this?
  • f

    fresh-doctor-14925

    11/10/2022, 9:57 AM
    Feel free to ask your questions. You're more likely to get a response if people know what you need help with
  • e

    enough-truck-68085

    11/10/2022, 3:51 PM
    Can you give this a try @rough-petabyte-49242 ? Try using
    cy.wrap
    https://docs.cypress.io/api/commands/wrap#Yields
    Copy code
    typeField(nameField, test) {
        this.editInformationBtn()
            .click();
    
        // Try cy.wrap
        nameField.then((field) => {
            cy.wrap(field).clear().type(test)
        })
    
        this.saveBtn()
            .click()
    };
    Then I imagine in your test you could call this method by doing
    agentProfile.typeField(agentProfile.firstNameEdit(), "textHere")
  • b

    better-ocean-83368

    11/10/2022, 4:35 PM
    Does anyone know if Cypress can allow for client certification selection (use case, while not cypress specific, is defined well here: https://github.com/microsoft/playwright/issues/1799) ? At 8.0.0, Cypress supports Client Certificates (https://docs.cypress.io/guides/references/client-certificates) but I'm still not having success having my tests actually select a test PKI cert during test execution (hitting a Vue.js application). Does anyone know if that is supported? or is that not in the purview of Cypress. Any feedback or help would be very much appreciated. This is discussed here (https://github.com/cypress-io/cypress/discussions/20117) as well.
  • r

    rough-petabyte-49242

    11/10/2022, 4:35 PM
    It doesn`t work -
  • e

    enough-truck-68085

    11/10/2022, 4:44 PM
    That error tells me Cypress can't find your element, not that the
    cy.wrap
    type command doesn't work. Can you review your selectors and ensure they are correct. Feel free to try other selectors to test if the wrap works in the meantime
  • r

    rough-petabyte-49242

    11/10/2022, 5:25 PM
    Thanks for your help. It works If we call this method by doing agentProfile.typeField(agentProfile.firstNameEdit, "textHere")
  • e

    enough-truck-68085

    11/10/2022, 5:33 PM
    Glad it works and happy to help.
  • j

    jolly-musician-21682

    11/10/2022, 7:23 PM
    I upgraded my cypress docker image from 5.x to 11.x and noticed the time has increased for building and running the tests. Any ideas on why? Here's the code snippet old
    FROM cypress/included:5.1.0
    new
    FROM cypress/included:11.0.0
    • 1
    • 1
  • n

    numerous-coat-63600

    11/11/2022, 12:02 AM
    Hi guys, I have an issue with AzureAD when I'm running e2e tests for a site which use AzureAD authentication. Issue is, Cypress get to infinite iframe-request loop. here is issue reported in github. https://github.com/cypress-io/cypress/issues/7619
  • a

    aloof-psychiatrist-45078

    11/11/2022, 2:27 AM
    hi all, anyone is using
    cypress-react-selector
    package?
1...139140141...192Latest