How to deal with long running operations in End-2-End testing?



  • We use TestCafé to perform E2E-tests for a rather large management portal. Due to certain dependencies, creating or updating a ressource can take up to 30 minutes, which is why we implemented loops checking for those results.

    To save time, not every single test but mostly every fixture creates its own ressource and then the test operations are performed on the same ressource one after the other. But, because of the waiting loops, execution time is increasing rapidly with every new feature - which is why we tried introducing TestCafé's built-in concurrency feature, which did not work because tests of one fixture are executed in parallel so either a test tries to access a ressource that does not exist yet or several tests modify the same ressource at the same time.

    TestCafé Feature Requests exist to add the possibility of assigning an order to tests and to add global setup/teardown methods, both of which would help solve our problem, but as of now neither is available. What other possibilities do we have to reduce execution time of our tests?

    We do not have direct access to the system that is causing the long waits, we have to await a sync process after creating a ressource.



  • We do not have direct access to the system that is causing the long waits

    In the environments that you run your automated checks, you can stub out this system (e.g., using MockServer or WireMock), so its response will be under your control.

    You can then check the integration between your system and the external one with Pact.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2