features/step_definitions/common_steps.rb in cello-0.0.17 vs features/step_definitions/common_steps.rb in cello-0.0.19
- old
+ new
@@ -1,39 +1,17 @@
-Dir[File.dirname(__FILE__) + "/../../pages/*.rb"].each do |file|
- require file
-end
+require "cello"
-Given /^I am on a page that has a element$/ do
- @page = StaticPages::Site::Firefox.new
- @page.context StaticPages::Site::InputPage
- @page.visit
+Given /^I am on a page that has (?:a|an) (?:select|element|checkbox|textfield|textarea)$/ do
+ step "I am in the inputs context"
end
-Given /^I am on a page that has a textfield$/ do
- @page = StaticPages::Site::Firefox.new
- @page.context StaticPages::Site::InputPage
- @page.visit
-end
-
-Given /^I am on a page that has a textarea$/ do
- @page = StaticPages::Site::Firefox.new
- @page.context StaticPages::Site::InputPage
- @page.visit
-end
-
-Given /^I am on a page that has a checkbox$/ do
- @page = StaticPages::Site::Firefox.new
- @page.context StaticPages::Site::InputPage
- @page.visit
-end
-
And /^There is a textfield with the text "(.*?)"$/ do |text|
- @page.text_field_fill_with(text)
+ @browser.text_field_fill_with(text)
end
And /^There is a textarea with the text "(.*?)"$/ do |text|
- @page.textarea_fill_with(text)
+ @browser.textarea_fill_with(text)
end
And /^There is a checkbox checked$/ do
- @page.checkbox_check
+ @browser.checkbox_check
end