Automated tests at the UI level for a web app adopt an asynchronous waiting mechanism that allows them to synchronize test steps with the app, so that they are executed correctly and at the right time, only when the app is ready and has processed the previous step: this is done when there are no timeouts or pending asynchronous requests. In this way, the tests automatically synchronize with the app's web pages. The same initialization tasks to set test preconditions are implemented as test steps for all tests. Regarding the pre-processing (Setup) features defined at the test suite level, the TAS provides both a Suite Setup (which runs exactly once when the suite starts) and a Test Setup (which runs at the start of each test case in the suite). Which of the following recommendations would you provide for improving the TAS (assuming it is possible to perform all of them)?
TAE strongly discourages replacing robust, app-aware synchronization with manual waits. Automatic synchronization based on application readiness signals (e.g., no pending async requests) reduces flakiness and unnecessary delays. Hard-coded waits (A) are brittle and slow; polling waits (C) can be better than fixed sleeps but are still generally inferior to event/readiness-based synchronization already in place. The improvement opportunity described is that the same initialization steps are repeated in every test as explicit test steps, which increases test script length, duplication, and maintenance effort. TAE recommends centralizing common setup logic using framework setup/teardown mechanisms to enforce consistency and reduce duplication. Since the initialization tasks are needed to set preconditions for each test (so each test starts from a known state and remains independent), they belong in the Test Setup, which runs before each test case. Putting them in Suite Setup (D) would run them only once, risking that later tests inherit polluted state, making tests interdependent and more brittle. Therefore, moving shared per-test initialization tasks into the Test Setup is the best recommendation.
Currently there are no comments in this discussion, be the first to comment!