Best practice for precondition

Vittorio Cortosi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 10, 2024

Hello!

Maybe these are dumb questions but i always struggle with this:

1) If i have 10 tests with the same precondition (login for example), is it better to create a precondition with login steps or recalling a test with the login steps? Or both?

image.png

2) I have to run a test but, before running it, i have to login and setup the environment. In the test, should i insert 2 preconditions? one for login and one for environment setup, or just one precondition named "environment setup" with login steps and setup steps all in one precondition?


Thank you in advice for the answers!

1 answer

0 votes
Manuel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 8, 2024

Hi @Vittorio Cortosi ,

preconditions are not the same thing as tests. They're meant to be preconditions as such: ensure that certain conditions are in place before you can actually start executing the tests.

1) You can have 1 precondition assigned with all those Tests; however, that precondition would be something like "Standard user logged in". the goal of preconditions is not to check something.. it's to ensure.

called tests are meant whenever you have several steps where you actually perform actions and expect certan results.. they are not the same thing as preconditions.

 

b) you may have several preconditions. depending on your use case, you can have just one precondition where you setup an environment with certain test data

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events