https://cypress.io logo
Join DiscordCommunities
Powered by
# help
  • g

    gray-kilobyte-89541

    12/22/2022, 4:23 PM
    what is the
    "scripts"
    in your
    package.json
    file?
  • a

    abundant-tailor-4878

    12/22/2022, 4:30 PM
    ❗ ‼️‼️‼️‼️‼️ Hello Everyone, someone very experienced in cypress please advise if you can help on solving this issue I face: ***Project tools:* ** -Cypress v 12.0.2/ cucumber preprocessor/typescript> Issue Description - After updating cy v9 to cy v 12, and added new plugin @badeball/cypress-cucumber-preprocessor, when running my project - ***if test fails I can't see at which line did the test failed it shows only my feature files in error. Its really hard to debug and fix when the tests are failing.* ** If I run my old project before updating I can see the line where the test has failed, and I am confirming that this is not a system operations issue. I would really appreciate if anyone can help. Thank YOuu!!!!
  • a

    acoustic-diamond-87641

    12/22/2022, 5:16 PM
    How can I specify different user login information dependant on the config file I use? I'm trying to use different user login profiles depending on the environment I am testing (e.g.
    dev-config.config.js
    and
    staging-config.config.js
    both contain different values for
    My_acc.email
    and
    My_acc.password
    ). My code worked when I only used 1 user profile and accessed it through a fixture like so.
    Copy code
    cy.fixture("user").then((user_credentials) => {
                cy.get(emailInputField).type(user_credentials.My_acc.email);
    However, when I got rid of the fixture file and transferred the json information from my user fixture over to individual config files for user profile specification it didn't work. Here is my new code which fails.
    Copy code
    Cypress.env().then((user_credentials) => {
         cy.get(emailInputField).type(user_credentials.env.email);
    The type error I received was this
    Cypress.env(...).then is not a function
    This is my first question in this community and I thoroughly searched the docs first, but I could not find a answer in the
    Cypress.env
    docs.
  • f

    fast-napkin-36711

    12/22/2022, 7:42 PM
    It only has one line to start HTTP server that I use. So, I think the action clones my installation of cypress, instead of the installation that has this build script shown in the example.
  • g

    gray-kilobyte-89541

    12/22/2022, 8:04 PM
    so in that case do not use the
    build
    parameter in your YML
  • f

    fast-napkin-36711

    12/22/2022, 8:38 PM
    Is the build script necessity to store the installation as an artifact? Or, can that step be skipped?
  • g

    gray-kilobyte-89541

    12/22/2022, 10:15 PM
    no, build step is something YOUR application does. Cypress github action just supports calling it to make your life easier. If you don't have it, then don't use this action parameter.
  • f

    fast-napkin-36711

    12/22/2022, 10:39 PM
    Thank you
  • s

    straight-rose-89671

    12/23/2022, 8:19 AM
    We have a laravel/inertia/vue app. So in order for everything to work i need to run composer, npm, mysql for the db ? When running the composer command i get an error for the nova licence key 😅 Didn't think this would be so hard to integrate with
  • s

    straight-rose-89671

    12/23/2022, 9:43 AM
    Setup everything in github actions: 1m30 starting and running actual tests 1m
  • s

    straight-rose-89671

    12/23/2022, 11:28 AM
    Does the Cypress action cypress-io/github-action@v5 needs to start the server or can it read the server that has been started already in the background ? I'm getting a 404 so i'm not sure what i need to do.
    Copy code
    Boot Laravel app:
     -    INFO  Server running on [http://127.0.0.1:8080].
    Next command:
    waiting on "http://127.0.0.1:8080" with timeout of 60 seconds
  • r

    ripe-traffic-15039

    12/23/2022, 12:00 PM
    Hello, I am running the following test on different computers, on one of them I get the following error. I think it's because of node, does anyone have an idea? both pc have the latest version 18.12.1
  • q

    quaint-raincoat-85755

    12/23/2022, 1:00 PM
    Hi, I have worked with Cypress test parallel runs from GitHub actions. We just noticed today that for some reason videos at cypress dashboard are not very interactive after GitHub cloud agent job runs. Does anyone has any idea why videos are lacking? Scenario and specs: - GitHub executors 5 pcs (ubuntu-latest) - Cypress team version in use - Github integration set on to Cypress cloud - Records on using cypress-io/github-action@v5.0.2 to execute tests at parallel at 5 containers.
  • b

    best-hamburger-60297

    12/23/2022, 2:29 PM
    Hi, Cypress only handles "hard failure"? Is it possible to handle "soft failure" (the test continues and throws all exceptions when the test ends). Example test all error messages if a message is not compliant, we continue to the next one
  • b

    bitter-fountain-36713

    12/23/2022, 3:20 PM
    You can check the erro messages on the page generated by the invalid inpugs
  • v

    victorious-engineer-43946

    12/23/2022, 3:21 PM
    Hello. Can anyone help me understand if there's a benefit in committing the
    results
    folder to git? (or whichever folder you send your reporter output)
  • g

    gray-kilobyte-89541

    12/23/2022, 6:28 PM
    https://glebbahmutov.com/blog/cypress-soft-assertions/
  • p

    prehistoric-oxygen-77880

    12/23/2022, 6:34 PM
    Does anyone know how to run cypress component tests in a gitlab ci?
  • c

    clean-gpu-44016

    12/24/2022, 2:30 AM
    Hello, I can't open Cypress. I'm using WSL2, Windows 10. Steps taken:
    Copy code
    sudo apt upgrade && sudo apt update
    npm install --save-dev cypress
    sudo apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
    then I followed the guide: https://nickymeuleman.netlify.app/blog/gui-on-wsl2-cypress which led me to the output below (screenshot) How should do I fix this?
  • t

    thousands-house-85089

    12/24/2022, 11:19 AM
    Up the resources on your test runner. It's likely low CPU or Memory for handling videos.
  • t

    thousands-house-85089

    12/24/2022, 11:22 AM
    DM me if you still have issues. Can share something similar I've done with env configs and env variables if it will help
  • g

    green-airplane-10074

    12/24/2022, 3:37 PM
    Hi folks, I'm new to Cypress and spent the past 3 days on this "simple" use case. I want a function to return the innerText of a tag using Cypress. ---------------------------------------------------------------------------------------------------- *Expected Results: * I need cypress to return the value of the tag. So the expected return value is "hello world". hello world Here's what I've tried: static getMyInnerText():string { var myVal; cy.get('[data-test="foo"] > b').invoke('text').then((myInnerText) => { myVal = innerText; }); return myVal; } Observed Results: The returned value of the function 'getMyInnerText()' is "undefined". The variable "myVal" stores the correct value inside the then() block but has the undefined value outside of it. At one point I had 70 tabs opened for this, I tried some jquery flavor of it as well, but the same thing. When I had "cy.log()" AND return statement inside my "then()" block, I saw an error related to the mixing of async and sync code. But I couldn't find a way to solve this, I tried using cy.wrap() but that didn't solve the issue either. ---------------------------------------------------------------------------------------------------- Can anyone please help me with their suggestions or even hints? Thanks in advance for your time.
  • g

    gray-kilobyte-89541

    12/24/2022, 3:45 PM
    https://docs.cypress.io/guides/core-concepts/introduction-to-cypress#Commands-Are-Asynchronous and at first it might feel weird, but it works really well, just look at some examples, like https://glebbahmutov.com/cypress-examples/9.7.0/commands/querying.html
  • g

    green-airplane-10074

    12/24/2022, 5:48 PM
    Hi @gray-kilobyte-89541 👋 Thanks for taking the time and sharing these links with me, now I know why I'm seeing an "undefined" value for my variable. As far as my use case is concerned, this helps:
    Copy code
    You purposefully cannot do anything useful with the return value from a command.
    I'll try to put the code under the "then()" block and see how it goes, so this has been very helpful to me.
  • b

    bitter-fountain-36713

    12/24/2022, 7:03 PM
    Also a note, I believe .text() returns the text content and not innertext.
  • k

    kind-angle-5131

    12/26/2022, 8:16 AM
    Hi guys, I have a project at work and I just finish to prepare a short demo for my team regarding cypress integration with our project, and we are using TestRail, do you have some idea of plugin that can be integrated in order to publish result after test run execution in the testrail?
  • f

    flaky-intern-13440

    12/26/2022, 11:55 AM
    Hi everyone 👋 merry Christmas and happy New Year. I have a question about Plugins File Removed. Per documentation, Cypress v10+ has merged the
    cypress.json
    and the
    cypress/plugins/index.js
    files into a single
    cypress.config.js
    file and a separate "plugins file" (which used to default to
    cypress/plugins/index.js
    ) is no longer needed. We use a lot of our custom made plugins like LaunchDarkly, GeneratorTask, DataSession, etc and so on..., so our
    cypress/plugins/index.js
    is pretty massive for each service (we on a monorepo). Can someone explain it to me please, with this Plugins File Removed update in Cypress v10, what exactly should I do with our
    index.js
    file? Should I copy the everything (200+ lines of code) from that file and paste it into the
    cypress.config.js
    under the
    e2e --> setupNodeEvents
    ? and then delete the
    index.js
    file? I tried that, and it doesn't work. Or, with this update, all what I need to do is:
    Copy code
    setupNodeEvents(on, config) {
          return require('../plugins/index')(on, config)
        },
    Is that right way to do it? If the copy-paste the entire code from the
    index.js
    and paste it into the
    cypress.config.js
    is more preferable way, what I'm doing wrong? since that doesn't work for me. Thank you in advance for any help.
  • c

    clever-judge-99709

    12/26/2022, 11:59 AM
    hello, i want to run my cypress tests in parallel on jenkins machine. Can you help with this.. i found this article https://docs.cypress.io/guides/continuous-integration/ci-provider-examples#Jenkins ... this is not what we need. we are trying to run our test iterations at the same time in the same spec file we wait your answer as soon as possible..
  • t

    thousands-gpu-36872

    12/26/2022, 2:42 PM
    Hello Guys ! Im trying to use the cy.writeFile() to generate a csv comma separated passing a object (json), it´s possible to generate this kind of file ?
  • l

    limited-barista-33480

    12/26/2022, 3:44 PM
    ok, thanks for sharing this documentation, I'm going to review it and I'll try to implement it with the tasks, to be able to run the JavaScript code
1...237238239...252Latest