Skip to content

Instantly share code, notes, and snippets.

@ivancorrales
Last active February 17, 2021 07:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivancorrales/8db2800f6d25485d415345aa34788dfa to your computer and use it in GitHub Desktop.
Save ivancorrales/8db2800f6d25485d415345aa34788dfa to your computer and use it in GitHub Desktop.
scenario "happy path" {
given "my user details" {
set user {
value = {
fullName = "John Smith"
username = "john.smith@mail.com"
password = "secret"
}
}
}
when "I sign up" {
call signUp{
# block with can be omitted since variable user is already in the scope
with { user = user }
as = "response"
}
}
then "I am registered successfully" {
assert {
assertion = response.statusCode == 200
}
}
when "do login" {
call signIn {
with {
credentials = {
username = user.username
password = user.password
}
}
as = "response"
}
}
then "I am authenticated successfully" {
assert {
assertion = response.statusCode == 200
}
}
when "I fetch my profile details" {
call showProfile{
with { token = response.body.accessToken }
as = "response"
}
}
then "the returned data are ok" {
assert {
assertion = (
response.statusCode == 200 &&
response.body.fullName == user.fullName
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment