selenium_fury 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +15 -0
- data/Gemfile +14 -7
- data/Gemfile.lock +32 -26
- data/Rakefile +34 -2
- data/features/step_definitions/custom_generator_steps.rb +0 -3
- data/features/step_definitions/generate_page_object_steps.rb +0 -3
- data/features/step_definitions/validate_page_object_steps.rb +0 -3
- data/features/support/env.rb +6 -0
- data/lib/selenium_fury.rb +17 -4
- data/lib/{create_browser_driver.rb → selenium_fury/create_browser_driver.rb} +3 -7
- data/lib/{custom_generator.rb → selenium_fury/custom_generator.rb} +9 -8
- data/lib/{page_generator.rb → selenium_fury/page_generator.rb} +18 -8
- data/lib/{page_validator.rb → selenium_fury/page_validator.rb} +13 -7
- data/selenium_fury.gemspec +80 -18
- data/spec/advanced_search.rb +2 -1
- data/spec/advanced_search_spec.rb +15 -0
- data/spec/custom_generators_spec.rb +1 -1
- data/spec/page_generator_spec.rb +1 -1
- data/spec/page_validator_spec.rb +1 -1
- data/spec/spec_helper.rb +13 -16
- metadata +175 -35
- data/Manifest +0 -26
- data/features/step_definitions/require_helper.rb +0 -16
data/.rvmrc
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
rvm_install_on_use_flag=1
|
2
|
+
rvm_gemset_create_on_use_flag=1
|
3
|
+
rvm_project_rvmrc_default=1
|
4
|
+
rvm ruby-1.8.7-p334@selenium_fury
|
5
|
+
|
6
|
+
# Ensure that Bundler is installed, install it if it is not.
|
7
|
+
if ! command -v bundle ; then
|
8
|
+
printf "The rubygem 'bundler' is not installed, installing it now.\n"
|
9
|
+
gem install bundler
|
10
|
+
fi
|
11
|
+
|
12
|
+
# Bundle while redcing excess noise.
|
13
|
+
printf "Bundling your gems this may take a few minutes on a fresh clone.\n"
|
14
|
+
bundle | grep -v 'Using' | grep -v 'complete' | sed '/^$/d'
|
15
|
+
|
data/Gemfile
CHANGED
@@ -1,12 +1,19 @@
|
|
1
|
-
|
2
|
-
source "http://rubygems.org"
|
1
|
+
source :rubygems
|
3
2
|
|
4
|
-
gem "echoe"
|
5
3
|
gem "bundler"
|
6
4
|
gem "builder"
|
7
5
|
gem "rake"
|
8
|
-
gem "rspec"
|
9
|
-
gem "selenium-client",
|
10
|
-
gem "nokogiri"
|
11
|
-
gem "cucumber"
|
6
|
+
gem "rspec"
|
7
|
+
gem "selenium-client", :require => "selenium/client"
|
8
|
+
gem "nokogiri"
|
9
|
+
gem "cucumber"
|
10
|
+
|
11
|
+
group :development do
|
12
|
+
gem 'yard'
|
13
|
+
gem 'jeweler'
|
14
|
+
gem 'rdiscount'
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
|
12
19
|
|
data/Gemfile.lock
CHANGED
@@ -1,32 +1,36 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
allison (2.0.3)
|
5
4
|
builder (3.0.0)
|
6
|
-
cucumber (0.
|
5
|
+
cucumber (1.0.2)
|
7
6
|
builder (>= 2.1.2)
|
8
7
|
diff-lcs (>= 1.1.2)
|
9
|
-
|
10
|
-
|
11
|
-
term-ansicolor (>= 1.0.
|
12
|
-
treetop (>= 1.4.2)
|
8
|
+
gherkin (~> 2.4.5)
|
9
|
+
json (>= 1.4.6)
|
10
|
+
term-ansicolor (>= 1.0.5)
|
13
11
|
diff-lcs (1.1.2)
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
12
|
+
gherkin (2.4.5)
|
13
|
+
json (>= 1.4.6)
|
14
|
+
git (1.2.5)
|
15
|
+
jeweler (1.6.4)
|
16
|
+
bundler (~> 1.0)
|
17
|
+
git (>= 1.2.5)
|
18
|
+
rake
|
19
|
+
json (1.5.3)
|
20
|
+
nokogiri (1.5.0)
|
21
|
+
rake (0.9.2)
|
22
|
+
rdiscount (1.6.8)
|
23
|
+
rspec (2.6.0)
|
24
|
+
rspec-core (~> 2.6.0)
|
25
|
+
rspec-expectations (~> 2.6.0)
|
26
|
+
rspec-mocks (~> 2.6.0)
|
27
|
+
rspec-core (2.6.4)
|
28
|
+
rspec-expectations (2.6.0)
|
29
|
+
diff-lcs (~> 1.1.2)
|
30
|
+
rspec-mocks (2.6.0)
|
26
31
|
selenium-client (1.2.18)
|
27
|
-
term-ansicolor (1.0.
|
28
|
-
|
29
|
-
polyglot (>= 0.3.1)
|
32
|
+
term-ansicolor (1.0.6)
|
33
|
+
yard (0.7.2)
|
30
34
|
|
31
35
|
PLATFORMS
|
32
36
|
ruby
|
@@ -34,9 +38,11 @@ PLATFORMS
|
|
34
38
|
DEPENDENCIES
|
35
39
|
builder
|
36
40
|
bundler
|
37
|
-
cucumber
|
38
|
-
|
39
|
-
nokogiri
|
41
|
+
cucumber
|
42
|
+
jeweler
|
43
|
+
nokogiri
|
40
44
|
rake
|
41
|
-
|
42
|
-
|
45
|
+
rdiscount
|
46
|
+
rspec
|
47
|
+
selenium-client
|
48
|
+
yard
|
data/Rakefile
CHANGED
@@ -1,2 +1,34 @@
|
|
1
|
-
require '
|
2
|
-
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
require 'jeweler'
|
4
|
+
|
5
|
+
require 'rspec'
|
6
|
+
require 'rspec/core/rake_task'
|
7
|
+
|
8
|
+
require 'yard'
|
9
|
+
require 'yard/rake/yardoc_task'
|
10
|
+
|
11
|
+
RSpec::Core::RakeTask.new(:spec)
|
12
|
+
|
13
|
+
task :default => :spec
|
14
|
+
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
gem.name = "selenium_fury"
|
17
|
+
gem.description = %q{Generate and validate page objects with this page object factory for Selenium.}
|
18
|
+
gem.summary = %q{ Selenium Fury allows an automated tester to quickly build page files to use in the page object pattern. Each page file represents
|
19
|
+
a page under test with attributes of all the locators selenium needs to run tests on the page and methods that represent
|
20
|
+
actions that can be performed on the page.
|
21
|
+
|
22
|
+
You use the generator to build the page files. After the page has been updated you can use the validator to go through
|
23
|
+
all of the selenium locators you are using in your page file and return a list of the locators that it could not find.
|
24
|
+
If there are missing locators you can then rerun the generator to generate new selenium locators for your page. http://www.scottcsims.com}
|
25
|
+
gem.email = "ssims98@gmail.com"
|
26
|
+
gem.authors = ["Scott Sims"]
|
27
|
+
gem.homepage = "https://github.com/scottcsims/SeleniumFury"
|
28
|
+
gem.version = '0.5.3'
|
29
|
+
gem.add_dependency 'nokogiri'
|
30
|
+
end
|
31
|
+
|
32
|
+
YARD::Rake::YardocTask.new do |t|
|
33
|
+
t.files = ['lib/**/*.rb']
|
34
|
+
end
|
@@ -1,6 +1,3 @@
|
|
1
|
-
require File.dirname(__FILE__) + "/require_helper"
|
2
|
-
require File.dirname(__FILE__) + "/../../spec/advanced_search_custom_generator_configuration"
|
3
|
-
|
4
1
|
When /^I have a custom generator configuration class$/ do
|
5
2
|
@advanced_search_custom_generator_configuration = AdvancedSearchCustomGeneratorConfiguration.new()
|
6
3
|
@advanced_search_custom_generator_configuration.should_not be_nil
|
data/lib/selenium_fury.rb
CHANGED
@@ -13,7 +13,20 @@
|
|
13
13
|
# * See the License for the specific language governing permissions and
|
14
14
|
# * limitations under the License.
|
15
15
|
# */
|
16
|
-
|
17
|
-
require
|
18
|
-
require
|
19
|
-
|
16
|
+
|
17
|
+
require 'rubygems'
|
18
|
+
require 'bundler'
|
19
|
+
Bundler.setup
|
20
|
+
require "rspec"
|
21
|
+
require "selenium/client"
|
22
|
+
require 'nokogiri'
|
23
|
+
|
24
|
+
require "selenium_fury/page_generator"
|
25
|
+
require "selenium_fury/custom_generator"
|
26
|
+
require "selenium_fury/page_validator"
|
27
|
+
require "selenium_fury/create_browser_driver"
|
28
|
+
|
29
|
+
include CustomGenerator
|
30
|
+
include PageGenerator
|
31
|
+
include PageValidator
|
32
|
+
include CreateBrowserDriver
|
@@ -1,16 +1,12 @@
|
|
1
|
-
require 'spec'
|
2
1
|
module CreateBrowserDriver
|
3
2
|
|
3
|
+
# @return [Selenium::Client::Driver]
|
4
4
|
def browser
|
5
5
|
return @browser
|
6
6
|
end
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
browser.close_current_browser_session if defined?(browser) && !browser.nil?
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
8
|
+
# @param url [string]
|
9
|
+
# @return [Selenium::Client::Driver]
|
14
10
|
def create_selenium_driver(url)
|
15
11
|
|
16
12
|
@browser = Selenium::Client::Driver.new(
|
@@ -13,14 +13,13 @@
|
|
13
13
|
# * See the License for the specific language governing permissions and
|
14
14
|
# * limitations under the License.
|
15
15
|
# */
|
16
|
-
|
17
|
-
require 'nokogiri'
|
16
|
+
|
18
17
|
module CustomGenerator
|
19
|
-
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
18
|
+
# Use a custom configuration object to define a location strategy for a locators name and value
|
19
|
+
# @param [Hash] options the options to use with a custom generator.
|
20
|
+
# @option opts [CustomConfiguration] :custom_configuration a class that explains how to parse the page
|
21
|
+
# @option opts [String] :browser the selenium driver
|
22
|
+
# @option opts [String] :html html from the page under test
|
24
23
|
def custom_generator(options)
|
25
24
|
custom_configuration = options[:custom_configuration]
|
26
25
|
browser = options[:browser]
|
@@ -44,7 +43,9 @@ module CustomGenerator
|
|
44
43
|
merge_and_print_elements [html_menu_elements]
|
45
44
|
return html_menu_elements
|
46
45
|
end
|
47
|
-
|
46
|
+
# Parse the html attribute to a ruby variable
|
47
|
+
# @return [String]
|
48
|
+
# @param attribute_name [String] the html id,name, or title of an element
|
48
49
|
def clean_attribute_name(attribute_name)
|
49
50
|
attribute_name.gsub!('input-', '')
|
50
51
|
attribute_name.gsub!('select-', '')
|
@@ -15,25 +15,31 @@
|
|
15
15
|
# */
|
16
16
|
module PageGenerator
|
17
17
|
|
18
|
+
# @param html_element [String] a html element that could contain a id, name, or title.
|
18
19
|
def get_name_and_value(html_element)
|
19
20
|
if html_element.get_attribute("id") != nil
|
20
|
-
attribute_name =
|
21
|
+
attribute_name = html_element.get_attribute("id")
|
21
22
|
attribute_value = html_element.get_attribute("id")
|
22
23
|
elsif html_element.get_attribute("name") != nil
|
23
|
-
attribute_name =
|
24
|
+
attribute_name = html_element.get_attribute("name")
|
24
25
|
attribute_value = html_element.get_attribute("name")
|
25
26
|
elsif html_element.get_attribute("title") != nil
|
26
|
-
attribute_name =
|
27
|
+
attribute_name = html_element.get_attribute("title")
|
27
28
|
attribute_value = html_element.get_attribute("title")
|
28
29
|
end
|
29
30
|
return attribute_name, attribute_value
|
30
31
|
end
|
31
32
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
# @param [Hash] opts the opts to use with a custom generator.
|
34
|
+
# @option opts [String] :locator_type css or xpath
|
35
|
+
# @option opts [String] :locator the html id,name, or title to be used as a selenium locator
|
36
|
+
# @option opts [String] :html html from the page under test
|
37
|
+
# @return [Hash] a list of variable names and locator values that can be used in a test
|
38
|
+
def generate_instance_variables_from_html(opts)
|
39
|
+
if opts.kind_of?(Hash)
|
40
|
+
@html = opts[:html]
|
41
|
+
@locator_type = opts[:locator_type]
|
42
|
+
@locator = opts[:locator]
|
37
43
|
end
|
38
44
|
doc = Nokogiri::HTML(@html)
|
39
45
|
html_elements = {}
|
@@ -58,6 +64,8 @@ module PageGenerator
|
|
58
64
|
return html_elements
|
59
65
|
end
|
60
66
|
|
67
|
+
# Print the ruby class using the html elements we found from the page.
|
68
|
+
# @param page_elements_types [Array,Hash] an array of hashes for each type of found html element.
|
61
69
|
def merge_and_print_elements(page_elements_types)
|
62
70
|
html_elements={}
|
63
71
|
page_elements_types.each do |element_type|
|
@@ -95,6 +103,8 @@ module PageGenerator
|
|
95
103
|
return print_elements(html)
|
96
104
|
end
|
97
105
|
|
106
|
+
# @param html [String] html source from your page
|
107
|
+
# @return [Hash,Array] an array of hashes for each type of found html element.
|
98
108
|
def print_elements(html)
|
99
109
|
html_elements_select=generate_instance_variables_from_html(:html =>html, :locator_type => "css", :locator => "select")
|
100
110
|
html_elements_text_area=generate_instance_variables_from_html(:html =>html, :locator_type => "css", :locator => "textarea")
|
@@ -13,33 +13,34 @@
|
|
13
13
|
# * See the License for the specific language governing permissions and
|
14
14
|
# * limitations under the License.
|
15
15
|
# */
|
16
|
-
require 'spec'
|
17
16
|
module PageValidator
|
18
17
|
@found_missing_locators
|
19
18
|
attr_accessor :found_missing_locators
|
20
|
-
|
19
|
+
# @param page_file_class [Class] The page object class you want to test
|
20
|
+
# @param live_url [String] the url of the page your testing
|
21
21
|
def check_page_file_class(page_file_class, *live_url)
|
22
22
|
missing_locators={}
|
23
23
|
puts "Validating the #{page_file_class} class"
|
24
|
-
|
24
|
+
#all initialize methods of page files should have *browser specified as the argument. This is an optional argument
|
25
25
|
test_page = page_file_class.new(@browser)
|
26
26
|
test_page.should_not be_nil
|
27
|
-
|
27
|
+
#skip the open if we don't need to open the url agian
|
28
28
|
if !live_url.empty?
|
29
29
|
$stderr.puts "Opening #{@browser.browser_url}/#{live_url}" if $DEBUG
|
30
30
|
browser.open live_url
|
31
31
|
end
|
32
32
|
|
33
|
-
|
33
|
+
#check for class methods and execute.
|
34
34
|
verify_class_variables(test_page, missing_locators) if test_page.public_methods(all=false).length > 0
|
35
35
|
|
36
|
-
|
36
|
+
#check for instance methods and execute.
|
37
37
|
verify_instance_variables(test_page, missing_locators) if test_page.instance_variables.length > 0
|
38
38
|
@found_missing_locators=missing_locators
|
39
39
|
print_missing_locators(missing_locators)
|
40
40
|
end
|
41
41
|
|
42
42
|
|
43
|
+
# @param missing_locators [Hash] locator name and values
|
43
44
|
def print_missing_locators missing_locators
|
44
45
|
puts "Missing locators are " if missing_locators != {}
|
45
46
|
missing_locators.each_pair do |locator_name, locator_value|
|
@@ -57,6 +58,8 @@ module PageValidator
|
|
57
58
|
return skip_words.include?(locator_name)
|
58
59
|
end
|
59
60
|
|
61
|
+
# @param test_page [Object] an instantiated page object
|
62
|
+
# @param missing_locators [Hash]
|
60
63
|
def verify_instance_variables(test_page, missing_locators)
|
61
64
|
#test_page.print_properties browser
|
62
65
|
test_page.instance_variables.each do |locator_name|
|
@@ -78,6 +81,8 @@ module PageValidator
|
|
78
81
|
end
|
79
82
|
end
|
80
83
|
|
84
|
+
# @param test_page [Object] an instantiated page object
|
85
|
+
# @param missing_locators [Hash]
|
81
86
|
def verify_class_variables(test_page, missing_locators)
|
82
87
|
test_page.public_methods(all=false).each do |locator_name|
|
83
88
|
#Only operate with the set methods not the get methods
|
@@ -93,7 +98,7 @@ module PageValidator
|
|
93
98
|
puts " Validating the #{locator_name} page element locator" #chomp the @ sign off of the method name.
|
94
99
|
locator_value = test_page.method(locator_name) # Create the reference to the get method of the instance variable
|
95
100
|
|
96
|
-
|
101
|
+
#Now validate the page
|
97
102
|
begin
|
98
103
|
browser.wait_for_element(locator_value.call, {:timeout_in_seconds => "5"})
|
99
104
|
rescue
|
@@ -104,4 +109,5 @@ module PageValidator
|
|
104
109
|
end
|
105
110
|
end
|
106
111
|
|
112
|
+
|
107
113
|
end
|
data/selenium_fury.gemspec
CHANGED
@@ -1,34 +1,96 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
1
4
|
# -*- encoding: utf-8 -*-
|
2
5
|
|
3
6
|
Gem::Specification.new do |s|
|
4
7
|
s.name = %q{selenium_fury}
|
5
|
-
s.version = "0.5.
|
6
|
-
|
7
|
-
s.
|
8
|
-
s.
|
8
|
+
s.version = "0.5.3"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = [%q{Scott Sims}]
|
12
|
+
s.date = %q{2011-07-27}
|
9
13
|
s.description = %q{Generate and validate page objects with this page object factory for Selenium.}
|
10
14
|
s.email = %q{ssims98@gmail.com}
|
11
|
-
s.extra_rdoc_files = [
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
s.
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.md"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".rvmrc",
|
21
|
+
"CHANGELOG",
|
22
|
+
"Gemfile",
|
23
|
+
"Gemfile.lock",
|
24
|
+
"LICENSE",
|
25
|
+
"README.md",
|
26
|
+
"Rakefile",
|
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/create_browser_driver.rb",
|
37
|
+
"lib/selenium_fury/custom_generator.rb",
|
38
|
+
"lib/selenium_fury/page_generator.rb",
|
39
|
+
"lib/selenium_fury/page_validator.rb",
|
40
|
+
"selenium_fury.gemspec",
|
41
|
+
"spec/advanced_search.rb",
|
42
|
+
"spec/advanced_search_custom_generator_configuration.rb",
|
43
|
+
"spec/advanced_search_spec.rb",
|
44
|
+
"spec/custom_generators_spec.rb",
|
45
|
+
"spec/page_generator_spec.rb",
|
46
|
+
"spec/page_validator_spec.rb",
|
47
|
+
"spec/spec_helper.rb"
|
48
|
+
]
|
49
|
+
s.homepage = %q{https://github.com/scottcsims/SeleniumFury}
|
50
|
+
s.require_paths = [%q{lib}]
|
51
|
+
s.rubygems_version = %q{1.8.5}
|
52
|
+
s.summary = %q{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}
|
25
53
|
|
26
54
|
if s.respond_to? :specification_version then
|
27
55
|
s.specification_version = 3
|
28
56
|
|
29
57
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
58
|
+
s.add_runtime_dependency(%q<bundler>, [">= 0"])
|
59
|
+
s.add_runtime_dependency(%q<builder>, [">= 0"])
|
60
|
+
s.add_runtime_dependency(%q<rake>, [">= 0"])
|
61
|
+
s.add_runtime_dependency(%q<rspec>, [">= 0"])
|
62
|
+
s.add_runtime_dependency(%q<selenium-client>, [">= 0"])
|
63
|
+
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
|
64
|
+
s.add_runtime_dependency(%q<cucumber>, [">= 0"])
|
65
|
+
s.add_development_dependency(%q<yard>, [">= 0"])
|
66
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
67
|
+
s.add_development_dependency(%q<rdiscount>, [">= 0"])
|
68
|
+
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
|
30
69
|
else
|
70
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
71
|
+
s.add_dependency(%q<builder>, [">= 0"])
|
72
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
73
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
74
|
+
s.add_dependency(%q<selenium-client>, [">= 0"])
|
75
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
76
|
+
s.add_dependency(%q<cucumber>, [">= 0"])
|
77
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
78
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
79
|
+
s.add_dependency(%q<rdiscount>, [">= 0"])
|
80
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
31
81
|
end
|
32
82
|
else
|
83
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
84
|
+
s.add_dependency(%q<builder>, [">= 0"])
|
85
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
86
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
87
|
+
s.add_dependency(%q<selenium-client>, [">= 0"])
|
88
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
89
|
+
s.add_dependency(%q<cucumber>, [">= 0"])
|
90
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
91
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
92
|
+
s.add_dependency(%q<rdiscount>, [">= 0"])
|
93
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
33
94
|
end
|
34
95
|
end
|
96
|
+
|
data/spec/advanced_search.rb
CHANGED
@@ -12,6 +12,7 @@ class AdvancedSearch
|
|
12
12
|
@special_offers = "specialOffers"
|
13
13
|
@start_date_input = "startDateInput"
|
14
14
|
@themes = "themes"
|
15
|
+
@search_key_words='searchKeywords'
|
15
16
|
|
16
17
|
@air_conditioning = "amenity0.0"
|
17
18
|
@beach = "location0.0"
|
@@ -49,6 +50,6 @@ class AdvancedSearch
|
|
49
50
|
:long_term_renters_welcome, :mountain, :near_the_ocean, :non_smoking_only, :pet_friendly,
|
50
51
|
:pool, :resort, :river, :rural, :satellite_or_cable_tv,
|
51
52
|
:skiing, :suitable_for_elderly_or_infirm, :town, :village, :washing_machine,
|
52
|
-
:waterfront, :wheelchair_accessible
|
53
|
+
:waterfront, :wheelchair_accessible, :search_key_words
|
53
54
|
|
54
55
|
end
|
@@ -0,0 +1,15 @@
|
|
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
|
data/spec/page_generator_spec.rb
CHANGED
data/spec/page_validator_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,19 +1,16 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require "spec"
|
4
|
-
gem "selenium-client", ">=1.2.18"
|
5
|
-
require "selenium/client"
|
6
|
-
require 'nokogiri'
|
1
|
+
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
2
|
+
$:.unshift(File.dirname(__FILE__))
|
7
3
|
|
8
|
-
require
|
9
|
-
require
|
10
|
-
|
11
|
-
require
|
12
|
-
require
|
13
|
-
require
|
4
|
+
require 'rubygems'
|
5
|
+
require 'bundler'
|
6
|
+
Bundler.setup
|
7
|
+
require "selenium_fury"
|
8
|
+
require "advanced_search_custom_generator_configuration"
|
9
|
+
require "advanced_search"
|
14
10
|
|
15
|
-
include CustomGenerator
|
16
|
-
include PageGenerator
|
17
|
-
include PageValidator
|
18
|
-
include CreateBrowserDriver
|
19
11
|
|
12
|
+
RSpec.configure do |config|
|
13
|
+
config.after(:each) do
|
14
|
+
browser.close_current_browser_session if defined?(browser) && !browser.nil?
|
15
|
+
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selenium_fury
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 3
|
10
|
+
version: 0.5.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Scott Sims
|
@@ -15,10 +15,162 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
date: 2011-07-27 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
prerelease: false
|
22
|
+
type: :runtime
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
version: "0"
|
32
|
+
name: bundler
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
prerelease: false
|
36
|
+
type: :runtime
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
hash: 3
|
43
|
+
segments:
|
44
|
+
- 0
|
45
|
+
version: "0"
|
46
|
+
name: builder
|
47
|
+
version_requirements: *id002
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
prerelease: false
|
50
|
+
type: :runtime
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
hash: 3
|
57
|
+
segments:
|
58
|
+
- 0
|
59
|
+
version: "0"
|
60
|
+
name: rake
|
61
|
+
version_requirements: *id003
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
prerelease: false
|
64
|
+
type: :runtime
|
65
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
hash: 3
|
71
|
+
segments:
|
72
|
+
- 0
|
73
|
+
version: "0"
|
74
|
+
name: rspec
|
75
|
+
version_requirements: *id004
|
76
|
+
- !ruby/object:Gem::Dependency
|
77
|
+
prerelease: false
|
78
|
+
type: :runtime
|
79
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
80
|
+
none: false
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
hash: 3
|
85
|
+
segments:
|
86
|
+
- 0
|
87
|
+
version: "0"
|
88
|
+
name: selenium-client
|
89
|
+
version_requirements: *id005
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
prerelease: false
|
92
|
+
type: :runtime
|
93
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
hash: 3
|
99
|
+
segments:
|
100
|
+
- 0
|
101
|
+
version: "0"
|
102
|
+
name: nokogiri
|
103
|
+
version_requirements: *id006
|
104
|
+
- !ruby/object:Gem::Dependency
|
105
|
+
prerelease: false
|
106
|
+
type: :runtime
|
107
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
108
|
+
none: false
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
hash: 3
|
113
|
+
segments:
|
114
|
+
- 0
|
115
|
+
version: "0"
|
116
|
+
name: cucumber
|
117
|
+
version_requirements: *id007
|
118
|
+
- !ruby/object:Gem::Dependency
|
119
|
+
prerelease: false
|
120
|
+
type: :development
|
121
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
hash: 3
|
127
|
+
segments:
|
128
|
+
- 0
|
129
|
+
version: "0"
|
130
|
+
name: yard
|
131
|
+
version_requirements: *id008
|
132
|
+
- !ruby/object:Gem::Dependency
|
133
|
+
prerelease: false
|
134
|
+
type: :development
|
135
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
136
|
+
none: false
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
hash: 3
|
141
|
+
segments:
|
142
|
+
- 0
|
143
|
+
version: "0"
|
144
|
+
name: jeweler
|
145
|
+
version_requirements: *id009
|
146
|
+
- !ruby/object:Gem::Dependency
|
147
|
+
prerelease: false
|
148
|
+
type: :development
|
149
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
150
|
+
none: false
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
hash: 3
|
155
|
+
segments:
|
156
|
+
- 0
|
157
|
+
version: "0"
|
158
|
+
name: rdiscount
|
159
|
+
version_requirements: *id010
|
160
|
+
- !ruby/object:Gem::Dependency
|
161
|
+
prerelease: false
|
162
|
+
type: :runtime
|
163
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
164
|
+
none: false
|
165
|
+
requirements:
|
166
|
+
- - ">="
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
hash: 3
|
169
|
+
segments:
|
170
|
+
- 0
|
171
|
+
version: "0"
|
172
|
+
name: nokogiri
|
173
|
+
version_requirements: *id011
|
22
174
|
description: Generate and validate page objects with this page object factory for Selenium.
|
23
175
|
email: ssims98@gmail.com
|
24
176
|
executables: []
|
@@ -26,54 +178,43 @@ executables: []
|
|
26
178
|
extensions: []
|
27
179
|
|
28
180
|
extra_rdoc_files:
|
29
|
-
- CHANGELOG
|
30
181
|
- LICENSE
|
31
182
|
- README.md
|
32
|
-
- lib/create_browser_driver.rb
|
33
|
-
- lib/custom_generator.rb
|
34
|
-
- lib/page_generator.rb
|
35
|
-
- lib/page_validator.rb
|
36
|
-
- lib/selenium_fury.rb
|
37
183
|
files:
|
184
|
+
- .rvmrc
|
38
185
|
- CHANGELOG
|
39
186
|
- Gemfile
|
40
187
|
- Gemfile.lock
|
41
188
|
- LICENSE
|
42
|
-
- Manifest
|
43
189
|
- README.md
|
44
190
|
- Rakefile
|
45
191
|
- features/custom_generator.feature
|
46
192
|
- features/generate_page_object.feature
|
47
193
|
- features/step_definitions/custom_generator_steps.rb
|
48
194
|
- features/step_definitions/generate_page_object_steps.rb
|
49
|
-
- features/step_definitions/require_helper.rb
|
50
195
|
- features/step_definitions/validate_page_object_steps.rb
|
196
|
+
- features/support/env.rb
|
51
197
|
- features/support/hooks.rb
|
52
198
|
- features/validate_page_object.feature
|
53
|
-
- lib/create_browser_driver.rb
|
54
|
-
- lib/custom_generator.rb
|
55
|
-
- lib/page_generator.rb
|
56
|
-
- lib/page_validator.rb
|
57
199
|
- lib/selenium_fury.rb
|
200
|
+
- lib/selenium_fury/create_browser_driver.rb
|
201
|
+
- lib/selenium_fury/custom_generator.rb
|
202
|
+
- lib/selenium_fury/page_generator.rb
|
203
|
+
- lib/selenium_fury/page_validator.rb
|
204
|
+
- selenium_fury.gemspec
|
58
205
|
- spec/advanced_search.rb
|
59
206
|
- spec/advanced_search_custom_generator_configuration.rb
|
207
|
+
- spec/advanced_search_spec.rb
|
60
208
|
- spec/custom_generators_spec.rb
|
61
209
|
- spec/page_generator_spec.rb
|
62
210
|
- spec/page_validator_spec.rb
|
63
211
|
- spec/spec_helper.rb
|
64
|
-
|
65
|
-
has_rdoc: true
|
66
|
-
homepage:
|
212
|
+
homepage: https://github.com/scottcsims/SeleniumFury
|
67
213
|
licenses: []
|
68
214
|
|
69
215
|
post_install_message:
|
70
|
-
rdoc_options:
|
71
|
-
|
72
|
-
- --inline-source
|
73
|
-
- --title
|
74
|
-
- Selenium_fury
|
75
|
-
- --main
|
76
|
-
- README.md
|
216
|
+
rdoc_options: []
|
217
|
+
|
77
218
|
require_paths:
|
78
219
|
- lib
|
79
220
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -90,15 +231,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
231
|
requirements:
|
91
232
|
- - ">="
|
92
233
|
- !ruby/object:Gem::Version
|
93
|
-
hash:
|
234
|
+
hash: 3
|
94
235
|
segments:
|
95
|
-
-
|
96
|
-
|
97
|
-
version: "1.2"
|
236
|
+
- 0
|
237
|
+
version: "0"
|
98
238
|
requirements: []
|
99
239
|
|
100
|
-
rubyforge_project:
|
101
|
-
rubygems_version: 1.
|
240
|
+
rubyforge_project:
|
241
|
+
rubygems_version: 1.8.5
|
102
242
|
signing_key:
|
103
243
|
specification_version: 3
|
104
244
|
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
|
data/Manifest
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
CHANGELOG
|
2
|
-
Gemfile
|
3
|
-
Gemfile.lock
|
4
|
-
LICENSE
|
5
|
-
Manifest
|
6
|
-
README.md
|
7
|
-
Rakefile
|
8
|
-
features/custom_generator.feature
|
9
|
-
features/generate_page_object.feature
|
10
|
-
features/step_definitions/custom_generator_steps.rb
|
11
|
-
features/step_definitions/generate_page_object_steps.rb
|
12
|
-
features/step_definitions/require_helper.rb
|
13
|
-
features/step_definitions/validate_page_object_steps.rb
|
14
|
-
features/support/hooks.rb
|
15
|
-
features/validate_page_object.feature
|
16
|
-
lib/create_browser_driver.rb
|
17
|
-
lib/custom_generator.rb
|
18
|
-
lib/page_generator.rb
|
19
|
-
lib/page_validator.rb
|
20
|
-
lib/selenium_fury.rb
|
21
|
-
spec/advanced_search.rb
|
22
|
-
spec/advanced_search_custom_generator_configuration.rb
|
23
|
-
spec/custom_generators_spec.rb
|
24
|
-
spec/page_generator_spec.rb
|
25
|
-
spec/page_validator_spec.rb
|
26
|
-
spec/spec_helper.rb
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
gem "rspec", "=1.1.12"
|
3
|
-
require "spec"
|
4
|
-
gem "selenium-client", ">=1.2.18"
|
5
|
-
require "selenium/client"
|
6
|
-
require 'nokogiri'
|
7
|
-
|
8
|
-
require File.dirname(__FILE__) + "/../../lib/custom_generator"
|
9
|
-
require File.dirname(__FILE__) + "/../../lib/page_generator"
|
10
|
-
require File.dirname(__FILE__) + "/../../lib/page_validator"
|
11
|
-
require File.dirname(__FILE__) + "/../../lib/create_browser_driver"
|
12
|
-
|
13
|
-
include CustomGenerator
|
14
|
-
include PageGenerator
|
15
|
-
include PageValidator
|
16
|
-
include CreateBrowserDriver
|