oppia icon indicating copy to clipboard operation
oppia copied to clipboard

[BUG]: Acceptance and WebDriverIo test Proceeds to ‘it’ Block or another 'it' block/spec Despite Failure in ‘beforeAll’ setup or any other failure in the intial specs.

Open Akhilesh-max opened this issue 10 months ago • 1 comments

Describe the bug

In our current testing framework, the execution of an acceptance test is proceeding to the ‘it’ block even when something fails in the setup of the test, (i.e., in the ‘beforeAll’ block). This results in multiple error messages, of which only the last one is relevant and directly related to the initial setup failure.

Also the spec moves into another specs even if something goes wrong in the initial specs.

URL of the page where the issue is observed.

NA

Steps To Reproduce

Introduce a deliberate error in the setup or any specification of a test, execute it, and observe that the execution advances to another ‘it’ block or specs.

Expected Behavior

The test execution should halt upon encountering a failure in the ‘beforeAll’ setup or any error it comes across first. It should not proceed to the ‘it’ block or another 'it' block. Only the first error failure encountered should be displayed.

Screenshots/Videos

Acceptance tests: Screenshot 2024-04-17 at 10 32 13 PM

WebdriverIo (e2e tests) :

Screenshot 2024-04-17 at 10 51 58 PM

What device are you using?

Desktop

Operating System

MacOS

What browsers are you seeing the problem on?

Chrome

Browser version

No response

Additional context

No response

Tips for developers

Before addressing the bug, please identify which PR caused the issue (you can follow the steps here). If you identify the PR, comment on the issue with a link to it. If not, mention the commit hash of the oldest commit you saw the bug on (and the month and year it was made in).

Then, please leave a comment with details of the approach that you plan to take to fix the issue (see example).

Note: If this is your first Oppia issue, please make sure to follow our guidelines for choosing an issue and setting things up. You will also need to show a demo of the fix working correctly on your local machine. Thanks!

Akhilesh-max avatar Apr 17 '24 17:04 Akhilesh-max

Jasmine already offers a configuration option for this. It can be done by activating the stopOnSpecFailure flag in the jasmine.json file.

Screenshot 2024-04-30 at 11 47 50 PM

Akhilesh-max avatar Apr 30 '24 18:04 Akhilesh-max