Open corrado4eyes opened 10 months ago
We can also favor utilizing "background" here to create a pre condition for all scenarios.
Ideally in my opinion we should approach the issue on UI level only and avoid having steps like "The user is logged in"
Instead that could be replaced by a background scenario that does:
Background: Given you see the login screen Then fill "user1" on edit text "username" Then fill "123" on edit text "pass" Then press login button
Playing a bit also with @BeforeStep and @AfterStep we could make it so a tester alone can write any test without any developer work plus this way all steps are performed on the UI like a tester would and there is no under the hood state setup.
The purpose of Given steps is to put the system in a known state, by initialising the local db or logging in a test user. Docs