0

how do I test long scenarios? I have an app with 10 screens to complete. I have a dropdown on the first screen which creates a table row element on the last screen. should I do selenium or unit test or both? selenium will have to click through the whole app and call every API just for 1 assertion. unit test will only check the dropdown has the right options which are subject to change and not really worth testing. I run into this problem every time I want to write a test. i always miss something in my manual testing and introduce defects. what should I do?

Comments
  • 1
    Fix the site so that it doesn't work like this
  • 2
    If you have a very long form process that is not to be changed (business logic wide), you can try to set up steps for it. Set up the tests to load a desired state for each test and clean up at the end. This way you test a specific part only, rather than go through everything. Whether this is a good practice or not, I do not know.
  • 2
    Firstly: you do mock your api calls, don't you? If you do, it's not much of a problem if you have go through some of them for your test.
    Second: You might consider using a frontend router. So you can navigate to the last page easily.
    Third: Another pattern is to artificially set your application in a certain state before the test starts. How feasable this is depends on the framework you are using and your application design. It's particulary easy when you have state only in one place. There Was a good article in the CyPress docs about this (which i recommend reading even if you're stick to Selenium).
Add Comment