selenium_fury 0.5.8 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
data/Changelog.md CHANGED
@@ -1,17 +1,37 @@
1
+ ###v0.5.9
2
+ ####Enhancements
3
+
4
+ * Bug fix for validate() when using web driver
5
+
6
+ [full changelog](https://github.com/scottcsims/SeleniumFury/compare/v0.5.8...v0.5.9)
7
+ ###v0.5.8
8
+ ####Enhancements
9
+
10
+ * New method get_page_object creates a page object instance populated with elements found on the current page
11
+
12
+ [full changelog](https://github.com/scottcsims/SeleniumFury/compare/v0.5.7...v0.5.8)
13
+
14
+ ###v0.5.7
15
+ ####Enhancements
16
+
17
+ * WebDriver support
18
+ * WebDriver PageObject class. Specify your webdriver elements with the element() method.
19
+ * WebDriver generate() and validate()
20
+
21
+ [full changelog](https://github.com/scottcsims/SeleniumFury/compare/v0.5.2...v0.5.7)
22
+
1
23
  ###v0.5.2
2
24
  ####Enhancements
3
25
 
4
26
  * Adding the custom generator and cucumber features to the project.
5
27
  * Tests now execute against HomeAway.
6
28
 
7
- [full changelog](https://github.com/scottcsims/SeleniumFury/compare/v0.5.1...v0.5.2)
8
29
 
9
30
  ###v0.5.1
10
31
  ####Enhancements
11
32
 
12
33
  * Adding ability to name attributes in order of id, name, title.
13
34
 
14
- [full changelog](https://github.com/scottcsims/SeleniumFury/compare/v0.5...v0.5.1)
15
35
 
16
36
  ###v0.5.
17
37
  ####Enhancements
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ group :development do
7
7
  gem 'yard'
8
8
  gem 'jeweler'
9
9
  gem 'rdiscount'
10
- gem "rspec"
10
+ gem "rspec","2.7.0"
11
11
  gem "cucumber"
12
12
  gem "bundler"
13
13
  gem "builder"
data/README.md CHANGED
@@ -1,38 +1,53 @@
1
1
  SeleniumFury
2
2
  =========
3
- Selenium Fury allows an automated tester to quickly build page files to use in the page object pattern. Each page file represents
4
- a page under test with attributes of all the locators selenium needs to run tests on the page and methods that represent
5
- actions that can be performed on the page.
6
-
7
- You use the generator to build the page files. After the page has been updated you can use the validator to go through
8
- all of the selenium locators you are using in your page file and return a list of the locators that it could not find.
9
- If there are missing locators you can then rerun the generator to generate new selenium locators for your page.
3
+ Selenium Fury helps you quickly build page objects when using either Selenium RC API or Selenium Web Driver API.
4
+
5
+ Demo Setup
6
+ =========
7
+ If you are running the demo from the source.
10
8
 
9
+ ```ruby
10
+ bundle console
11
+ require 'spec/spec_helper'
12
+ ```
11
13
 
12
- Generate
13
- =========
14
- * See specs and features for full syntax
15
- * generate(browser)
14
+ If you are running the demo from the installed gem
16
15
 
16
+ ```ruby
17
+ irb
18
+ require 'selenium_fury'
19
+ include SeleniumFury::SeleniumWebDriver::CreateSeleniumWebDriver
20
+ ```
17
21
 
18
- Validate
22
+ Quick Test Demo
19
23
  =========
20
- * See specs and features for full syntax.
21
- * validate(YourPageFileClass, "/optional_relative_url_path")
22
-
23
- Custom Configuration
24
+ ```ruby
25
+ launch_web_driver("http://www.homeaway.com/")
26
+ home_page=get_page_object(driver,'HomePage')
27
+ home_page.search_keywords.send_keys 'Destin'
28
+ home_page.keyword_submit.click
29
+ driver.quit
30
+ ```
31
+
32
+ Generate Demo
24
33
  =========
25
-
26
- * create a custom configuration class
27
- * call custom_generator
28
-
29
- Core Team
34
+ ```ruby
35
+ launch_web_driver("http://www.homeaway.com/")
36
+ generate(driver)
37
+ driver.quit
38
+ ```
39
+ Validate Demo
30
40
  =========
31
-
41
+ ```ruby
42
+ launch_web_driver("http://www.homeaway.com/")
43
+ get_page_object(driver,'HomePage')
44
+ validate(HomePage)
45
+ driver.quit
46
+ ```
32
47
  * [Scott Sims](http://scottcsims.com/): Current maintainer.
33
48
 
34
49
  Copyright
35
50
  =========
36
- * Copyright (c) 2011 HomeAway, Inc.
51
+ * Copyright (c) 2012 HomeAway, Inc.
37
52
  * All rights reserved. http://www.homeaway.com
38
53
  See LICENSE for details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.8
1
+ 0.5.9
data/lib/selenium_fury.rb CHANGED
@@ -13,6 +13,7 @@
13
13
  # * See the License for the specific language governing permissions and
14
14
  # * limitations under the License.
15
15
  # */
16
+ $:.unshift(File.dirname(__FILE__))
16
17
 
17
18
  require 'rubygems'
18
19
  require 'bundler'
@@ -2,10 +2,10 @@ module SeleniumFury
2
2
  module SeleniumApiChooser
3
3
  def generate(selenium_api_object)
4
4
  if selenium_api_object.class == Selenium::Client::Driver
5
- return SeleniumFury::SeleniumClient::PageGenerator.get_source_and_print_elements(selenium_api_object)
5
+ return get_source_and_print_elements(selenium_api_object)
6
6
  end
7
7
  if selenium_api_object.class == Selenium::WebDriver::Driver
8
- return SeleniumFury::SeleniumWebDriver::PageGenerator.web_driver_generate(selenium_api_object)
8
+ return web_driver_generate(selenium_api_object)
9
9
  end
10
10
  end
11
11
 
@@ -14,7 +14,7 @@ module SeleniumFury
14
14
  return check_page_file_class(page_object,*live_url)
15
15
  end
16
16
  unless driver.nil?
17
- return SeleniumFury::SeleniumWebDriver::PageValidator.web_driver_validate(page_object)
17
+ return web_driver_validate(page_object)
18
18
  end
19
19
  end
20
20
 
@@ -17,6 +17,7 @@ module SeleniumFury
17
17
  module SeleniumWebDriver
18
18
  module PageValidator
19
19
  def web_driver_validate(page_class)
20
+ raise("Cannot find driver") if driver.nil?
20
21
  missing_elements=[]
21
22
  puts "class #{page_class}"
22
23
  page_object=page_class.new(driver)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "selenium_fury"
8
- s.version = "0.5.8"
8
+ s.version = "0.5.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Scott Sims", "Tim Tischler"]
12
- s.date = "2012-01-26"
12
+ s.date = "2012-01-31"
13
13
  s.description = "Generate and validate page objects with this page object factory for Selenium."
14
14
  s.email = "ssims98@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -79,7 +79,7 @@ Gem::Specification.new do |s|
79
79
  s.add_development_dependency(%q<yard>, [">= 0"])
80
80
  s.add_development_dependency(%q<jeweler>, [">= 0"])
81
81
  s.add_development_dependency(%q<rdiscount>, [">= 0"])
82
- s.add_development_dependency(%q<rspec>, [">= 0"])
82
+ s.add_development_dependency(%q<rspec>, ["= 2.7.0"])
83
83
  s.add_development_dependency(%q<cucumber>, [">= 0"])
84
84
  s.add_development_dependency(%q<bundler>, [">= 0"])
85
85
  s.add_development_dependency(%q<builder>, [">= 0"])
@@ -92,7 +92,7 @@ Gem::Specification.new do |s|
92
92
  s.add_dependency(%q<yard>, [">= 0"])
93
93
  s.add_dependency(%q<jeweler>, [">= 0"])
94
94
  s.add_dependency(%q<rdiscount>, [">= 0"])
95
- s.add_dependency(%q<rspec>, [">= 0"])
95
+ s.add_dependency(%q<rspec>, ["= 2.7.0"])
96
96
  s.add_dependency(%q<cucumber>, [">= 0"])
97
97
  s.add_dependency(%q<bundler>, [">= 0"])
98
98
  s.add_dependency(%q<builder>, [">= 0"])
@@ -106,7 +106,7 @@ Gem::Specification.new do |s|
106
106
  s.add_dependency(%q<yard>, [">= 0"])
107
107
  s.add_dependency(%q<jeweler>, [">= 0"])
108
108
  s.add_dependency(%q<rdiscount>, [">= 0"])
109
- s.add_dependency(%q<rspec>, [">= 0"])
109
+ s.add_dependency(%q<rspec>, ["= 2.7.0"])
110
110
  s.add_dependency(%q<cucumber>, [">= 0"])
111
111
  s.add_dependency(%q<bundler>, [">= 0"])
112
112
  s.add_dependency(%q<builder>, [">= 0"])
@@ -3,12 +3,12 @@ describe SeleniumFury::SeleniumApiChooser do
3
3
  context "Finding generate/validate methods" do
4
4
  it "should find the generator for selenium client tests" do
5
5
  create_selenium_client_driver "http://www.scottcsims.com"
6
- SeleniumFury::SeleniumClient::PageGenerator.should_receive(:get_source_and_print_elements)
6
+ should_receive(:get_source_and_print_elements)
7
7
  generate(browser)
8
8
  end
9
9
  it "should find the generator for selenium web_driver tests" do
10
10
  launch_web_driver "http://www.scottcsims.com"
11
- SeleniumFury::SeleniumWebDriver::PageGenerator.should_receive(:web_driver_generate)
11
+ should_receive(:web_driver_generate)
12
12
  generate(driver)
13
13
  end
14
14
  it "should find the validator for selenium client tests" do
@@ -18,17 +18,16 @@ describe SeleniumFury::SeleniumApiChooser do
18
18
  end
19
19
  it "should find the validator for selenium web driver tests" do
20
20
  launch_web_driver "http://www.scottcsims.com"
21
- SeleniumFury::SeleniumWebDriver::PageValidator.should_receive(:web_driver_validate).with(NilClass)
21
+ should_receive(:web_driver_validate).with(NilClass)
22
22
  validate(NilClass)
23
23
  end
24
24
  end
25
25
  context "Integrating with generator/validator methods" do
26
26
  it "should find generate elements for selenium client tests" do
27
- create_selenium_client_driver "http://www.scottcsims.com"
27
+ create_selenium_driver "http://www.scottcsims.com"
28
28
  browser.start_new_browser_session
29
29
  browser.open "/"
30
30
  generate(browser).should include("found (8 elements)")
31
-
32
31
  end
33
32
  it "should find validate elements for selenium client tests" do
34
33
  create_selenium_driver("http://www.homeaway.com")
@@ -3,7 +3,7 @@ describe SeleniumFury::SeleniumClient::PageValidator do
3
3
  it "should validate the elements contained on the AdvancedSearch page object" do
4
4
  create_selenium_driver("http://www.homeaway.com")
5
5
  browser.start_new_browser_session
6
- check_page_file_class(AdvancedSearch, "/searchForm")
6
+ validate(AdvancedSearch, "/searchForm")
7
7
  @found_missing_locators.should_not be_nil
8
8
  @found_missing_locators.should have(0).missing_locators
9
9
  end
@@ -19,7 +19,7 @@ describe SeleniumFury::SeleniumClient::PageValidator do
19
19
  end
20
20
  browser.start_new_browser_session
21
21
  begin
22
- check_page_file_class(MissingLocators, browser, "/searchForm")
22
+ validate(MissingLocators, browser, "/searchForm")
23
23
  rescue Exception => e
24
24
  puts e.message.should include("found missing locators")
25
25
  @found_missing_locators["missing"].should =="missing_id"
@@ -6,16 +6,12 @@ describe SeleniumFury::SeleniumWebDriver::PageValidator do
6
6
  element :not_a_element1, {:id=>"not a element1"}
7
7
  end
8
8
  launch_web_driver("http://www.homeaway.com/searchForm")
9
- begin
10
- web_driver_validate(MissingElement)
11
- rescue Exception => e
12
- e.message.should == "Found Missing Elements"
13
- end
9
+ lambda{web_driver_validate(MissingElement)}.should raise_exception(RuntimeError,"Found Missing Elements")
14
10
  end
15
11
 
16
12
  it "should validate elements" do
17
13
  launch_web_driver("http://www.homeaway.com/searchForm")
18
- web_driver_validate(AdvancedSearchWebDriver)
14
+ validate(AdvancedSearchWebDriver)
19
15
  end
20
16
 
21
17
  end
data/spec/spec_helper.rb CHANGED
@@ -12,12 +12,11 @@ require "selenium_client/advanced_search"
12
12
  require "selenium_web_driver/inquiry_side_bar"
13
13
  require "selenium_web_driver/property_page"
14
14
  require "selenium_web_driver/advanced_search"
15
-
15
+ include SeleniumFury::SeleniumWebDriver::CreateSeleniumWebDriver
16
+ include SeleniumFury::SeleniumClient::CreateSeleniumClientDriver
16
17
  RSpec.configure do |config|
17
18
  config.after(:each) do
18
19
  browser.close_current_browser_session unless(browser.nil? || browser.session_id.nil?)
19
20
  driver.quit unless driver.nil?
20
21
  end
21
- config.include SeleniumFury::SeleniumClient::CreateSeleniumClientDriver
22
- config.include SeleniumFury::SeleniumWebDriver::CreateSeleniumWebDriver
23
22
  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: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 8
10
- version: 0.5.8
9
+ - 9
10
+ version: 0.5.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Scott Sims
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-01-26 00:00:00 Z
19
+ date: 2012-01-31 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  version_requirements: &id001 !ruby/object:Gem::Requirement
@@ -92,12 +92,14 @@ dependencies:
92
92
  version_requirements: &id006 !ruby/object:Gem::Requirement
93
93
  none: false
94
94
  requirements:
95
- - - ">="
95
+ - - "="
96
96
  - !ruby/object:Gem::Version
97
- hash: 3
97
+ hash: 19
98
98
  segments:
99
+ - 2
100
+ - 7
99
101
  - 0
100
- version: "0"
102
+ version: 2.7.0
101
103
  requirement: *id006
102
104
  prerelease: false
103
105
  name: rspec