Scenario: Testing with prompt popups
Given I am on the frames page
When I popup the prompt and enter "Jared Gatorboy"
SyntaxError: missing ; before statement (Selenium::WebDriver::Error::JavascriptError)
./features/support/pages/frames_page.rb:35:in `block in prompt_value'
./features/support/pages/frames_page.rb:34:in `prompt_value'
./features/step_definitions/web01_steps.rb:35:in `block (2 levels) in <top (required)>'
./features/step_definitions/web01_steps.rb:34:in `/^I popup the prompt and enter "(.*?)"$/'
features/web01.feature:20:in `When I popup the prompt and enter "Jared Gatorboy"'
Then the message from the prompt should read "enter your name"
And the default value from the prompt should be "John Doe"
./features/support/pages/frames_page.rb
def prompt_value(value)
in_frame(:id => 'frame_3') do |frame|
@prompt_response = prompt(value, frame) do
button_element(:id => 'prompt_button', :frame => frame).click
end
end
@prompt_response
end
./features/step_definitions/web01_steps.rb
When(/^I popup the prompt and enter "(.*?)"$/) do |value_to_enter|
on_page(FramesPage) do |page|
@prompt_response = page.prompt_value(value_to_enter)
end
end