Sha256: 82e08e7cdd7608d1c412fe75eb8586250a001a729a3098df3ad8e9e44b8e2f67

Contents?: true

Size: 1.71 KB

Versions: 11

Compression:

Stored size: 1.71 KB

Contents

Then /^the page should contain the text "([^\"]*)"$/ do |text|
  @page.text.should include text
end

Then /^the page should contain the html "([^\"]*)"$/ do |html|
  @page.html.should include html
end

Then /^the page should have the title "([^\"]*)"$/ do |title|
  @page.title.should include title
end

Then /^I should be able to wait for a block to return true$/ do
  @page.google_search_id
  @page.wait_until(10, "too long to display page") do
    @page.text.include? 'Success'
  end
end

When /^I handle the alert$/ do
  @msg = @page.alert do
    @page.alert_button
  end
end

Then /^I should be able to get the alert's message$/ do
  @msg.should == "I am an alert"
end

When /^I handle the confirm$/ do
  @msg = @page.confirm(true) do
    @page.confirm_button
  end
end

Then /^I should be able to get the confirm message$/ do
  @msg.should == 'set the value'
end

When /^I handle the prompt$/ do
  @msg = @page.prompt("Cheezy") do
    @page.prompt_button
  end
end

Then /^I should be able to get the message and default value$/ do
  @msg[:message].should == "enter your name"
  @msg[:default_value].should == 'John Doe'
end

When /^I open a second window$/ do
  @page.open_window
end

class SecondPage
  include PageObject
end

Then /^I should be able to attach to a page object using title$/ do
  @second_page = SecondPage.new(@browser)
  @second_page.attach_to_window(:title => "Success")
end

Then /^I should be able to attach to a page object using url$/ do
  @second_page = SecondPage.new(@browser)
  @second_page.attach_to_window(:url => "success.html")
end

Then /^I should be able to refresh the page$/ do
  @page.refresh
end

When /^I press the back button$/ do
  @page.back
end

When /^I press the forward button$/ do
  @page.forward
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
page-object-0.5.0 features/step_definitions/page_level_actions_steps.rb
page-object-0.4.4 features/step_definitions/page_level_actions_steps.rb
page-object-0.4.3 features/step_definitions/page_level_actions_steps.rb
page-object-0.4.2 features/step_definitions/page_level_actions_steps.rb
page-object-0.4.1 features/step_definitions/page_level_actions_steps.rb
page-object-0.4.0 features/step_definitions/page_level_actions_steps.rb
page-object-0.3.2 features/step_definitions/page_level_actions_steps.rb
page-object-0.3.1 features/step_definitions/page_level_actions_steps.rb
page-object-0.3.0 features/step_definitions/page_level_actions_steps.rb
page-object-0.2.5 features/step_definitions/page_level_actions_steps.rb
page-object-0.2.4 features/step_definitions/page_level_actions_steps.rb