How to solve the NoUrlForPage problem?

0

I need to implement an automation in cucumber but the application that I need to test is an IP address so I can not get a valid URL, the strange thing is that in the test it can find the url but closes the browser and does not continue the code.

Filename:login_funcionalidade.feature

@logar1Functionality:logarIasSystemAdministratorIwanttologintothesiteTousethesystemingeneral

Scenario:It'svalid

SinceI'monthehomepageofthebank

Whenfillinginthelogininformation

Thenthesystempresentedthehomepageofthesite

==============================================

Filename:login_steps.rb

Dado("que eu esteja na home do site do banco") do                            
    visit 'http://52.206.13.177/index.html'
end                                                                          

Quando("preencher as informacoes de login") do                               
    @login = LoginPage.new
    @login.load
    @login.login("hyper","test")
end                                                                          

Entao("o sistema apresentara a homepage do site") do                         
  assert_text('Bem vindo! Ricardo')
end        

===================================================== ==================

File name: login_page.rb

class LoginPage < SitePrism::Page

    element :username_field, "input[title='Usuário']"
    element :password_field, "input[title='Senha']"
    element :login_botao, "input[value='Entrar']"

    def login (nome, senha)
        username_field.wait_until_login_visible
        username_field.set(nome)
        password_field.wait_until_senha_visible
        password_field.set(senha)
        login_botao.wait_until_login_visible
        login_botao.click
    end
end
    
asked by anonymous 27.09.2018 / 19:54

0 answers