Results 1 to 10 of 11

Thread: Running it-blocks that require the completion of another it-block

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Answered: Running it-blocks that require the completion of another it-block

    Hello there,

    Lets say in my first it-block I test the navigation to a specific component.
    The second it-Block should then test the functionality of this component.

    - How can I make sure that the first it-Block is executed before the second one?

    - Let's say it-Block 3 requires the execution of it-Block 1 but not 2, how would I achieve this behaviour?

    - Is this even a good practice, or should each it-Block be autonomous?

    - Is using standard JS functionalities like async/await, promises and callbacks the proper way to go here?

    A good source or a guide to control the 'code flow' would be appreciated

  2. Normally, each test (each "it" block) should be self contained so that the order in which they run doesn't matter (or if you decide to just run one test, instead of all). However, for end-to-end testing, you're typically testing the flow of the entire application, so it's common to have a series of tests that need to be run in order, with the subsequent test dependent on the actions performed in the previous test.

    When tests are executed, a test won't run until the previous test has completed, so they are always executed in order and won't proceed until the actions and expectations in the previous test have been completed.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •