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

    ancient-tailor-59288

    10/21/2022, 12:35 PM
    Hi there #755913900024791046 e-testing! What is the best way to integrate Cypress with Bamboo?
  • m

    mysterious-belgium-25713

    10/21/2022, 1:02 PM
    I dont know how much bamboo differs from bitbucket but you can maybe look at this blog and see if it also works for Bamboo: https://qaautomationlabs.com/cypress-integration-with-bitbucket-e2e-testing-with-bitbucket-cypress/
  • b

    brief-midnight-25297

    10/21/2022, 1:28 PM
    Hi guys, it might be that the question was already answered but I'm gonna try my luck anyway. So, I have a scenario where at the end of the test, after the last action a print dialog is automatically triggered. The problem is that this is an OS dialog. Anyone has a clue how to close that dialog ?
  • g

    gray-kilobyte-89541

    10/21/2022, 1:39 PM
    there is no way to do this from the browser. Instead you should stub the
    window.print
    method call the application makes to prevent the dialog from opening
  • b

    brief-midnight-25297

    10/21/2022, 1:56 PM
    thanks Gleb! did not think of this. I'll try it out
  • g

    gray-kilobyte-89541

    10/21/2022, 2:02 PM
    I have created a bonus lesson 42 that shows how to send simple multipart/form-data forms using
    cy.request
    command, see https://cypress.tips/courses/network-testing
  • s

    stale-horse-13605

    10/21/2022, 7:08 PM
    I was able to figure this out for you! First, you were right, you didn't really understand what cy.session is doing behind the scenes, specifically understanding that even when your login function is wrapped in the session, you still have to call it at the top of each test (or, in this solution, a beforeEach in the e2e.js file). The first time it's run, it sets your session. Every other time it runs, it runs THE SESSION, not the login process. So, the pattern is as follows: Write your login function as a custom command, making sure that cacheAcrossSpecs = true, and do everything you need for your session. Wrap that command in cy.session. Put that command either directly in your e2e.js OR put it in a login file and import it from commands.js. Call the login in a beforeEach on the e2e.js (so it runs every time after every spec) and that should take care of that!
  • r

    rapid-memory-85767

    10/21/2022, 8:15 PM
    Our QA team is trying Cypress with Network call test case automation. But it aways failed at this simple case. Could anyone be able to help? Here are steps and our scripts: Thanks a lot
  • r

    rapid-memory-85767

    10/21/2022, 8:17 PM
    1, visit https://peterdev.sendtonews.com/demo/QA_test_player.html 2. in network response, search s2l, verify it include “cmd=PRE_INIT” describe('Window', () => { beforeEach(() => { }) it.only('Validate the service "cmd=PRE_INIT" in

    https://s2l.sendtonews.com/stn_trk.gif▾

    ', () => { cy.visit('https://peterdev.sendtonews.com/demo/QA_test_player.html').then(() => { cy.wait(5000) }) cy.intercept({ url: "s2l*", }).as('search') cy.wait('@search').its('request.url').should('include', 'cmd=PRE_INIT') })
  • r

    rapid-memory-85767

    10/21/2022, 8:19 PM
    don't know why it is not mapping the response from

    https://s2l.sendtonews.com/stn_trk.gif▾

  • r

    rapid-memory-85767

    10/21/2022, 9:24 PM
    checked with developer, the call is using the sendBeacon function.
  • g

    gray-kilobyte-89541

    10/22/2022, 4:44 PM
    Please read the docs for https://on.cypress.io/intercept (you for example should define your intercept before visiting the page). You can also benefit from my course https://cypress.tips/courses/network-testing
  • m

    mysterious-belgium-25713

    10/22/2022, 5:37 PM
    I think your intercept url is not correct. I would also look at cypress minimatch to test your route interception. https://docs.cypress.io/api/utilities/minimatch#Examples
  • m

    many-animal-60948

    10/22/2022, 7:12 PM
    Is there a way to tell cypress to assert that a condition is true for a specific amount of time? I'm looking for something like (pseudo code):
    Copy code
    typescript
    cy.get("#something").should("not.exist.for", "200ms")
    I created this command to solve this, but I was wondering if there's something built-in that I've missed. https://gist.github.com/ksandin/c93206280af3793aec83df2346e19bbc
  • i

    important-fish-21193

    10/23/2022, 12:14 AM
    Hello guys, I have following setup and whenever I run the spec file, cypress test runner reloads midway through and re runs the test from the beginning, eventually my test gets failed. ( as api call with same test data in before hook executing twice). Based on the suggestions on this issue on GitHub, https://github.com/cypress-io/cypress/issues/2777 I did set up baseUrl correctly in e2e object in cypress.config.js file and also defined api url in env object inside cypress.config.js. , yet cypress test runner reloads during the test execution. any help would be much appreciated. Thanks
  • i

    important-fish-21193

    10/23/2022, 12:20 AM
    Is this happening because api url is different to baseUrl and as soon as it sees cy visit, cypress reloading the test runner ?
  • r

    rapid-memory-85767

    10/23/2022, 6:09 AM
    Thanks a lot, I will take a look.
  • r

    rapid-memory-85767

    10/23/2022, 6:13 AM
    Thanks a lot, I tried to search "s2l" in network tab manually, and can find "cmd=PRE_INIT" from returned response in payload. But CyPress couldn't find it. so weird.
  • h

    happy-dinner-13480

    10/23/2022, 10:16 AM
    ow are these 2 not equal?
    Copy code
    expected [ 'receipt', 'invoice' ] to equal [ 'receipt', 'invoice' ]
    This seems to work:
    Copy code
    expect(data.request.body.document_types[0]).to.eq('receipt');
    expect(data.request.body.document_types[1]).to.eq('invoice');
  • h

    happy-dinner-13480

    10/23/2022, 11:13 AM
    Copy code
    typescript
    cy.wait('@firstChart').then((data: any) => {
        expect(data.response.statusCode).to.eq(200);
        expect(data.request.body.document_types).to.deep.eq(['receipt', 'invoice']);
    
        expect(data.request.body.filters[0]).to.deep.equal({
            comparison_operator: '==',
            field: 'purchase_date',
            type: 'field_value',
            value: 'this_year',
        });
    });
    this works
  • k

    kind-artist-92362

    10/23/2022, 11:34 AM
    hi! writing this code the last selector was not found ( but it it correct i checked in console ) i think it is because is opened new window , how can i handle it cy.visit("https://www.google.ru/"); cy.get( "input[name=q]").type("blabla"); cy.get("form center:first-child input[tabindex='0']").click(); cy.get("div[lang=ru] a[href='https://blabla.com/']").click(); cy.get("nav span[class='header__nav-span']").click()
  • k

    kind-artist-92362

    10/23/2022, 11:49 AM
    it works if i write in the 9 line cy.visit ("this site") but if i am trying to do it after google no
  • k

    kind-artist-92362

    10/23/2022, 12:06 PM
    new windows as i think code does not work
  • k

    kind-artist-92362

    10/23/2022, 12:06 PM
    but how can i handle it
  • f

    fresh-doctor-14925

    10/23/2022, 1:20 PM
    Yeah, the not being able to open a new tab/window issue comes up on here often. Some folks on here have has success with
    .invoke('removeAttr', 'target')
    , so for you it would be:
    Copy code
    cy.get("form center:first-child input[tabindex='0']")
       .invoke('removeAttr', 'target')
       .click()
    Also, consider adding some test ids to your application if possible
  • k

    kind-artist-92362

    10/23/2022, 2:33 PM
    tnk! no not possible to add test ids
  • k

    kind-artist-92362

    10/23/2022, 2:33 PM
    i ll try your option
  • k

    kind-artist-92362

    10/23/2022, 2:36 PM
    cy.visit("https://www.google.ru/"); cy.get( "input[name=q]").type("Byndyusoft"); cy.get("form center:first-child input[tabindex='0']").click(); cy.get("div[lang=ru] a[href='https://byndyusoft.com/']").click(); cy.get("section div[class='know-more__container'] span:nth-child(2)") .invoke('removeAttr', 'target') .click()
  • k

    kind-artist-92362

    10/23/2022, 2:36 PM
    this is my code
  • k

    kind-artist-92362

    10/23/2022, 3:21 PM
    cy.visit("https://www.google.ru/"); cy.get( "input[name=q]").type("Byndyusoft"); cy.get("form center:first-child input[tabindex='0']") .invoke('removeAttr', 'target') .click(); cy.get("div[lang=ru] a[href='https://byndyusoft.com/']").click(); cy.get("section div[class='know-more__container'] span:nth-child(2)").click()
1...126127128...192Latest