https://cypress.io logo
Join DiscordCommunities
Powered by
# e2e-testing
  • n

    narrow-arm-9964

    01/12/2023, 2:30 AM
    if it's a separate request that is loading that
    resource group
    , I think you want to intercept/wait (https://docs.cypress.io/api/commands/wait#Alias)
  • g

    great-oil-15113

    01/12/2023, 3:49 AM
    hi everyone. how can i do something like this: on test failure, take a screenshot, convert to base64 string and write to reporter? i have tried
    Cypress.on('test:after:run'
    but it just ignores the reporter
  • p

    purple-afternoon-2408

    01/12/2023, 4:45 AM
    Is there a way that I can make cypress to wait for element become not disabled before clicking?
  • a

    adorable-smartphone-87280

    01/12/2023, 5:03 AM
    Yes. Look into how .should() will re-query until satisfied.
  • s

    some-keyboard-52751

    01/12/2023, 5:20 AM
    hi I wrote loop condition while I am running test cases i getting out of memory issue
  • p

    purple-afternoon-2408

    01/12/2023, 6:25 AM
    Thanks, worked 👍
  • s

    some-keyboard-52751

    01/12/2023, 6:29 AM
    while I'm executing the automation script suddenly I'm facing below issue .
  • l

    lemon-oxygen-25956

    01/12/2023, 8:42 AM
    I believe that that would work too. Unfortunately, it can't be used in our case because we are using Nrwl Nx which, as far as I know, does not allow us to define that Cypress run mode must be run in the headed way. Thanks a lot for your suggestions.
  • m

    modern-gpu-24079

    01/12/2023, 8:46 AM
    Hey guys, for some reason I am not able to see the time travel feature in cypress 12.2.0 version, is this intended or do we require other configs to see the previous state in test runner?
  • s

    swift-kitchen-62493

    01/12/2023, 8:48 AM
    Hey, I got the code to made captcha dummy from the admins to bypass the captcha, and it looks like this:
    Copy code
    "captcha": {
        "type": "xxxx",
        "value": "xxxx"
    }
    how can I implement it to make it work?
  • s

    swift-kitchen-62493

    01/12/2023, 9:14 AM
    i know that i have to do something with cy.intercept, but idk
  • m

    mysterious-psychiatrist-29678

    01/12/2023, 11:26 AM
    no, a seperate request is made when clicking on it so it should be able to click independently from any request
  • m

    mysterious-psychiatrist-29678

    01/12/2023, 12:09 PM
    have you seen this before? happens rarely mostly on CI not locally in beforeEach loop at restoring the session (not to log in again) followed by opening a link
  • m

    mysterious-psychiatrist-29678

    01/12/2023, 12:48 PM
    also I have this setup in e2e.js
    Copy code
    Cypress.on('uncaught:exception', (err, runnable) => {
        return false;
      });
  • m

    mammoth-animal-49690

    01/12/2023, 3:28 PM
    Hello. I have some problem while using Cypress v10.11.0 in Vue3 composition API Quasar App. Problems are: - In 2nd 'it' block cypress redirected to login page instead of mainpage, and is not even trying to log, but it shows that session was recreated. - When I am trying to intercept API calls cypress not always wait for responses. I was using session with Cypress v9.7.0 in other App that was using Vuetify and Vue 2 without pouchdb and session is working exactly as expected, also all the waitings were handled properly. I created login command which looks like that: `export function login(username: string, password: string) { cy.session([username, password], () => { cy.visit('/login'); cy.get('[data-test-id="email-input"]').type(username).should('have.value', username); cy.get('[data-test-id="password-input"]').type(password).should('have.value', password); cy.get('[data-test-id="confirm-button"]').should('be.enabled`your text`').click(); cy.intercept('https://xxx.xx/api/v2/login').as('login'); cy.wait('@login').then((interception) => { if (interception.response?.statusCode !== 200) { assert.fail('Login Failed'); } }); }); }`
  • m

    mammoth-animal-49690

    01/12/2023, 3:28 PM
    Then I am using it in test file in beforeEach method.
    Copy code
    describe('Tour Plan Detail View', () => {
      beforeEach(() => {
        cy.on('uncaught:exception', (err, runnable) => {
          // log the error to the console
          console.error(err);
          console.log(runnable);
          // return false to prevent the error from failing the test
          return false;
        });
        cy.login(Cypress.env('userEmail'), Cypress.env('userPassword'));
      });
    
      it('Check if selecting vehicle is working', () => {
        cy.visit('/');
        cy.intercept('https://xxx.xx/api/v2/vehicles').as('vehicles');
        cy.wait('@vehicles');
        cy.get('[data-test-id="vehicle-selection"]')
          .should('exist')
          .click();
        cy.get('.q-item span').contains('SHA-BE 201').click();
        cy.get('[data-test-id="add-vehicle"]').click();
        cy.intercept('https://xxx.xx/api/v2/tour_plans?vehicle=201&dates=[2023-01-11,+2023-01-12,+2023-01-13]').as('tourplan-res');
        cy.wait('@tourplan-res');
      });
    
      it('Get tour plan for vehicle', () => {
        cy.visit('/');
        cy.get('h4').contains('VerfĂĽgbare Tour/en');
      });
    });
    I had to add uncaught:exception cause I am using pouchdb and it throws errors.
  • m

    mammoth-animal-49690

    01/12/2023, 3:29 PM
    Any ideas why it is behaving like that, and what can I do to fix it? I would really appreciate help
  • o

    orange-cricket-43285

    01/12/2023, 3:32 PM
    Hello, Could someone please help me, I just updated cypress to its latest version (12.3.0) and my commands were obsolete. This is the error I have with (Cypress.Commands.overwrite) Could you please tell me how to correct this? --------------------------------------------------------------------- Error: (The following error originated from your test code, not from Cypress. > Cannot overwite the next query. Queries cannot be overwritten. When Cypress detects uncaught errors originating from your test code it will automatically fail the current test. Cypress could not associate this error to any specific test. We dynamically generated a new test to display this failure) ------------------------------------------------------------------------ Code: Cypress.Commands.overwrite('next', { prevSubject: true, log: false }, (subject, gridToWaitFor) => { cy.wrap(subject) .find(
    [data-testid=\'wizard-step-next\']
    ) .find('button') .should('not.have.attr', 'disabled'); if (gridToWaitFor) { cy.getGrid(gridToWaitFor).find('ejs-grid').should('be.visible'); }
  • c

    cool-truck-21040

    01/12/2023, 3:59 PM
    đź‘‹ I don't know how to search this question, so asking here. I'm upgrading from a v9 version to v12, and in browser mode, when a test fails, I seem to no longer be able to scrub or time travel back in my test. Is this feature gone, did I miss an important setting, or could it be something else? Thanks
  • c

    cool-truck-21040

    01/12/2023, 6:51 PM
    đź‘‹ I don t know how to search this
  • d

    damp-oxygen-34939

    01/12/2023, 7:19 PM
    Hello All . I am trying to write a test where I am trying to sign up a new user into my app . I am generating new email using this app tempmailo.com . So the steps of my end to end test involve : visiting tempmailo , copying new email in a variable , coming back to my website , pasting that email and my password . This will generate a verification code . Now I have to go back to tempmailo.com to get the verification code from the email . I am stuck on this part . how do i extract verification code from here , store it and go back to my app to paste it . Has anyone tried this sort of end to end test before ?
  • g

    gray-kilobyte-89541

    01/12/2023, 8:10 PM
    example of email testing https://glebbahmutov.com/blog/cypress-mailosaur/
  • b

    bland-machine-99046

    01/13/2023, 4:21 AM
    Hi guys, might I check with you what is wrong with the file path here and where should I specify it now? It was working last month but once I updated Cypress from 9.5.1 to 12.3 it's no longer working.
  • b

    bland-machine-99046

    01/13/2023, 4:22 AM
    I'm trying to attach an image to an input box.
  • r

    rich-mechanic-52238

    01/13/2023, 5:22 AM
    End-to-end tests can be quite complex, especially when they involve interacting with multiple websites. Here are a few approaches you could take to extract the verification code from the email on tempmailo.com and use it to complete the sign-up process on your app: 1. Use Cypress's cy.request() command to make an HTTP request to the email's inbox page on tempmailo.com. You could then use Cypress's cy.get() command to extract the verification code from the HTML response. 2. Use Cypress's cy.visit() command to navigate to the email's inbox page on tempmailo.com. You could then use Cypress's cy.get() command to extract the verification code from the page. 3. You could also use a web scraping library like Cheerio or JSDom to extract the verification code from the email's inbox page on tempmailo.com. You would need to run this operation in a browser environment, which can be achieved by using the cypress-browser-tools or cypress-testing-library. 4. You could also use Cypress's cy.task() command to execute a node script that extracts the verification code from the email's inbox page on tempmailo.com and store it in a variable. but for this, it requires you to have knowledge of web scraping and handling web elements. Once you have extracted the verification code, you can use Cypress's cy.get() command to find the input field on your app's sign-up page where the code should be entered, and use the cy.type() command to enter the verification code in the input field. Please keep in mind that the tempmailo.com may change their website structure and functionality, so you may need to update your test accordingly. Also you can use a stubbing library like cypress-stub-permission or cypress-testing-library-stub to avoid this kind of complexity.
  • m

    modern-dawn-86006

    01/13/2023, 8:07 AM
    Your path here is cypress\cypress\fixtures\screw.png
  • m

    modern-dawn-86006

    01/13/2023, 8:08 AM
    But you are giving cypress\fixtures\screw.png
  • n

    nutritious-hydrogen-65702

    01/13/2023, 11:50 AM
    Hi, is there any method to load data forcefully while the page is loading before the scripting starts to execute . the error shown is in the screenshot . applied the cy.pause() to wait for extra time so that data gets loaded .cy.wait() was failing
  • g

    gray-kilobyte-89541

    01/13/2023, 11:56 AM
    so you want to wait until jQuery on the page loads the plugin that makes that method?
  • r

    rich-appointment-44286

    01/13/2023, 11:57 AM
    OIDC Test - OIDC Test - AntiForgery cookie not being sent in POST request
    • 1
    • 2
1...185186187...192Latest