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

    magnificent-finland-58048

    01/13/2023, 2:50 PM
    I see for this one you will need a reproducible repo and ask help from Cypress
  • e

    early-egg-66445

    01/13/2023, 2:55 PM
    I changed the test to
    Copy code
    js
    context('Login', () => {
        it('should visit /', () => {
            cy.visit('/')
        })
    })
    Then I close everything and run
    npx cypress open
    again, it opens the browser at
    localhost:8001
    , but as soon as I click any test, it reloads the browser page to
    keycloak:8080
    . Not only the "child" browser, but the top level chrome being controlled by Cypress
  • e

    early-egg-66445

    01/13/2023, 2:56 PM
    before
  • e

    early-egg-66445

    01/13/2023, 2:56 PM
    after
  • m

    magnificent-finland-58048

    01/13/2023, 2:56 PM
    I wonder what would happen if the app did not auto-redirect, but visited the other url after a button click if you can modify the app, that will eliminate a factor then it's a qestion of if you can block visit from redirecting and then another unknown unknown
  • e

    early-egg-66445

    01/13/2023, 2:57 PM
    Ok thanks for the help, I'll try to set up a blank laravel+keycloak example
  • m

    magnificent-finland-58048

    01/13/2023, 2:57 PM
    btw, is progLogin an option? Can you "forget the UI" ?
  • e

    early-egg-66445

    01/13/2023, 2:57 PM
    and then I submit that on the github?
  • m

    magnificent-finland-58048

    01/13/2023, 2:57 PM
    there is a large discussions thread about cy.origin , I'm sure Cypress would be interested in a recipe for this kind of a situation
  • e

    early-egg-66445

    01/13/2023, 2:58 PM
    I'll take a look at a programmatic login, that might be fine
  • e

    early-egg-66445

    01/13/2023, 2:58 PM
    Thank you very much
  • t

    thankful-tomato-3609

    01/13/2023, 3:46 PM
    Hi, it’s been almost a week having a trouble with my e2e test in an angular app. Locally it works ok, but in azure pipe line cypress does not load any page and get a timeout. I’m using the package start-server-and-test with a ng serve command. The last photo is a screenshot made by cypress on the error event. Probably you could help me
  • a

    abundant-tailor-4878

    01/13/2023, 5:08 PM
    Any quick input how to fix this dependency deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
  • m

    magnificent-finland-58048

    01/13/2023, 7:24 PM
    very hard to tell, but it almost looks like that's because the app takes too long to serve and the tests timeout there's a setting about it in the github action, maybe you can find the equivalent setting in azure pipelines https://github.com/cypress-io/github-action#wait-on @careful-insurance-62240 did you write about azure CI? An ambassador wrote one, can't recall
  • n

    narrow-artist-87113

    01/14/2023, 5:53 AM
    Guys please help, this test has been running from 20 min, it was not supposed to take so long, i think there has been some infinite loop, how to kill the run??
  • n

    narrow-artist-87113

    01/14/2023, 5:53 AM
    Please help
  • b

    bitter-fountain-36713

    01/14/2023, 6:33 AM
    Click on it and cancel the run
  • n

    narrow-artist-87113

    01/14/2023, 6:35 AM
    there is no option for cancel
  • b

    bitter-fountain-36713

    01/14/2023, 6:36 AM
    It says you are not logged in. Maybe that's why?
  • n

    narrow-artist-87113

    01/14/2023, 6:40 AM
    yeahhh, you were right, thank you mate!
  • c

    colossal-mouse-44047

    01/14/2023, 11:12 AM
    **Cypress 10 to 12 migration**: Hello everyone. Hope someone know which reading material to point me to in understanding this issue. My extremely basic script works well in Cypress App v10.x, but now stops working in Cypress App 12.x. Results mentioned in the code as comments. Thank you in advance.
    Copy code
    describe('Cypress 10 vs 12 migration investigation: Started breaking after login test.', () => {
        it('Login: Works fine in Cypress 10 and 12.', () => {
                cy.visit(url)
                cy.contains(' Later✓').click() // Calibrate dialog
                cy.get('[data-cy="login__email"]').type(email)
                cy.get('[data-cy="login__password"]').type(pwd)
                cy.get('[data-cy="login__submit"]').click()
                cy.wait(15000)
        });
        it('Select Location: Breaks in Cypress 12.', () => {
            // When this test start, the following is shown in the TEST BODY:
            // (xhr)POST /api/Practitioners/logout?
            // and the Cypress App shows "Default blank page"
            cy.contains('22123001').click(); // Pick this location from the list.
            cy.contains('Yes').click(); // Location selection confirmation.
        })
    })
  • g

    gray-kilobyte-89541

    01/14/2023, 3:42 PM
    test isolation is on by default in v12
  • m

    modern-dawn-86006

    01/14/2023, 5:00 PM
    Copy code
    it('Select Location: Breaks in Cypress 12.', () => {
            // When this test start, the following is shown in the TEST BODY:
            // (xhr)POST /api/Practitioners/logout?
            // and the Cypress App shows "Default blank page"
            cy.contains('22123001').click(); // Pick this location from the list.
            cy.contains('Yes').click(); // Location selection confirmation.
        })
    If this is your test where the code breaks, it maybe because you are not vising the website. cy.visit is missing
  • m

    modern-dawn-86006

    01/14/2023, 5:02 PM
    and if you are giving a url and not mentioning it here due to security reasons and if the cypress is taking you to the browser then it could be because of the errors in console. To test this theory, open your website in a regular browser, go to your inspect and open your network and then perform the test. Check your network if there is any bad api request and if not then check your console if there are any errors when logging out.
  • c

    colossal-mouse-44047

    01/14/2023, 8:21 PM
    Thank you for the directions. I was under the impression each test (it) will just resume from the previous test (it) as long as they are part of the same describe block.
  • c

    colossal-mouse-44047

    01/14/2023, 9:14 PM
    Thank you. Test Isolation feature seems to be the cause and solution. I have changed my describe block to the following that worked for me:
    Copy code
    describe('Cypress 10 vs 12 migration investigation: Started breaking after login test.',{testIsolation: false}, () => {
  • c

    clever-salesmen-46486

    01/14/2023, 10:03 PM
    Does anyone know if Cypress runs on light or dark mode on github actions? Also does it detect my system theme on the local tests? because I notice sometimes it's light as default and sometimes dark. I tried forcing dark mode on the config and it appeared to work, but not on the CI. Edit: So it seems it does run on light mode in the CI. However right now it's running on dark mode on my local environment (seems to be picking up my system settings). Any suggestions? I need it to run the same both in local and CI.
  • l

    lively-balloon-98986

    01/15/2023, 7:52 AM
    Hi, does anyone know how to test when new tab is opened in browser?
  • p

    powerful-orange-86819

    01/15/2023, 9:47 AM
    This is a bad practice, better to just combine both "it" in one test, tests shouldnt continue off each other, each should be on its own
  • p

    powerful-orange-86819

    01/15/2023, 9:48 AM
    either directly open the page for a new tab in thhe begining of the test, or if you have to click somewhere that opens new tab better to just remvoe the script or html code that opens a new tab and open it in the same tag. Cypress framework is such that is limited to work only inside 1 tab If you have too many tests that need multiple tabs, you should try Playwright or better yet integrate it inside your Cypress tests, but be aware the reporting is going to suffer that way as of my current experience with it
1...187188189...192Latest