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

    polite-policeman-65273

    08/16/2022, 6:09 PM
    @gray-kilobyte-89541 Gleb, actually the password is still being exposed in cy.session if I use [username, password] as my session
    id
    Any updates on allowing passing {log: false} to cy.session?
  • c

    clean-optician-27186

    08/16/2022, 6:54 PM
    I'm having some issues with TypeScript and .then always yielding JQuery. I'm sure there's something obvious I'm missing. So in my test I have some code that calls a function. Inside that function I wrap the object I want to return and give it an alias. So after I call the function in the test, I do a cy.get for the alias, and a .then so I can use the object being returned. Something like this:
    Copy code
    getObject(someVar)
    cy.get('@alias').then((object) => {
      //some code using the object here
    }
    But the problem is, when using TypeScript, I can't treat
    object
    like an object because it is always JQuery. Help?
  • g

    gray-kilobyte-89541

    08/16/2022, 7:14 PM
    no, you could probably track it by watching a github issue
  • g

    gray-kilobyte-89541

    08/16/2022, 8:56 PM
    Copy code
    ts
    describe('casting an aliased value', () => {
      it('yields a number', () => {
        // this particular alias keeps a number
        cy.wrap(42).as('magic')
        cy.get<number>('@magic').then((n) => {
          expect(n).to.be.a('number').and.to.equal(42)
        })
      })
    })
    Other commands can be cast similarly
  • g

    glamorous-country-57678

    08/16/2022, 8:57 PM
    Hey everyone, is it possible to have conditional logic in a cy.intercept request? Ideally, I am looking to mock something like this here: https://github.com/Unirep/Unirep-Social/blob/main/packages/frontend/src/__tests__/__utils__/setup.js#L23 Is doing something like this possible in cypress?
  • c

    clean-optician-27186

    08/16/2022, 9:03 PM
    Thank you! I knew there had to be a simple way to do it that I was overlooking. Works perfectly.
  • g

    glamorous-country-57678

    08/16/2022, 9:28 PM
    Can someone please explain to me why I am getting this Typescript error?
  • g

    glamorous-country-57678

    08/16/2022, 9:29 PM
    Also, getting these errors:
    Property 'findByText' does not exist on type 'cy & CyEventEmitter'.ts(2339)
  • a

    ancient-summer-26140

    08/16/2022, 10:54 PM
    Hey y'all! I was wondering if anyone has run into issues implementing Cypress with NextJS? I've been attempting it all day yesterday and today, to no avail. I keep getting the following error and all of the "fixes" that I've found online don't work with our project. I've tried with the standard
    tsconfig.json
    in my root as well as an isolated one within the cypress directory. I've also spun up a parallel app with
    create-next-app -ts
    and copied all of our dependencies over and installed Cypress. It works fine there. Another strange note is that if I add
    type: module
    to our
    package.json
    , Cypress will work as expected without errors, but this then breaks the rest of the app because NextJS won't build with
    type: module
    . Any thoughts? I really want to use Cypress, especially after having gone down this route with another test automation product that didn't end up panning out so it'll be nice to get something working and established.
  • a

    ancient-summer-26140

    08/16/2022, 11:07 PM
    Cypress with NextJS Config issues
  • s

    strong-energy-6158

    08/17/2022, 4:51 AM
    Is it defined in command.js?
  • s

    strong-energy-6158

    08/17/2022, 4:57 AM
    This might be a simple one but I am stuck with that. I have checked google but didn't get a solution. Can someone help me?
  • m

    mysterious-motherboard-13344

    08/17/2022, 5:26 AM
    check your imports defined at the top....and remove unused imports
  • s

    strong-energy-6158

    08/17/2022, 5:28 AM
    Thanks, but I didn't get you. Can you please give in detail?
  • m

    mysterious-motherboard-13344

    08/17/2022, 5:30 AM
    While we are typing in the file, some of the imports get added automatically. Those imports you will see unused (in faint colour) and when you hover, you will see 'is only declared nut never used' message. These imports sometimes create problems in our tests.
  • m

    mysterious-motherboard-13344

    08/17/2022, 5:32 AM
    I also can see some extra slash added in this line of error -
  • m

    mysterious-motherboard-13344

    08/17/2022, 5:33 AM
    While we are typing in the file, some of the imports get added automatically. Those imports you will see unused (in faint colour) and when you hover, you will see 'is only declared nut never used' message. These imports sometimes create problems in our tests.
  • s

    strong-energy-6158

    08/17/2022, 5:37 AM
    I don't have any imports in my test. My automation suite is a very simple one. I just want to learn that my suite which is present in my local can be run using Jenkins. my script has only the below line of code. it('Testcase1',() => { cy.log('Testcase1 executed') })
  • m

    mysterious-motherboard-13344

    08/17/2022, 5:45 AM
    Check if you have imported all the required commands files from other files (if existing)
  • s

    strong-energy-6158

    08/17/2022, 5:46 AM
    Yes. My suite is working fine in local. The issue is only while running from Jenkins
    m
    • 2
    • 2
  • b

    big-lifeguard-47624

    08/17/2022, 8:11 AM
    Did anybody encountered the below issue? When opening am SAPUI5 application at https://fiori-launchpad.com/fiori/mainapp/ClientBin?saml2=disabled#ZMyApp-Display white screen is shown and the error is printed out in the console: Uncaught TypeError: Cannot set property id of [object XMLHttpRequest] which has only a getter at Server.add (cypress_runner.js:180017:12) at XHR.open [as _open] (cypress_runner.js:180160:28)
  • v

    victorious-honey-34966

    08/17/2022, 9:22 AM
    I am running a test that tests a specific property (ag-grid). *Chrome and Electron work fine. * The same test fails on Firefox. cy.get('.ag-cell-value') .find('[aria-checked]') .invoke('prop', 'ariaChecked') .should('eq', value); The error is: assert expected undefined to equal true So i guess the command- .invoke('prop', 'ariaChecked') bring undefined instead of the value Any idea why?
  • m

    mysterious-motherboard-13344

    08/17/2022, 9:25 AM
    There might be some delay in page loading in firefox. Try adding some wait or check if the elements are visible first and then check their values.
  • v

    victorious-honey-34966

    08/17/2022, 9:27 AM
    I tried it. didn't help
  • g

    gray-kilobyte-89541

    08/17/2022, 10:54 AM
    Copy code
    js
    cy.get('.ag-cell-value')
      .find('[aria-checked]')
      .should('have.prop', 'ariaChecked', value)
  • v

    victorious-honey-34966

    08/17/2022, 11:18 AM
    nice suggestion but it didn't help. same behaviour
  • e

    enough-teacher-41793

    08/17/2022, 12:14 PM
    I am new to cypress. I have a query, Can cypress be used to automate kafka topics. I was unable to find any resources ?
  • a

    acceptable-hamburger-48790

    08/17/2022, 12:27 PM
    Cypress runs inside browser and i believe you need to execute command to list topics of Kafka, which is outside the scope of browser. But cypress provides exec() command to execute anything in command line. Give this a read https://docs.cypress.io/api/commands/exec
  • a

    adamant-minister-38660

    08/17/2022, 12:47 PM
    hello everyone! i am completely new to software testing and wanted to learn cypress e2e tests. now when i open cypress launcher and choose a browser to start end to end testing, the browser opens with the app but it does not start the spec explorer? can someone give me advice what might be the problem?
  • m

    melodic-egg-83620

    08/17/2022, 1:04 PM
    When Cypress opens and you choose a spec - I'm getting a babel-loader error, which is odd because I don't have babel in my project... Anyone?
1...828384...192Latest