Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gherkin syntax Given #26

Open
corrado4eyes opened this issue Aug 30, 2023 · 1 comment
Open

Gherkin syntax Given #26

corrado4eyes opened this issue Aug 30, 2023 · 1 comment

Comments

@corrado4eyes
Copy link
Collaborator

corrado4eyes commented Aug 30, 2023

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

feature("Some feature") {
    scenario("Some scenario") {
         given("The user is logged in") {
             // initialise logged in user
         }
         given("The user email is ${someValue}") {
             // set user email to be "someValue"
         }
    }
}
@ChristoferAlexander
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants