https://cypress.io logo
Join Discord
Powered by
# i-need-help
  • Component testing vs Jest
    p

    prehistoric-restaurant-72560

    03/03/2023, 2:57 PM
    My client wants to use Component testing over Jest for unknown to me reason. Is there is any advantages/disadvantages comparison? Or why someone would switch to Cypress Components over Jest.
    f
    w
    • 3
    • 6
  • After importing a package, I got an error message
    i

    icy-zoo-67885

    03/03/2023, 3:20 PM
    Details on stackoverflow: https://stackoverflow.com/questions/75628862/cypress-the-original-argument-must-be-of-type-function
    e
    b
    m
    • 4
    • 14
  • cy.origin() Cypress not opening page from another domain.
    c

    curved-pager-86474

    03/03/2023, 5:52 PM
    Hi, dear Cypress community. Please help me to resolve the following problem After clicking on the "MakePayment" button (screen from my test environment), the user is redirected to the payment page. URL of the payment page looks like this "https://checkout.stripe.com/c/pay/cs_test_a1E8WaWpykZA5UJXYg81r3YzULc1a1nnnEHsIOn" where "cs_test_a1E8WaWpykZA5UJXYg81r3YzULc1a1nnnEHsIOn" is unique for each user and generated new every time after clicking the "MakePayment" button How to tell Cypress to "pick up" what's after https://checkout.stripe.com/c/pay/ ? cy.OpenMakePaymentTest() cy.get(makePayment.radtioCustomAmount).click() cy.get(makePayment.textInputField).type (100) cy.get(makePayment.makePaymentButton).click() cy.wait (6000) cy.origin('https://checkout.stripe.com/', () => { cy.visit('/c/pay/') }
    a
    • 2
    • 12
  • Print available aria roles?
    g

    gray-fireman-87590

    03/03/2023, 8:56 PM
    Hey folks - in react testing library you can print the available aria roles by using getByRole() with some non-existent role. This has the side effect of showing you whats available in the DOM. Does something like this exist in cypress? I'm using findByRole from cypress testing library, but that doesn't have the same effect. Thanks
    w
    • 2
    • 1
  • The error was thrown while executing your e2e.setupNodeEvents() function: Cannot find module 'xlsx'
    b

    billions-forest-4884

    03/03/2023, 9:38 PM
    Hi Everyone, I am having issue with xlsx lib when wring plugin. It works in local but when I push to github it failed. We also use saucectl to run cypress tests with saucelabs/saucectl-run-action@v3 but it is NOT ABLE TO INSTALL XLSX. Please help!
  • Unable to work with Cypress-Markdown-Preprocessor
    m

    modern-dawn-86006

    03/04/2023, 5:02 AM
    I am having issues in running Bahmutov plugin, I don't know how to debug this (I am a newbie) . I have attached the screenshots
    g
    • 2
    • 2
  • Need some help with the documentation
    c

    creamy-knife-18587

    03/04/2023, 5:07 PM
    I am getting confused after reading this section in the documentation. Under Reference -> Best Practices, there is this section called "Dangling State is your friend" https://docs.cypress.io/guides/references/best-practices#Dangling-state-is-your-friend Here, it says that we should make use of the state in which a given test finishes. But doesn't this kind of conflicts with cypress's philosophy of test isolation and beginning each test on a clean slate? It's also mentioned there that
    In fact, Cypress does not clean up its own internal state when the test ends.
    But isn't this contradictory to the fact that cypress cleans up everything like cookies, local storage, spies etc after each test? Moreover, in the example in the section referred above, won't logout anyway happen (as cookies are cleared after each test) and so there won't be no need to write
    cy.logout()
    ? Could someone plz throw some clarity on this? I'm getting confused after reading it, apologies if i am missing anything πŸ˜…
    g
    • 2
    • 1
  • Correct Package for DB Connection
    c

    colossal-table-38461

    03/04/2023, 6:02 PM
    Hello All, We are using Microsoft SQL Server Management Studio as a DB & I need to create connection with this DB to get the Data from Table using Cypress. Which Cypress or NPM Package I need to use to Automate this scenario ???
  • need help implementing cucumber
    a

    adorable-motorcycle-9887

    03/04/2023, 9:22 PM
    https://kailash-pathak.medium.com/how-to-grow-cucumber-in-cypress-in-just-10-steps-21c5a086b929 So I was using these steps but step 6 requires to put testfiles into cypress.json cypres.json isnt used anymore and therefore I tried putting it into cypress.config.js file and i dont know where to put it and im pretty sure testfiles isnt recognised anymore If there is anyone that can help that would be great.
    a
    • 2
    • 2
  • Calling vue component method
    m

    many-musician-13324

    03/05/2023, 2:09 PM
    Hello! I'm trying to use Cypress Component Testing inside my Vue project, but I can't make it call an exposed method from the test. I created a repo with the issue: https://github.com/Ericlm/cypress-vue-ref. I have a
    CustomDialog
    component with an exposed
    showDialog
    method, but I can't call it from the test. I tried using the vue test-utils wrapper https://docs.cypress.io/guides/component-testing/vue/examples#Customizing-cymount but I can't get it working. Any help would be appreciated! πŸ™‚
    w
    • 2
    • 4
  • cy.session() is not storing session storage.
    c

    curved-agent-32333

    03/05/2023, 2:11 PM
    I am using cy.session() to store local and session storages before tests so that I dont have to log in each time. However it seems that the session storage is not stored as expected. Local storage and cookies are strored, though. Here you can find my test spec. I believe it might be related to some domain stuff but could not find anything as of now. Anyone can help me with this?
    a
    • 2
    • 1
  • Next.JS Enviroment Variables in Tests
    c

    clever-analyst-59201

    03/05/2023, 4:17 PM
    Hello, I am trying to setup tests for my app which requires environment variables. I tried adding a
    .env.test
    with the env variable but it still errored (supposed to do that)
  • What is the best place to put test specs? Is it ok to have them on src folder with all of the logic?
    c

    curved-agent-32333

    03/06/2023, 8:16 AM
    We have a mono repo React application and currently we are planning to write e2e tests using cypress. There is a discussion about where to put the test spec files and one of the suggestions is implement them on the src>apps folder. I believe it is not a good idea and it is better to separate them to cypress folder. But is there any idea/thoughts regarding this?
    e
    • 2
    • 2
  • Cypress run fails to verify that the server is running while Cypress open works fine
    m

    most-table-70794

    03/06/2023, 9:00 AM
    For some reason when I try to run
    cypress run
    with the baseUrl set I keep getting this error :
    Copy code
    Cypress failed to verify that your server is running.
    
    Please start this server and then run Cypress again.
    But when I remove the baseUrl and replace all
    cy.visit(/)
    to my website's url it just fails to open it. Meanwhile running
    cypress open
    works fine and allows me to run my spec without any problem.
  • Struggling to make cypress wait for element when a combination of get and should are used
    e

    echoing-hamburger-46900

    03/06/2023, 11:20 AM
    I'm trying to get an element using
    cy.get(".classOfElement", {timeout:10000}).should("be.visible").and("contain", "some text ")
    From my understanding, the chained
    should()
    should abide by the timeout defined in
    get()
    . So even if the element is found by
    get()
    it won't return the element until the
    should()
    and the
    and()
    are satisfied. Am I wrong? Is that not how it works? Currently the behaviour I see is that the initial
    get()
    runs, the element is found, but it doesn't seem to wait any longer after that for the chained commands. Which in turn instantly fail because the contents hasn't loaded yet.
    g
    • 2
    • 8
  • why are my posts being deleted
    a

    adventurous-garden-6944

    03/06/2023, 12:14 PM
    im trying to ask for help and the bot keeps deleting my posts "duplicated text" is it the code snippet ?
    b
    r
    m
    • 4
    • 8
  • Can't find the element with cy.get()
    l

    limited-yacht-64327

    03/06/2023, 1:10 PM
    I cannot find the element i am looking for and I don't get why, please help
    g
    • 2
    • 2
  • "Timed out retrying after <Count>>ms" Error Fine in local but showing this error in CI/CD
    i

    incalculable-rainbow-43330

    03/06/2023, 1:50 PM
    Team is there any article which can help us real with "Timed out retrying after .....ms" Error either while clicking or expected to find element. so that it helps us, and the problem is we are able to see the test cases working fine in local but failing with timeout randomly in CI/CD Any help is highly appreciated πŸ‘
    g
    • 2
    • 5
  • Dependency conflict with Cypress 12
    b

    brief-kite-35331

    03/06/2023, 3:29 PM
    I am trying to upgrade to Cypress 12, but I have this error with the conflicting
    w
    • 2
    • 2
  • Log/access error message on test retry to pipeline console
    e

    elegant-cartoon-16547

    03/06/2023, 3:38 PM
    Currently: an error message will be displayed in stdout if my test fails on the last retry attempt, the error message will only provide details to the last retry attempt and the reason for its failure (not the previous attempts). What I want: If the test fails on the first attempt I want to know why, even if it passes on the next attempt. I want the the information as to why the first attempt failed to be logged to my stdout console window.
    • 1
    • 3
  • Cannot intercept two similar requests
    r

    ripe-apple-15128

    03/06/2023, 4:17 PM
    I'm not sure why, but routeMatcher is not working with this url (rest/orders/?filter{created_at.gte}=2023-02-21T04:00:00.000-08:00). I'm intercepting two routes that have different params:
    Copy code
    cy.intercept({
            pathname: '/rest/orders/',
            query: {
              'filter{created_at.gte}': `${end.minus({ days: 14 }).toISO()}`,
            },
          }, { fixture: 'transformed-orders-primary-reports' });
    
          cy.intercept({
            pathname: '/rest/orders/',
            query: {
              'filter{created_at.gte}': `${end.minus({ days: 28 }).toISO()}`,
            },
          } ,{ fixture: 'transformed-orders-secondary-reports' });
         });
    • 1
    • 1
  • command not being executed
    a

    adventurous-garden-6944

    03/06/2023, 4:40 PM
    @best-flower-17510 same thing just happened again, this might be happening because there's some repetition in the code snippet, but thats the code, i cant change it because i need help with it
    b
    • 2
    • 2
  • command not being executed
    a

    adventurous-garden-6944

    03/06/2023, 4:56 PM
    Cypress is skipping the 2nd command and moving straight to intercept. i know there might be an issue with the way i'm trying to click the button, any help with that will also be much appreciated
    g
    • 2
    • 4
  • cy.each + Cypress.Promise not calling what's inside Cypress.Promise
    m

    melodic-egg-83620

    03/06/2023, 5:10 PM
    What is up with MEE6? It was not duplicate text.
    b
    g
    • 3
    • 16
  • Impact of CRF on compression speed
    b

    brainy-easter-37961

    03/06/2023, 6:12 PM
    Hello! Can anyone tell me if there is a relationship between the
    videoCompression
    value and how fast the compression will run? I'm looking into making our test runs faster, but without completely disabling the screen recordings. Will decreasing the CRF make the compression algorithm run faster? docs link: https://docs.cypress.io/guides/references/configuration#Videos
    a
    • 2
    • 2
  • cy.origin error in v12.7.0
    c

    chilly-queen-22182

    03/06/2023, 9:52 PM
    Does anyone have idea about this please help
    w
    h
    • 3
    • 2
  • Best practice for intercepts and test speed
    s

    shy-ice-49412

    03/06/2023, 10:39 PM
    I've got a whole bunch of tests and suites, and I have historically setup my intercepts in each suite (i.e. each file) in a beforeEach and they have been general intercepts (i.e. no POST/PUT/etc specified). However I'm wondering if there is a best practice regarding this that would make my tests run faster. - Should intercepts be setup in before, beforeEach, or in individual tests? Does this only depend on how many of the tests in the suite use it? - Does the intercept method/type (i.e. POST, PUT, etc) make a difference in speed? Thank you!
  • cy.writeFile does not work in headless mode (cypress run) with async function
    g

    gray-crayon-29691

    03/07/2023, 12:26 AM
    Hi everyone, I'm facing a really weird issue with
    cy.writeFile
    does not work in
    cypress run
    mode when writing data from the async function but works in cypress IDE
    cypress open
    mode Any idea why this is not working in
    cypress run
    mode?
    Copy code
    async function getSheet() {
    return 'something'
    }
    cy.writeFile('file.js', JSON.stringify(getSheet))
    g
    • 2
    • 4
  • Skipping Login by setting the jwt cookie in browser
    h

    happy-van-86145

    03/07/2023, 10:40 AM
    Hi, I've set the jwt token in cookie but when I visit the url, I'm not logged in. I'm not sure where I'm going wrong, please can someone help. It seemed to work in version6 but upgrading to V12 it doesn't work amymore. I've attached two files, a command file with the custom function written where I'm calling the api too generate the token and then a specfile.js where I'm calling that function.
    • 1
    • 1
  • Help to resolve session issue when test run contains log out functionality on ci/cd
    m

    magnificent-baker-97250

    03/07/2023, 11:29 AM
    Hi, Cypress Community. Can some one advice how to resolve such issue? i am running my e2e tests in buildkite on 8 machines. All tests are using cy.session with the same account . And in the specs I have tests where I need to log out and enter as another user. When this test runs in parallel all other machines also get loged out - it makes them fail. How can I make for each machine unique session? As I understand cypress share browser session and status for all running machines in parallel.
    • 1
    • 1
1...121314...26Latest