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

    gifted-coat-49959

    10/28/2022, 5:59 PM
    I think one of the first things I'd do is change the name of the function to "setTargetMonth" because you're not actually returning anything. I'd also change the name of the variable "div" because a div is an element, not an integer. Try using something more descriptive. I think once you fix those two things the next thing you can do is probably remove the cy.then(() => {}). I'm not sure that's necessary. There's still a lot of missing context to what you're trying to do. We still don't know what "div" is supposed to represent other than the fact that it's an integer.
  • a

    adorable-smartphone-87280

    10/28/2022, 6:00 PM
    something like that...
  • n

    nutritious-army-46708

    10/28/2022, 6:00 PM
    Thank you!
  • g

    gifted-coat-49959

    10/28/2022, 6:01 PM
    There's a good chance the reason you're getting that error is because the recursion is happening infinitely. Try console.log to see the value of div while the test runs.
  • n

    nutritious-army-46708

    10/28/2022, 6:02 PM
    got it! Let me try!
  • n

    nutritious-army-46708

    10/28/2022, 6:05 PM
    Thank you so much! it works after I changed "div" to "divmonths", and deleted the cy.then()
  • c

    careful-toothbrush-49639

    10/28/2022, 6:38 PM
    So I have a issue that I need help me. So when I enter my email address in email input field and click on forgot password, a code is sent to my email which I need to enter into the next page that is displayed in the OTP (One Time Password) input field. The challenge is that I can't stop my test to get the code from my email so I can put it into the input fields for the OTP so my tests always fails because the code declared is always invalid. I hope I explained the scenario well. Anyway around this problem so I can enter the right code because a new code is always sent when the forgot password is clicked
  • g

    gifted-coat-49959

    10/28/2022, 6:55 PM
    You could try
    cy.wait(20000)
    which will give you about 20 seconds to put the password in, I think? I'm not sure if that's how it works but you could try.
  • g

    gray-kilobyte-89541

    10/28/2022, 8:23 PM
    seems like a good use case for http://github.com/bahmutov/cypress-recurse
  • a

    acceptable-fall-11897

    10/28/2022, 8:43 PM
    Can anyone help me running my test parallel in local machine as well as in gitlab without cypress dashboard or if cypress dashboard required then how to set up.
  • a

    acceptable-fall-11897

    10/28/2022, 8:46 PM
    Basically I don't have cypress dashboard in my company project
  • n

    nutritious-megabyte-64190

    10/29/2022, 3:35 AM
    hey all im attempting to use cy.origin on 10.11 and im breaking on importing my page file, im probably doing something wrong but cant figure it out
    Copy code
    Error: Webpack Compilation Error
    ./cypress/e2e/sso-ignore-claims.e2e.cy.ts 320:12
    Module parse failed: 'import' and 'export' may only appear at the top level (320:12)
    File was processed with these loaders:
     * ../../Users/uuuu/AppData/Local/Cypress/Cache/10.11.0/Cypress/resources/app/node_modules/@packages/server/node_modules/@cypress/webpack-preprocessor/dist/lib/cross-origin-callback-loader.js
     * ../../Users/uuuu/AppData/Local/Cypress/Cache/10.11.0/Cypress/resources/app/node_modules/@packages/server/node_modules/ts-loader/index.js
    You may need an additional loader to handle the result of these loaders.
    |         cy.origin('https://test-test.auth0.com/', function () {
    >            const auth0Page = import('../../pages/auth0.po');
                const UserData = import('../../data/userdata');
        at Watching.handle [as handler] (C:\Users\uuuu\App
  • s

    stale-optician-85950

    10/29/2022, 8:46 AM
    As it sounds like you've done absolutely no research on the topic already, you should configure Cypress Dashboard and parallel running in your project with the free version to get started https://learn.cypress.io/tutorials/running-our-tests-in-parallel-with-cypress-dashboard and https://www.cypress.io/pricing/ And now start using Google.
  • g

    gentle-processor-97604

    10/29/2022, 2:19 PM
    Hi, When I write cy.get(selector).type('text{enter}'), it writes the text but after enter , it delete the text. Any Idea?
  • g

    gray-kilobyte-89541

    10/29/2022, 2:28 PM
    is your application code doing something? Maybe it types before the application is ready and the app clears it? Is it something like https://glebbahmutov.com/blog/cypress-if/#bonus-1-conditional-type-into-the-input-field ?
  • g

    gentle-processor-97604

    10/29/2022, 4:41 PM
    Yes, after entering text and press enter it should show new data on same screen. But the text dont appear on the screen even though it is asserted as true. When I click on type I , it shows at that time. But new data does appear on screen
  • a

    acceptable-fall-11897

    10/30/2022, 1:38 AM
    I am totally new and I have do parallel in gitlab but all jobs are running on all nodes and on local machine parallel not work
  • s

    stale-optician-85950

    10/30/2022, 3:53 PM
    Without providing any workflow code, CLI commands, or examples of what you have already done, it won't be easy for people to help you. I'm not using Gitlab but there is full documentation here https://docs.cypress.io/guides/continuous-integration/gitlab-ci#Parallelization
  • n

    nutritious-army-46708

    10/30/2022, 4:30 PM
    Sorry for submitting question on Sunday! Does anyone know how to mock URL data from a pointed domain? for example, I need to get 1000 URLs from youtube(www.youtube.com/***) as test data. Thank you so much!
  • q

    quick-painting-17010

    10/30/2022, 6:26 PM
    Please help, tell me how can I select the .day element after .active (in this case 31, but the days change), I find all the necessary .day elements but I can’t select the right one because it is not a brother of .active. Tried
    .find('td.day').nextAll('.active').eq(1).click();
    but this does not work
  • q

    quick-painting-17010

    10/30/2022, 7:23 PM
    It turned out to select the desired element using .each ()
    Copy code
    .find('td.day').each(($td, index, $list) => {
          if ($td.hasClass("active")) {
            cy.wrap($list).eq(index + 1).click();
          }
        })
    If there is an easier way, please tell me
  • g

    gray-kilobyte-89541

    10/30/2022, 8:00 PM
    Copy code
    js
    cy.get('.day.active')
      .invoke('index')
      .then((k) => {
        cy.get('.day')
          .eq(k + 1)
          .should('have.text', '4')
      })
  • g

    gray-kilobyte-89541

    10/30/2022, 8:02 PM
    https://github.com/bahmutov/cypress-examples/commit/f03f652c4bfe2a42c98b3632856629eb0ca278e8
  • q

    quick-painting-17010

    10/31/2022, 5:20 AM
    This method does not work for me, and I do not understand how it should work, when searching for
    cy.get('.day.active')
    we get one element and its
    'index'
    will always be
    0
    , how does it work for you? Understand
  • l

    limited-soccer-30880

    10/31/2022, 5:58 AM
    Hi all, I just upgrade to cypress 10.11.0, but when I deploy the test to kubernetes pod, it just can't load the page. Here is the error that I have. I tried to destroy that loading request with cy.intercept('https://stats.g.doubleclick.net/*', req => req.destroy()); but it still generate the same error (without the request) here is the code Then(/^I am viewing the site from "(.*)"$/, (country) => { var url; switch (country) { case 'Australia': url = SITE_ENVIRONMENTS.AU; break; } cy.intercept('https://stats.g.doubleclick.net/*', req => req.destroy()); cy.visit('https://gpn_dev:nosuits@dev.gpnotebook.com/'+url); });
  • g

    gray-kilobyte-89541

    10/31/2022, 10:59 AM
    Well, I posted by code and HTML, and it runs as a test so it is verified. You can definitely provide your own html and spec in a fiddle so someone can run it
  • l

    limited-barista-33480

    10/31/2022, 3:03 PM
    Hey guys, I have a problem with the certificates that cypress generates, it is generating a lock in a section of code. This certificate can be modified or changed, here I see the route where it is generated.
  • m

    melodic-energy-94905

    10/31/2022, 3:29 PM
    Hi I write this command and when I run its failing in cy.origin with reason Cypress.Commands.add('loginSession', (email,password)=> { cy.session([email,password],() =>{ cy.visit("https://vismaadvisorytools.stage.vismaonline.com/AdvisorLogin?client=59db66d7-0af5-4fe8-bb86-22bee877e47d") cy.get("#onetrust-accept-btn-handler").click(); cy.title().should('eq', 'Visma Online'); cy.origin("https://connect.identity.stagaws.visma.com", { args: {email, password} }, ({email, password}) => { cy.get('#Username').type(email); cy.get("#LoginButton").click(); cy.get("#Password").type(password); cy.get("#LoginButton").click(); } ); }); });
  • m

    melodic-energy-94905

    10/31/2022, 3:30 PM
    I wish to login 1st https://connect.identity.stagaws.visma.com and then to enter in the https://vismaadvisorytools.stage.vismaonline.com/ because this is the main url where to navigate to test my application
  • m

    melodic-energy-94905

    10/31/2022, 3:31 PM
    What I made wrong I have the lateste version of cypress v10.11.0
1...134135136...192Latest