selenium-framework 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,3 +1,3 @@
1
1
  <h1>Selenium FrameWork</h1>
2
2
 
3
- Selenium framework will help us to generate project automation structure and included default usage methods like random generate email!.
3
+ Selenium framework will help us to generate project automation structure and included default usage methods like random generate email, word, log generation, report and etc!.
@@ -1,13 +1,9 @@
1
- source :rubygems
2
1
  source 'http://rubygems.org'
3
- source :rubyforge
4
- source 'http://gems.rubyforge.org'
5
- source :gemcutter
6
- source 'http://gemcutter.org'
7
2
 
8
3
  gem 'selenium-webdriver', '>= 2.32.1'
9
4
  gem 'mail', '>= 2.5.4'
10
5
  gem 'faker', '>= 1.1.2'
11
6
  gem 'nokogiri', '>= 1.5.9'
12
7
  gem 'selenium-client', '>= 1.2.18'
13
- gem 'headless', '>= 1.0.1'
8
+ gem 'headless', '>= 1.0.1'
9
+ gem 'random-word', '>=1.3.0'
@@ -10,4 +10,5 @@ require 'nokogiri'
10
10
  require 'uri'
11
11
  require 'headless'
12
12
  require 'fileutils'
13
- require 'ostruct'
13
+ require 'ostruct'
14
+ require 'random-word'
@@ -2,7 +2,6 @@ require './include.rb'
2
2
 
3
3
  class Project < Test::Unit::TestCase
4
4
 
5
- @@browser = "firefox"
6
5
  build_path = PreRequisite.create_build_structure(Dir.pwd)
7
6
  $screenshot_directory_path = PreRequisite.create_screenshot_directory_path(Dir.pwd.to_s, build_path)
8
7
  $report_file = PreRequisite.create_report_file(Dir.pwd.to_s, build_path)
@@ -13,9 +12,13 @@ class Project < Test::Unit::TestCase
13
12
  def setup
14
13
  client = Selenium::WebDriver::Remote::Http::Default.new
15
14
  client.timeout = 120 # seconds
16
- #$driver = Selenium::WebDriver.for(:remote, :http_client => client, :url => 'http://<IP ADDRESS>:<PORT NUMBER>/wd/hub', :desired_capabilities => @@browser.to_sym)
17
- $driver = Selenium::WebDriver.for @@browser.to_sym
18
- $base_url = 'http://<WEBSITE URL>'
15
+ if SeleniumConfig.mode == "remote"
16
+ $driver = Selenium::WebDriver.for(:remote, :http_client => client, :url => 'http://'+ SeleniumConfig.host+':4444/wd/hub', :desired_capabilities => SeleniumConfig.local_browser.to_sym)
17
+ else
18
+ $driver = Selenium::WebDriver.for SeleniumConfig.local_browser.to_sym
19
+ end
20
+ $base_url = SeleniumConfig.base_url
21
+ $adminbase_url = SeleniumConfig.adminbase_url
19
22
  $driver.manage.timeouts.implicit_wait = 180
20
23
  @verification_errors = []
21
24
  end
@@ -1,5 +1,7 @@
1
1
  mode: <local or remote>
2
2
  base_url:
3
+ adminbase_url:
3
4
  application_name: <application name>
4
5
  local_browser: <firefox> OR <chrome> OR <safari> OR <ie>
5
- browsers: <firefox>, <chrome>, <safari>, <ie>
6
+ browsers: <firefox>, <chrome>, <safari>, <ie>
7
+ host: <remote ip address>
@@ -2,7 +2,6 @@ require 'selenium-framework'
2
2
  require 'userextension/user_extension.rb'
3
3
  require 'userextension/pre_requisite.rb'
4
4
  require 'userextension/utilities.rb'
5
- require 'modules/login/login.rb'
6
5
  require 'time'
7
6
  require 'fileutils'
8
7
  require 'csv'
@@ -12,5 +11,6 @@ require 'yaml'
12
11
  require 'rubygems'
13
12
  require 'zip/zip'
14
13
  require 'find'
14
+ require 'random-word'
15
15
 
16
16
 
@@ -94,9 +94,9 @@ class UserExtension
94
94
 
95
95
  # Call this function this way "generate_words(number)".
96
96
  # This function will generate words and return it.
97
- def self.generate_words(number)
98
- words = Faker::Lorem.words(number).map { |i| i.to_s }.join(" ")
99
- return words
97
+ def self.generate_word
98
+ word = RandomWord.adjs.next
99
+ return word
100
100
  end
101
101
 
102
102
  # Call this function this way "generate_sentence".
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selenium-framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-14 00:00:00.000000000 Z
12
+ date: 2013-05-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -123,6 +123,22 @@ dependencies:
123
123
  - - ! '>='
124
124
  - !ruby/object:Gem::Version
125
125
  version: 1.0.1
126
+ - !ruby/object:Gem::Dependency
127
+ name: random-word
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: 1.3.0
134
+ type: :runtime
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: 1.3.0
126
142
  description: Selenium Automation FrameWork
127
143
  email: suyogsakegaonka@gmail.com, thiyagarajannv@gmail.com
128
144
  executables:
@@ -134,7 +150,6 @@ extra_rdoc_files:
134
150
  files:
135
151
  - lib/userextension/user_extension.rb
136
152
  - lib/selenium-framework.rb
137
- - lib/modules/login/login.rb
138
153
  - bin/copyfiles/Gemfile
139
154
  - bin/copyfiles/selenium-framework.yml
140
155
  - bin/copyfiles/include.rb
@@ -1,14 +0,0 @@
1
- class Login
2
-
3
- def self.login(user_loc_type, user_locator, username, pass_loc_type, pass_locator, password, submit_loc_type, submit_locator)
4
- $driver.find_element(user_loc_type.to_sym, user_locator).send_keys username
5
- $driver.find_element(pass_loc_type.to_sym, pass_locator).send_keys password
6
- $driver.find_element(submit_loc_type.to_sym, submit_locator).click
7
- end
8
-
9
- def self.forgot_password(user_loc_type, user_locator, username, submit_loc_type, submit_locator)
10
- $driver.find_element(user_loc_type.to_sym, user_locator).send_keys username
11
- $driver.find_element(submit_loc_type.to_sym, submit_locator).click
12
- end
13
-
14
- end