Skip to content

Instantly share code, notes, and snippets.

@doamaral
Last active May 20, 2020 19:31
Show Gist options
  • Save doamaral/ffd7a9cf31e51c56ff67021b30879389 to your computer and use it in GitHub Desktop.
Save doamaral/ffd7a9cf31e51c56ff67021b30879389 to your computer and use it in GitHub Desktop.
Problema ao executar meus testes com o Cucumber. Exemplo para post no Medium
source "https://rubygems.org"
gem 'rspec', '~> 3.9'
gem 'capybara', '~> 3.31'
gem 'selenium-webdriver', '~> 3.142', '>= 3.142.7'
gem 'cucumber', '~> 3.1', '>= 3.1.2'
Feature: Login
Como usuário
desejo acessar o sistema a partir das minhas credenciais
a fim de controlar minhas contas
Scenario: login realizado com sucesso
Given entro com as informacoes de login e senha validos
When solicito acesso ao sistema
Then visualizo a pagina inicial
And mensagem de boas vindas
Given("entro com as informacoes de login e senha validos") do
visit "https://xxxxxx.xxxxxx.xxx/login"
fill_in 'email', with: 'xxxx@xxxxx.com.br'
fill_in 'senha', with: 'xxxxxx'
click_button 'Entrar'
sleep 5
end
When("solicito acesso ao sistema") do
pending # Write code here that turns the phrase above into concrete actions
end
Then("visualizo a pagina inicial") do
pending # Write code here that turns the phrase above into concrete actions
end
Then("mensagem de boas vindas") do
pending # Write code here that turns the phrase above into concrete actions
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment