Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `password' for FigNewton:Module (NoMethodError) #4

Open
snowe2010 opened this issue Sep 8, 2014 · 0 comments
Open

Comments

@snowe2010
Copy link

I get an undefined method error if I use a null or empty value in an environment file:

      undefined method `password' for FigNewton:Module (NoMethodError)
      ./lib/pages/login_page.rb:10:in `login_to_system'
      ./features/step_definitions/login_steps.rb:14:in `/^I logged into the portal$/'
      .\features\begin_test_setup.feature:4:in `Given I logged into the portal'
class LoginPage
  include PageObject

  page_url FigNewton.base_url + '//login.html'

  text_field(:username, :name => 'j_username')
  text_field(:password, :name => 'j_password')
  button(:login, :id => 'button')

  def login_to_system(username = FigNewton.username, password = FigNewton.password)
    self.username = username
    self.password = (password.nil? ? Settings.environment_password : password)

    login

    worklist = WorklistPage.new(@browser)
    worklist.wait_to_load
  end
end
base_url: http://awebsite.com:8080/

username: regular
password: ~

I'd like to be able to use null values if possible, using '' just doesn't work as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant