Skip to content

Commit

Permalink
Merge pull request #3 from danilomota1988/Test
Browse files Browse the repository at this point in the history
Adcionado scenarios negativos
  • Loading branch information
danilomota1988 authored Feb 6, 2025
2 parents d6f1b27 + 6c05be8 commit 154c5c6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
21 changes: 21 additions & 0 deletions features/selecionar_produtos.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,24 @@ Feature: Selecionar Produto
When preencho os campos de login com usuario standard_user e senha secret_sauce
Then sou direcionado para a pagina Home

Scenario: Login com a senha invalida
Given que acesso o site Sauce Demo
When preencho os campos de login com usuario standard_user e senha laranja
Then exibe a mensagem de erro no login

Scenario Outline: Login com negativo
Given que acesso o site Sauce Demo
When preencho os campos de login com usuario <usuario> e senha <senha>
Then exibe a <mensagem> de erro no login

Examples:
| id | usuario | senha | mensagem |
| 01 | standard_user | laranja | Epic sadface: Username and password do not match any user in this service |
| 02 | standard_user | | Epic sadface: Password is required |
| 03 | | secret_sauce | Epic sadface: Username is required |
| 04 | standard | secret_sauce | Epic sadface: Username and password do not match any user in this service |
| 05 | standard | laranja | Epic sadface: Username and password do not match any user in this service |
| 06 | standard | | Epic sadface: Password is required |
| 07 | | | Epic sadface: Username is required |
| 08 | | laranja | Epic sadface: Username is required |

7 changes: 7 additions & 0 deletions features/steps/selecionar_produtos.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ def step_impl(context):
# teardown / encerramento
context.driver.quit()

@then(u'exibe a mensagem de erro no login')
def step_impl(context):
# Validar mensagem de erro
assert context.driver.find_element(By.CSS_SELECTOR, "h3").text == "Epic sadface: Username and password do not match any user in this service"

# teardown / encerramento
context.driver.quit()

0 comments on commit 154c5c6

Please sign in to comment.