https://cypress.io logo
Join DiscordCommunities
Powered by
# e2e-testing
  • b

    bored-kitchen-98972

    01/01/2023, 5:23 PM
    I will try it. Thanks.
  • f

    fresh-truck-40418

    01/02/2023, 10:21 AM
    hello everyone, I'm migrating my Cypress tests from v11.x to 12.x and i'm reading this https://docs.cypress.io/guides/references/migration-guide#Test-Isolation On my website, let's say that I have to test a pretty huge KYC-validation process. It's a process that goes on 7 differents steps. Each steps is a different page, with differents things to fill or not. At this very moment I have 18
    it()
    to cover the whole process. With the 11.x I just had to do one
    .visit()
    to go to the fist step. Then I fill the inputs I need, then I submit the form from this first step and boom, second step without a new visit, since the page changed with the validation of the form. How I am supposed to do with the 12.x version? I think I can't do a
    beforeEach() => cy.visit()
    since I don't know the URL of the differents steps. I have some concern about the duration of the test too if I have to login, visit the page, etc. before each of my 18
    it()
    . What should I do? Thank you for your answers.
  • m

    magnificent-finland-58048

    01/02/2023, 11:01 AM
    when there were 18 it blocks, could you run each of them with .only? If not, that was the first mistake, because it means the tests were order-dependent You can put everything in 1 it block. You can abstract away substeps to functions or commands to make that large it block more manageable You can do some of it via the api, or the browser (app actions) if it's a repeated form filling Gleb has an example repo (and a matching blog somewhere) https://github.com/bahmutov/cypress-example-forms He also has a paid course, the main example is here https://github.com/muratkeremozcan/fastify-example-tests/blob/4da614c8aa764bbcd99488d2bdbf656d7ae755f8/cypress/e2e/bonus41-43-multiPartForm-FormData-Cypress.Buffer-cy.document-invoke-write.cy.js should make more sense if you take the course
  • f

    fresh-truck-40418

    01/02/2023, 11:04 AM
    hello, thank you for your answer and your time. No I can't run each one of them with .only(). Maybe it comes from a misinterpretation of the utility of
    it()
    on my side. I use them like one
    it()
    is one thing to test on my page. Like on it() to fill this input, an other for an other one, etc. So yes, it's absolutely order-dependent. I understand my mistake, indeed. Thank you very much for the rest of your comment, I will watch this out very carefully. have a nice day and an happy new year!
  • g

    green-book-63455

    01/02/2023, 11:06 AM
    I have a svelte frontend and directus backend. I register a user via the front end and the status is set to "invited". The idea is an admin receives a notification, finds the new user in the directus app, sets status to "active" and user can then log in. And doing this manually works. But if I do this via cypress there is some unexpected behaviour. The cypress script registers the new user via the browser, then uses the directus rest api to log on as admin, get the new user id, update the status for the new user and logs out. The script then continues to log in as the newly registered user. But this login fails with invalid credentials. If I then try to login via the browser or curl then same error. User is now locked out effectively. If I do all of the above via the rest api, it works so it does seem to be cypress centred. If I split the cypress into two tests and manual step then it also works. So first script registers user. Then manually via the app as admin, find user, change status. Then second script logs on as new user and logs out. Is the problem centred around tryiong to log in as two different users within the same script, once as admin via request and once as new user via the browser? But if that is the problem, why then the user is unable to login out outside of cypress?
  • c

    colossal-table-38461

    01/02/2023, 6:46 PM
    Hello All, I am working on SMS Automation using mailosaur, while automating I am using async...await in spec file Reference : https://mailosaur.com/docs/sms-testing/ I am able to see the new SMS on mailosaur account, but I am not able to fetch the SMS in Cypress. (whatever the code which written in async is no picked for exeuction) Can someone help me here?
  • m

    melodic-egg-83620

    01/02/2023, 7:54 PM
    Question: Should Cypress be able to run e2e tests without your application running locally from another terminal?
  • m

    melodic-egg-83620

    01/02/2023, 7:59 PM
    Don't use
    async/await
    , use
    cy.request
    and
    .then
    to then do X or Y after said request is finished. If you want it to be a function you call, make it a command, and wrap the request response in
    cy.wrap
    at the end of the commend, which you can then call and use
    .then
    to get the wrapped response.
  • g

    gray-kilobyte-89541

    01/02/2023, 8:38 PM
    that is not how you use cypress-mailosaur, read the plugin's README and/or blog post https://glebbahmutov.com/blog/cypress-mailosaur/
  • m

    melodic-egg-83620

    01/03/2023, 2:08 PM
    Question: Can I configure Cypress to use a local running instance of my application vs compiling with Webpack? I'm struggling to get Cypress' webpack config to compile our application, but my application runs without a hitch.
  • a

    astonishing-window-24437

    01/03/2023, 6:36 PM
    hello everyone,
  • a

    astonishing-window-24437

    01/03/2023, 6:36 PM
    how can I use with cy.contains: if element exists, do this, if not, do this normally i can use bahmutov "if-plugin" but its not working with allure report
  • g

    gray-kilobyte-89541

    01/03/2023, 7:09 PM
    https://glebbahmutov.com/cypress-examples/9.7.0/recipes/conditional-testing.html
  • a

    aloof-quill-23445

    01/03/2023, 7:38 PM
    How to handle app re-rendering in background even after the UI elements are visible. Unable to assert using intercept as my project is using firestore API
  • a

    aloof-quill-23445

    01/03/2023, 7:38 PM
    Can anyone help me👆
  • g

    gray-kilobyte-89541

    01/03/2023, 7:49 PM
    how do you know as a user that the app has finished rendering?
  • a

    aloof-quill-23445

    01/03/2023, 7:52 PM
    After the activity indicator closes
  • a

    adorable-smartphone-87280

    01/03/2023, 7:53 PM
    cy.get(activity indictator).should(not.exist).then()
  • a

    aloof-quill-23445

    01/03/2023, 8:05 PM
    I’ll elaborate my issue here 1. Navigation to order list page 2. Added assertion to indicator not exist 3. Clicking on create order button 4. Entering new order details While entering data the fields are getting cleared as there is still background re-rendering happens and unable to save form as fields are cleared
  • a

    adorable-smartphone-87280

    01/03/2023, 8:05 PM
    https://giphy.com/gifs/spongebob-season-4-spongebob-squarepants-3oKHWqTqgnt8pBT3Fe
  • a

    adorable-smartphone-87280

    01/03/2023, 8:06 PM
    cy.wait()
  • a

    adorable-smartphone-87280

    01/03/2023, 8:06 PM
    might be your only option here.
  • a

    adorable-smartphone-87280

    01/03/2023, 8:06 PM
    if you can't use intercept.
  • a

    aloof-quill-23445

    01/03/2023, 8:08 PM
    Yea I’m managing with cy.wait() but still looking for better approach
  • a

    adorable-smartphone-87280

    01/03/2023, 8:08 PM
    all I would suggest is
    intercept
    . Sounds like your UI needs to not clear that spinner until it's truly ready for form input.
  • a

    aloof-quill-23445

    01/03/2023, 8:08 PM
    So thought of hearing from experts like you
  • a

    aloof-quill-23445

    01/03/2023, 8:09 PM
    But intercept can’t be applied here as the app is using firestore apis
  • s

    sticky-energy-17458

    01/04/2023, 4:54 AM
    @melodic-sandwich-17161 hey will you be my help for Cypress again
  • f

    freezing-nest-81773

    01/04/2023, 6:14 AM
    Hello does anyone have an idea how I can skip a whole test suite conditionally based on the current environment? I got the recommendation to use
    this.skip()
    but apparently this only works for a single test but no the whole suite... Below is the code I currently have but that fails.
    Copy code
    describe("TESTING-365 ...", () => {
    
        //Conditional skip
        if(["DEVE","INTE"].includes(Cypress.env("name"))) {
            this.skip()
        }
    }
  • g

    gray-kilobyte-89541

    01/04/2023, 11:35 AM
    I would be using test tags for it, like using
    @bahmutov/cy-grep
    plugin
1...178179180...192Latest