https://cypress.io logo
Join Discord
Powered by
# help
  • m

    magnificent-finland-58048

    06/29/2022, 6:15 PM
    what's the TS config target? I think nullish co. needed 2018 or later
  • s

    swift-angle-95455

    06/29/2022, 6:21 PM
    Inside my cypress folder there are not any
    tsconfig.json
    , I suspected about that, then I created one and set it to "es5", restarted the server and the error still occurred.
  • s

    swift-angle-95455

    06/29/2022, 6:28 PM
    Actually, you can try the same error, install @hapi/iron, import it in a spec file, use the Iron.seal() with whatever data (e.g. the data from the screenshot) and you'll see the same error. I think the async await is an antipattern but that is not the focus, before that, I had the Iron.seal() inside a auth0 custom command sealing access token into a cookie, but that goes beyond this issue.
  • m

    magnificent-finland-58048

    06/29/2022, 6:31 PM
    es5 for sure won't work
  • m

    magnificent-finland-58048

    06/29/2022, 6:32 PM
    set it up like this repo, https://github.com/muratkeremozcan/cypress-crud-api-test/blob/main/tsconfig.json#L14 increase the target to es2018 or higher
  • m

    magnificent-finland-58048

    06/29/2022, 6:33 PM
    that's a cy.ts file, yet there is async await in it... something is terribly wrong
  • m

    magnificent-finland-58048

    06/29/2022, 6:35 PM
    node code will only work wrapped in a cy.task, then you'll have to call cy.task with it. The linked repo will help then take a look at this

    https://www.youtube.com/watch?v=2HdPreqZhgk▾

  • s

    swift-angle-95455

    06/29/2022, 6:41 PM
    Sorry, it is a cy.ts, I jump from my project to real-world-app repo quite often and I mixed up the file names. https://levelup.gitconnected.com/using-cypress-with-next-js-and-auth0-2dbe7282dcf this is the guide I was following, can you try following this guide? But no need to create an Auth0 account, just use the @hapi/iron the way it is showed with dummy data. The publisher used the mentioned library inside a command, and then that command used in a test file.
  • s

    swift-angle-95455

    06/29/2022, 6:42 PM
    I'm gonna check it out!
  • m

    magnificent-finland-58048

    06/29/2022, 6:43 PM
    if u have a easy repo I can can just roll my face on the keyboard with and reproduce, I can do that 🙂
  • s

    swift-angle-95455

    06/29/2022, 6:44 PM
    Thank you, I'm working on that.
  • b

    bumpy-library-92619

    06/29/2022, 8:05 PM
    Hi, is it possible to use an if else statement in cypress to check for example if the user is a an buyer/seller or admin
  • s

    swift-angle-95455

    06/29/2022, 8:25 PM
    Check this about conditional testing https://docs.cypress.io/guides/core-concepts/conditional-testing#What-you-ll-learn
  • l

    late-planet-4481

    06/29/2022, 8:27 PM
    What am I doing wrong here? It looks like valid JSON to me.
    '{"retries":{"runMode":0}}'
  • s

    swift-angle-95455

    06/30/2022, 2:36 AM
    Why removes session data? Is that the reason my auth0 flow doesn't work? I guess Auth0 universal login sends cookies to the app in order to tell the app the user has authenticated successfully, but Cypress deletes them and my app can't show the logged in state. There is a video when
    cy.origin()
    was introduced, and all worked as expected in that time because the delete behaviour was not the default.
  • s

    swift-angle-95455

    06/30/2022, 2:40 AM
    How can I opt-out the default behaviour?
  • r

    rough-hamburger-82157

    06/30/2022, 7:25 AM
    i want to prepare documentation on my project any body have sample documentation
  • s

    strong-kangaroo-46309

    06/30/2022, 8:35 AM
    Hello all. I am experimenting a little bit with Cypress but I am having some trouble. My use case is this: We are building a plugin for Confluence Cloud. This plugin is supposed to add an iframe and display some content (first screenshot with the two navigation bars). The issue is that when running a simple test, just logging in to the Confluence instance, after logging in I cannot see the content and the iframe is not added at all (second screenshot with just one navigation bar). Do you have any idea what could be causing this issue? If you need more information please let me know. We are seriously considering to Cypress but this is a blocker for us.
  • q

    quiet-wall-39409

    06/30/2022, 8:43 AM
    Bit of an odd one request but does anyone know if there is a way to enable automatic scrolling of the steps in the runner when running the test using Cypress Run? Trying to debug my tests using the videos (got a test that is only failing in headless mode) and would be good to see what commands it is running before it fails, does anyone know if this is a feature? anything I google comes up with page scrolling but I am looking for scrolling of the test steps in the runner
  • m

    magnificent-finland-58048

    06/30/2022, 9:43 AM
    try this plugin https://github.com/javierbrea/cypress-localstorage-commands example usage for feature flag testing https://github.com/muratkeremozcan/react-hooks-in-action-with-cypress/blob/main/cypress/e2e/feature-flags/bookables-prev-next.spec.js#L40
  • m

    magnificent-finland-58048

    06/30/2022, 9:44 AM
    can you attach the video? The cy:run behavior has to be the same as cy:open; follows the test. If it' sitting in the beginning and not following, either there is a very long log , which you might be able to toggle with some screen size hacks, or there is a real issue
  • m

    magnificent-finland-58048

    06/30/2022, 9:45 AM
    try this plugin https://www.npmjs.com/package/cypress-iframe
  • q

    quiet-wall-39409

    06/30/2022, 9:54 AM
    Hi unsure if I will be able to share the video due to company policy, will see about cropping or something. Looking at the video more closely it seems to get to the 30th command and then stop scrolling the commands in the runner but keeps the test running 🤷‍♂️
  • s

    strong-kangaroo-46309

    06/30/2022, 9:55 AM
    @magnificent-finland-58048 I do not think this will work. The problem is not that I cannot interact with the iframe, the iframe does not even show up 😓
  • s

    swift-controller-90067

    06/30/2022, 9:56 AM
    hey I am trying to run the cypress cicd image locally to try and diagnose why some tests are only failing it gitlab. I have pulled the image and have this
    Copy code
    docker run --rm -v ${PWD}:/myvol -w /myvol cypress/included:9.4.1 "npm install & npm start"
    which 'succeeds' in that cypress runs, but the npm server doesn't, so cypress can't find localhost:3000. something wrong with my syntax?
  • m

    magnificent-finland-58048

    06/30/2022, 10:00 AM
    try this https://github.com/bahmutov/cypress-movie
  • m

    magnificent-finland-58048

    06/30/2022, 10:02 AM
    I see, so the app served locally vs cypress wrapping it look and feel different you're going to have to wrestle some settings. If @fresh-doctor-14925 couldn't help you with that, no one can, until you reproduce it in an open repo
  • q

    quiet-wall-39409

    06/30/2022, 10:03 AM
    will take a look, thank you 🙂
  • m

    magnificent-finland-58048

    06/30/2022, 10:04 AM
    what starts Cypress? npm start is supposed to start the app... But you mention the app isn't started , and Cypress is just use https://www.npmjs.com/package/start-server-and-test and be done with it 😄
  • p

    polite-breakfast-98741

    06/30/2022, 10:09 AM
    Can i anyone help to setup Chakra ui react cypress?. components are mounting unstyled.
1...99100101...252Latest