selenium_fury 0.5.12 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +2 -7
- data/Gemfile +1 -1
- data/VERSION +1 -1
- data/features/custom_generator.feature +1 -1
- data/features/generate_page_object.feature +1 -1
- data/features/step_definitions/custom_generator_steps.rb +81 -125
- data/features/step_definitions/generate_page_object_steps.rb +3 -3
- data/features/step_definitions/validate_page_object_steps.rb +4 -4
- data/features/support/env.rb +10 -4
- data/features/support/hooks.rb +2 -1
- data/features/validate_page_object.feature +3 -3
- data/lib/selenium_fury.rb +3 -4
- data/lib/selenium_fury/common/selenium_api_chooser.rb +19 -7
- data/lib/selenium_fury/selenium_client/locator_finder.rb +15 -0
- data/lib/selenium_fury/selenium_client/page_generator.rb +1 -0
- data/lib/selenium_fury/selenium_client/page_validator.rb +12 -37
- data/lib/selenium_fury/selenium_web_driver/element_finder.rb +16 -1
- data/lib/selenium_fury/selenium_web_driver/page_object.rb +2 -2
- data/lib/selenium_fury/selenium_web_driver/page_object_components.rb +1 -1
- data/spec/common/selenium_api_chooser_spec.rb +11 -11
- data/spec/selenium_client/custom_generators_spec.rb +23 -7
- data/spec/selenium_client/page_generator_spec.rb +3 -3
- data/spec/selenium_client/page_validator_spec.rb +5 -5
- data/spec/selenium_client/test_page_rc_spec.rb +14 -0
- data/spec/selenium_web_driver/element_finder_spec.rb +1 -1
- data/spec/selenium_web_driver/page_generator_spec.rb +10 -10
- data/spec/selenium_web_driver/page_object_spec.rb +69 -40
- data/spec/selenium_web_driver/page_validator_spec.rb +5 -5
- data/spec/spec_helper.rb +13 -12
- data/spec/test_page/test_page.html +70 -0
- data/spec/test_page/test_page.rb +21 -0
- data/spec/test_page/test_page_custom_generator_configuration.rb +16 -0
- data/spec/test_page/test_page_rc.rb +25 -0
- metadata +194 -181
- data/selenium_fury.gemspec +0 -118
- data/spec/selenium_client/advanced_search.rb +0 -55
- data/spec/selenium_client/advanced_search_custom_generator_configuration.rb +0 -16
- data/spec/selenium_client/advanced_search_spec.rb +0 -15
- data/spec/selenium_web_driver/advanced_search.rb +0 -47
- data/spec/selenium_web_driver/inquiry_side_bar.rb +0 -7
- data/spec/selenium_web_driver/property_page.rb +0 -3
data/selenium_fury.gemspec
DELETED
@@ -1,118 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = "selenium_fury"
|
8
|
-
s.version = "0.5.12"
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Scott Sims", "Tim Tischler"]
|
12
|
-
s.date = "2012-06-27"
|
13
|
-
s.description = "Generate and validate page objects with this page object factory for Selenium."
|
14
|
-
s.email = "ssims98@gmail.com"
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE",
|
17
|
-
"README.md"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".rvmrc",
|
21
|
-
"Changelog.md",
|
22
|
-
"Gemfile",
|
23
|
-
"LICENSE",
|
24
|
-
"README.md",
|
25
|
-
"Rakefile",
|
26
|
-
"VERSION",
|
27
|
-
"features/custom_generator.feature",
|
28
|
-
"features/generate_page_object.feature",
|
29
|
-
"features/step_definitions/custom_generator_steps.rb",
|
30
|
-
"features/step_definitions/generate_page_object_steps.rb",
|
31
|
-
"features/step_definitions/validate_page_object_steps.rb",
|
32
|
-
"features/support/env.rb",
|
33
|
-
"features/support/hooks.rb",
|
34
|
-
"features/validate_page_object.feature",
|
35
|
-
"lib/selenium_fury.rb",
|
36
|
-
"lib/selenium_fury/common/page_parser.rb",
|
37
|
-
"lib/selenium_fury/common/selenium_api_chooser.rb",
|
38
|
-
"lib/selenium_fury/selenium_client/create_selenium_client_driver.rb",
|
39
|
-
"lib/selenium_fury/selenium_client/custom_generator.rb",
|
40
|
-
"lib/selenium_fury/selenium_client/locator_finder.rb",
|
41
|
-
"lib/selenium_fury/selenium_client/page_generator.rb",
|
42
|
-
"lib/selenium_fury/selenium_client/page_validator.rb",
|
43
|
-
"lib/selenium_fury/selenium_web_driver/create_selenium_web_driver.rb",
|
44
|
-
"lib/selenium_fury/selenium_web_driver/element_finder.rb",
|
45
|
-
"lib/selenium_fury/selenium_web_driver/page_generator.rb",
|
46
|
-
"lib/selenium_fury/selenium_web_driver/page_object.rb",
|
47
|
-
"lib/selenium_fury/selenium_web_driver/page_object_components.rb",
|
48
|
-
"lib/selenium_fury/selenium_web_driver/page_validator.rb",
|
49
|
-
"selenium_fury.gemspec",
|
50
|
-
"spec/common/page_parser_spec.rb",
|
51
|
-
"spec/common/selenium_api_chooser_spec.rb",
|
52
|
-
"spec/selenium_client/advanced_search.rb",
|
53
|
-
"spec/selenium_client/advanced_search_custom_generator_configuration.rb",
|
54
|
-
"spec/selenium_client/advanced_search_spec.rb",
|
55
|
-
"spec/selenium_client/custom_generators_spec.rb",
|
56
|
-
"spec/selenium_client/locator_finder_spec.rb",
|
57
|
-
"spec/selenium_client/page_generator_spec.rb",
|
58
|
-
"spec/selenium_client/page_validator_spec.rb",
|
59
|
-
"spec/selenium_web_driver/advanced_search.rb",
|
60
|
-
"spec/selenium_web_driver/element_finder_spec.rb",
|
61
|
-
"spec/selenium_web_driver/inquiry_side_bar.rb",
|
62
|
-
"spec/selenium_web_driver/page_generator_spec.rb",
|
63
|
-
"spec/selenium_web_driver/page_object_spec.rb",
|
64
|
-
"spec/selenium_web_driver/page_validator_spec.rb",
|
65
|
-
"spec/selenium_web_driver/property_page.rb",
|
66
|
-
"spec/spec_helper.rb"
|
67
|
-
]
|
68
|
-
s.homepage = "https://github.com/scottcsims/SeleniumFury"
|
69
|
-
s.require_paths = ["lib"]
|
70
|
-
s.rubygems_version = "1.8.24"
|
71
|
-
s.summary = "Selenium Fury allows an automated tester to quickly build page files to use in the page object pattern. Each page file represents a page under test with attributes of all the locators selenium needs to run tests on the page and methods that represent actions that can be performed on the page. You use the generator to build the page files. After the page has been updated you can use the validator to go through all of the selenium locators you are using in your page file and return a list of the locators that it could not find. If there are missing locators you can then rerun the generator to generate new selenium locators for your page. http://www.scottcsims.com"
|
72
|
-
|
73
|
-
if s.respond_to? :specification_version then
|
74
|
-
s.specification_version = 3
|
75
|
-
|
76
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
77
|
-
s.add_runtime_dependency(%q<selenium-webdriver>, [">= 0"])
|
78
|
-
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
|
79
|
-
s.add_development_dependency(%q<yard>, [">= 0"])
|
80
|
-
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
81
|
-
s.add_development_dependency(%q<rdiscount>, [">= 0"])
|
82
|
-
s.add_development_dependency(%q<rspec>, ["= 2.7.0"])
|
83
|
-
s.add_development_dependency(%q<cucumber>, [">= 0"])
|
84
|
-
s.add_development_dependency(%q<bundler>, [">= 0"])
|
85
|
-
s.add_development_dependency(%q<builder>, [">= 0"])
|
86
|
-
s.add_development_dependency(%q<rake>, [">= 0"])
|
87
|
-
s.add_development_dependency(%q<faker>, [">= 0"])
|
88
|
-
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
|
89
|
-
else
|
90
|
-
s.add_dependency(%q<selenium-webdriver>, [">= 0"])
|
91
|
-
s.add_dependency(%q<nokogiri>, [">= 0"])
|
92
|
-
s.add_dependency(%q<yard>, [">= 0"])
|
93
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
94
|
-
s.add_dependency(%q<rdiscount>, [">= 0"])
|
95
|
-
s.add_dependency(%q<rspec>, ["= 2.7.0"])
|
96
|
-
s.add_dependency(%q<cucumber>, [">= 0"])
|
97
|
-
s.add_dependency(%q<bundler>, [">= 0"])
|
98
|
-
s.add_dependency(%q<builder>, [">= 0"])
|
99
|
-
s.add_dependency(%q<rake>, [">= 0"])
|
100
|
-
s.add_dependency(%q<faker>, [">= 0"])
|
101
|
-
s.add_dependency(%q<nokogiri>, [">= 0"])
|
102
|
-
end
|
103
|
-
else
|
104
|
-
s.add_dependency(%q<selenium-webdriver>, [">= 0"])
|
105
|
-
s.add_dependency(%q<nokogiri>, [">= 0"])
|
106
|
-
s.add_dependency(%q<yard>, [">= 0"])
|
107
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
108
|
-
s.add_dependency(%q<rdiscount>, [">= 0"])
|
109
|
-
s.add_dependency(%q<rspec>, ["= 2.7.0"])
|
110
|
-
s.add_dependency(%q<cucumber>, [">= 0"])
|
111
|
-
s.add_dependency(%q<bundler>, [">= 0"])
|
112
|
-
s.add_dependency(%q<builder>, [">= 0"])
|
113
|
-
s.add_dependency(%q<rake>, [">= 0"])
|
114
|
-
s.add_dependency(%q<faker>, [">= 0"])
|
115
|
-
s.add_dependency(%q<nokogiri>, [">= 0"])
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
@@ -1,55 +0,0 @@
|
|
1
|
-
class AdvancedSearch
|
2
|
-
def initialize *browser
|
3
|
-
@browser = *browser
|
4
|
-
@adv_search_form = "adv-search-form"
|
5
|
-
@bathrooms = "bathrooms"
|
6
|
-
@bedrooms = "bedrooms"
|
7
|
-
@end_date_input = "endDateInput"
|
8
|
-
@price_from = "priceFrom"
|
9
|
-
@price_to = "priceTo"
|
10
|
-
@property_type = "propertyType"
|
11
|
-
@sleeps = "sleeps"
|
12
|
-
@special_offers = "specialOffers"
|
13
|
-
@start_date_input = "startDateInput"
|
14
|
-
@themes = "themes"
|
15
|
-
@search_key_words='searchKeywords'
|
16
|
-
|
17
|
-
@air_conditioning = "amenity0.0"
|
18
|
-
@beach = "location0.0"
|
19
|
-
@children_welcome = "suitability0.0"
|
20
|
-
@dishwasher = "amenity2.0"
|
21
|
-
@downtown = "location2.2"
|
22
|
-
@fishing = "leisure2.0"
|
23
|
-
@golf = "leisure0.0"
|
24
|
-
@internet_access = "amenity1.1"
|
25
|
-
@lake = "location0.1"
|
26
|
-
@long_term_renters_welcome = "suitability2.1"
|
27
|
-
@mountain = "location0.3"
|
28
|
-
@near_the_ocean = "location1.0"
|
29
|
-
@non_smoking_only = "suitability2.0"
|
30
|
-
@pet_friendly = "suitability1.1"
|
31
|
-
@pool = "amenity1.0"
|
32
|
-
@resort = "location1.1"
|
33
|
-
@river = "location2.1"
|
34
|
-
@rural = "location1.2"
|
35
|
-
@satellite_or_cable_tv = "amenity0.1"
|
36
|
-
@skiing = "leisure1.0"
|
37
|
-
@suitable_for_elderly_or_infirm = "suitability1.0"
|
38
|
-
@town = "location1.3"
|
39
|
-
@village = "location2.0"
|
40
|
-
@washing_machine = "amenity2.1"
|
41
|
-
@waterfront = "location0.2"
|
42
|
-
@wheelchair_accessible = "suitability0.1"
|
43
|
-
|
44
|
-
end
|
45
|
-
|
46
|
-
attr_reader :browser, :adv_search_form, :bathrooms, :bedrooms, :end_date_input, :start_date_input, :price_from, :price_to,
|
47
|
-
:property_type, :sleeps, :special_offers, :start_date_input, :themes,
|
48
|
-
:air_conditioning, :beach, :children_welcome, :dishwasher,
|
49
|
-
:downtown, :fishing, :golf, :internet_access, :lake,
|
50
|
-
:long_term_renters_welcome, :mountain, :near_the_ocean, :non_smoking_only, :pet_friendly,
|
51
|
-
:pool, :resort, :river, :rural, :satellite_or_cable_tv,
|
52
|
-
:skiing, :suitable_for_elderly_or_infirm, :town, :village, :washing_machine,
|
53
|
-
:waterfront, :wheelchair_accessible, :search_key_words
|
54
|
-
|
55
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
class AdvancedSearchCustomGeneratorConfiguration
|
2
|
-
def initialize(options={})
|
3
|
-
@selector ="form#adv-search-form div.cb-box"
|
4
|
-
@nokogiri_element=options[:nokogiri_element]
|
5
|
-
end
|
6
|
-
|
7
|
-
attr_accessor :selector, :nokogiri_element
|
8
|
-
|
9
|
-
def name
|
10
|
-
return nokogiri_element.at_css("input[name=refinements]+label").text
|
11
|
-
end
|
12
|
-
|
13
|
-
def value
|
14
|
-
return nokogiri_element.at_css("input").get_attribute("id")
|
15
|
-
end
|
16
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
describe AdvancedSearch do
|
3
|
-
it "should find a vacation rental in Destin with a pool and air conditioning " do
|
4
|
-
create_selenium_driver("http://www.homeaway.com")
|
5
|
-
browser.start_new_browser_session
|
6
|
-
puts "Testing #{browser.browser_url} on #{browser.browser_string} "
|
7
|
-
browser.open "/searchForm"
|
8
|
-
advanced_search = AdvancedSearch.new(browser)
|
9
|
-
browser.click advanced_search.air_conditioning
|
10
|
-
browser.click advanced_search.pool
|
11
|
-
browser.submit advanced_search.adv_search_form
|
12
|
-
browser.wait_for_page_to_load "30000"
|
13
|
-
browser.text("css=div#search-headline")
|
14
|
-
end
|
15
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
class AdvancedSearchWebDriver < PageObject
|
2
|
-
element :adv_search_form, {:id => "adv-search-form"}
|
3
|
-
element :amenity0_0, {:id => "amenity0.0"}
|
4
|
-
element :amenity0_1, {:id => "amenity0.1"}
|
5
|
-
element :amenity1_0, {:id => "amenity1.0"}
|
6
|
-
element :amenity1_1, {:id => "amenity1.1"}
|
7
|
-
element :amenity2_0, {:id => "amenity2.0"}
|
8
|
-
element :amenity2_1, {:id => "amenity2.1"}
|
9
|
-
element :bathrooms, {:id => "bathrooms"}
|
10
|
-
element :bedrooms, {:id => "bedrooms"}
|
11
|
-
element :end_date_input, {:id => "endDateInput"}
|
12
|
-
element :leisure0_0, {:id => "leisure0.0"}
|
13
|
-
element :leisure1_0, {:id => "leisure1.0"}
|
14
|
-
element :leisure2_0, {:id => "leisure2.0"}
|
15
|
-
element :location0_0, {:id => "location0.0"}
|
16
|
-
element :location0_1, {:id => "location0.1"}
|
17
|
-
element :location0_2, {:id => "location0.2"}
|
18
|
-
element :location0_3, {:id => "location0.3"}
|
19
|
-
element :location1_0, {:id => "location1.0"}
|
20
|
-
element :location1_1, {:id => "location1.1"}
|
21
|
-
element :location1_2, {:id => "location1.2"}
|
22
|
-
element :location1_3, {:id => "location1.3"}
|
23
|
-
element :location2_0, {:id => "location2.0"}
|
24
|
-
element :location2_1, {:id => "location2.1"}
|
25
|
-
element :location2_2, {:id => "location2.2"}
|
26
|
-
element :price_from, {:id => "priceFrom"}
|
27
|
-
element :price_to, {:id => "priceTo"}
|
28
|
-
element :property_type, {:id => "propertyType"}
|
29
|
-
element :region, {:id => "region"}
|
30
|
-
element :search_keywords, {:id => "searchKeywords"}
|
31
|
-
element :sleeps, {:id => "sleeps"}
|
32
|
-
element :special_offers, {:id => "specialOffers"}
|
33
|
-
element :start_date_input, {:id => "startDateInput"}
|
34
|
-
element :suitability0_0, {:id => "suitability0.0"}
|
35
|
-
element :suitability0_1, {:id => "suitability0.1"}
|
36
|
-
element :suitability1_0, {:id => "suitability1.0"}
|
37
|
-
element :suitability1_1, {:id => "suitability1.1"}
|
38
|
-
element :suitability2_0, {:id => "suitability2.0"}
|
39
|
-
element :suitability2_1, {:id => "suitability2.1"}
|
40
|
-
element :themes, {:id => "themes"}
|
41
|
-
|
42
|
-
def click_one_item
|
43
|
-
amenity0_0.click
|
44
|
-
adv_search_form.submit
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|
@@ -1,7 +0,0 @@
|
|
1
|
-
class InquirySideBar < PageObject
|
2
|
-
element :first_name, {:id=>"sidebar-inquirerFirstName"}
|
3
|
-
element :last_name, {:id=>"sidebar-inquirerLastName"}
|
4
|
-
element :email_address, {:id=>"sidebar-inquirerEmailAddress"}
|
5
|
-
element :phone_number, {:id=>"sidebar-inquirerPhoneNumber"}
|
6
|
-
element :confirmation_message, {:class=>"confirmation-message"}
|
7
|
-
end
|