The Vedro framework categorizes steps into three types:
- “given” - arrange steps, preparing data,
- “when” - the main act,
- “then”, “and” and “but” - asserts
Not asserting anything scenario considered to be having a mistake
class Scenario(vedro.Scenario):
subject = "login"
def given_user_data(self):
self.user = fake(NewUserSchema)
def when_user_logins(self):
self.response = httpx.post(f"{API_URL}/auth/login", json=self.user)
class Scenario(vedro.Scenario):
subject = "login"
def given_user_data(self):
self.user = fake(NewUserSchema)
def when_user_logins(self):
self.response = httpx.post(f"{API_URL}/auth/login", json=self.user)
def then_it_should_return_success_status_code(self):
assert self.response.status_code == 200