awetestlib 0.1.30pre3-x86-mingw32 → 0.1.30-x86-mingw32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore CHANGED
@@ -67,4 +67,4 @@ dump.rdb
67
67
  config/settings.yml
68
68
  PROJECT_NAME
69
69
  *.log
70
- awetest_reports/
70
+ awetest_reports/
data/README.md CHANGED
@@ -1,62 +1,90 @@
1
1
  Awetestlib
2
2
  ==========
3
3
 
4
- Run automated regression and mobile tests
4
+ Automate testing of browser-based applications in Windows or Mac.
5
5
 
6
6
  After completing this guide you will be able to run tests locally from command line or from an IDE.
7
7
 
8
8
  ------------
9
+ ## Prerequisites: Ruby 1.8.7 and RubyInstaller Devkit
9
10
 
10
- ## Prerequisites
11
+ You need to have Ruby 1.8.7 installed using RubyInstaller.
11
12
 
12
- You need to have Ruby 1.8.7 installed. You can download Ruby 1.8.7
13
- [here](http://rubyinstaller.org/downloads/)
13
+ You can download the RubyInstaller for 1.8.7
14
+ [here](http://rubyinstaller.org/downloads/). Choose the most recent 1.8.7.
15
+
16
+ Make sure you tell the installer to put Ruby in the PATH environment variable.
14
17
 
15
18
  You can check your Ruby version using:
16
19
 
17
20
  ruby -v
18
21
 
19
- Additionally, for Windows, you will need to install the RubyInstaller DevKit to compile a few dependent gems. You can download DevKit
22
+ Additionally, for Windows, you will need to install the RubyInstaller DevKit to compile a few dependent gems.
23
+
24
+ Download DevKit
20
25
  [here](http://rubyinstaller.org/downloads/)
21
26
  and the installation directions can be found
22
- [here](https://github.com/oneclick/rubyinstaller/wiki/Development-Kit)
27
+ [here](https://github.com/oneclick/rubyinstaller/wiki/Development-Kit).
23
28
 
24
- ## Install
29
+ Choose the one for Ruby 1.8.7.
25
30
 
26
- In a terminal or command prompt, install the awetestlib gem:
31
+ If you have difficulties with the above in Windows 7 and/or behind a firewall, you may have to set the http_proxy and/or run the installers as administrator. (see below)
27
32
 
28
- gem install awetestlib --no-ri --no-rdoc
33
+ ## Install Awetestlib
29
34
 
30
- Note: This could take up to 5 minutes for first time installs. You may need to use 'sudo' on OSX
35
+ **Start** by opening a command window or terminal
36
+
37
+ ----------
38
+
39
+ ####NOTE: If you are behind a firewall:
40
+
41
+ 1. You will need to set the http_proxy environment variable
42
+ 2. You may have to change the HOMEDRIVE environment variable to C: in Windows
43
+ 3. You may need to run the Windows 7 command window as administrator.
44
+
45
+ In Windows
46
+
47
+ set http_proxy=http://myproxy.mycompany.com:80
48
+ set HOMEDRIVE=C:
49
+
50
+ In OSX
51
+
52
+ export HTTP_PROXY=http://myproxy.mycompany.com:80
53
+
54
+
55
+ ----------
56
+
31
57
 
58
+ **Then**, in a terminal or command prompt, install the awetestlib gem:
32
59
 
33
- ## Setup Regression Module
60
+ gem install awetestlib --no-ri --no-rdoc
61
+
62
+ Note: This could take up to 5 minutes for first time installs. You may need to use 'sudo' on OSX
34
63
 
35
- Run the following command and verify the step
64
+ **Then** run the following command and verify the step
36
65
 
37
66
  awetestlib regression_setup
38
67
 
39
- ## Usage
68
+ ### Usage
40
69
 
41
70
  Run the following command to see the different usages
42
71
 
43
72
  awetestlib
44
73
 
45
74
  ## Setup Browsers
46
-
47
- ### Setup Safari (Mac OS X only)
48
-
75
+ ### Safari (Mac OS X only)
49
76
  To setup support for Safari browser, please follow the instructions at [SafariDriver](http://code.google.com/p/selenium/wiki/SafariDriver)
50
77
 
51
- It is important to start a selenium-server-standalone process in a terminal session before running Safari scripts.
78
+ It is likely you will need to start a selenium-server-standalone process in a terminal session before running Safari scripts, else you will get a 'waiting for connection' error. Get the jar [here](https://code.google.com/p/selenium/downloads/list).
79
+
52
80
  When using raw Watir-webdriver for Safari, open the browser with
53
81
 
54
82
  browser = Watir::Browser.new(:remote, :desired_capabilities=>:'safari')
55
83
 
56
- ### Setup Chrome
84
+ ### Chrome
57
85
  To setup support for Google Chrome browser, please download the latest Chromedriver version from [here](http://code.google.com/p/chromedriver/downloads/list)
58
86
 
59
- Then move the executables in your PATH. To find your PATHs, type the command below in your terminal/command prompt
87
+ Then move the executables in your PATH. To find your PATH, type the command below in your terminal/command prompt:
60
88
 
61
89
  For Mac OSX:
62
90
 
@@ -65,13 +93,15 @@ For Mac OSX:
65
93
  For Windows:
66
94
 
67
95
  PATH
68
-
69
- ### Setup Internet Explorer
70
- To setup support for Internet Explorer, please download the latest IEDriver version from [here](http://code.google.com/p/selenium/downloads/list)
96
+
97
+ We suggest putting both drivers in \Ruby187\bin as it should already be in your path.
98
+
99
+ ### Internet Explorer
100
+ To setup support for Internet Explorer, please download the latest IEDriverServer version from [here](http://code.google.com/p/selenium/downloads/list)
71
101
  and move the executable into your PATH.
72
102
 
73
103
 
74
- ### Setup IDEs (Rubymine, Netbeans)
104
+ ## Setup IDEs (Rubymine, Netbeans)
75
105
 
76
106
  To setup the awetestlib gem with Rubymine use:
77
107
 
@@ -81,7 +111,7 @@ To setup awetestlib with Netbeans use:
81
111
 
82
112
  awetestlib netbeans_setup <ProjectName>
83
113
 
84
- You can now start your scripts within the IDE. Use the Run Configuration button.
114
+ You can now start your scripts within the IDE. Follow the instructions in each IDE for creating and executing run/debug configurations.
85
115
 
86
116
  For additional information on IDE setup, refer to the links below:
87
117
 
@@ -89,17 +119,20 @@ For additional information on IDE setup, refer to the links below:
89
119
 
90
120
  - [Rubymine IDE setup](https://github.com/3qilabs/awetestlib/blob/develop/rubymine_setup.md)
91
121
 
92
- 3. If you prefer to run your tests from command line, you can use the following command
93
- - `awetestlib <script_file> [parameters]`
122
+ ## Command Line Execution
123
+ If you prefer to run your tests from command line, you can use the following command
124
+
125
+ `awetestlib <script_file> [parameters]`
126
+
127
+ For example: To run a script named demo.rb in Firefox, your command will look like:
94
128
 
95
- For example: To run a script named demo.rb in Firefox, your command will look like.
96
- - `awetestlib demo.rb -b FF`
129
+ `awetestlib demo.rb -b FF`
97
130
 
98
- The full list of parameters for the command line currently are:
131
+ Here is the full list of the currently available command line parameters:
99
132
 
100
- Usage: awetestlib <script_file> [parameters] [options]
133
+ Usage: awetestlib <script_file> [parameters]
101
134
  -b, --browser BROWSER Specify a browser (IE, FF, S, C)
102
- -r, --root_path ROOT_PATH Specify the root path
135
+ -r, --root_path ROOT_PATH Specify the root path (default is current path)
103
136
  -l, --library LIBRARY Specify a library to be loaded
104
137
  -x, --excel EXCEL_FILE Specify an excel file containing variables to be loaded
105
138
  -v, --version VERSION Specify a browser version
@@ -110,13 +143,21 @@ The full list of parameters for the command line currently are:
110
143
  -s, --screencap_path PATH Specify the path where screenshots will be saved
111
144
  -o, --output_to_log Write to log file
112
145
  --log_path_subdir SUBDIR Specify log path relative to root_path
146
+ -p, --pry Require Pry for debugging
147
+ -c, --classic_watir Use Classic Watir for IE instead of Watir-webdriver
113
148
  --report_all_test_refs Include list of all error/test case reference ids actually validated
114
149
 
115
- To start writing your own script, refer to the [Scripting Guide/Wiki](https://github.com/3qilabs/awetestlib/wiki/Getting-Started---Scripting) wiki
150
+ To start writing your own script, refer to the [Scripting Guide/Wiki](https://github.com/3qilabs/awetestlib/wiki/Getting-Started---Scripting) wiki.
151
+
152
+ For the latest documentation of the Awetest DSL go to [Rubydoc](http://rubydoc.info/gems/awetestlib) and look in Awetestlib::Regression.
116
153
 
117
154
  ### Cucumber Support
118
155
 
119
- One of the technologies that the Awetest framework supports is [Cucumber](http://cukes.info/). To get setup with cucumber, you can run the following command: `awetestlib cucumber_setup` which will create your typical cucumber folder structure.
156
+ One of the technologies that the Awetest framework supports is [Cucumber](http://cukes.info/). To get setup with cucumber, you can run the following command:
157
+
158
+ `awetestlib cucumber_setup <ProjectName>`
159
+
160
+ That will create the standard cucumber folder structure in the ProjectName directory.
120
161
 
121
162
  Visit our [wiki](https://github.com/3qilabs/awetestlib/wiki/Predefined-Cucumber-Web-Steps) to see the list of predefined steps provided by awetestlib
122
163
 
@@ -147,6 +147,21 @@ module Awetestlib
147
147
 
148
148
  @reportContent2 += row + "\n"
149
149
 
150
+
151
+ #if (result == 'PASSED')
152
+ # @reportContent2 = @reportContent2 + '<tr>C'
153
+ # @reportContent2 = @reportContent2 + '<td class=border_right width=20%><p class=result_ok>' + result + '</p></td>'
154
+ #elsif (result == 'FAILED')
155
+ # @reportContent2 = @reportContent2 + '<tr><td class=border_left width=80%><p class=normal_text>' + step + '</p></td>'
156
+ # @reportContent2 = @reportContent2 + '<td class=border_right width=20%><p class=result_nok>' + result + '</p></td>'
157
+ #elsif level < 1
158
+ # @reportContent2 = @reportContent2 + '<tr><td class=border_left width=80%><p class=normal_text>' + step + '</p></td>'
159
+ # @reportContent2 = @reportContent2 + '<td class=border_right width=20%><p class=result_ok>' + result + '</p></td>'
160
+ #else
161
+ # @reportContent2 = @reportContent2 + '<tr><td class=mark_testlevel_left width=80%><p class=bold_large_text>' + step + '</p></td>'
162
+ # @reportContent2 = @reportContent2 + '<td class=mark_testlevel_right width=20%><p class=result_ok>' + result + '</p></td>'
163
+ #end
164
+
150
165
  end
151
166
 
152
167
  # Close the report HTML
@@ -1,4 +1,4 @@
1
1
  module Awetestlib
2
- VERSION = "0.1.30pre3"
3
- VERSION_DATE = "2013-05-06"
2
+ VERSION = "0.1.30"
3
+ VERSION_DATE = "2013-05-21"
4
4
  end
@@ -5,20 +5,20 @@ rescue
5
5
  end
6
6
 
7
7
  def setup_classic_watir
8
- require 'watir'
9
- require 'win32ole'
10
- $ai = ::WIN32OLE.new('AutoItX3.Control')
11
- $first_index = 1
12
- $timestamp = Time.now.strftime("%Y%m%d%H%M%S")
13
- $watir_script = true
14
- Watir::IE.close_all
15
- Watir::IE.visible = true
16
- end
8
+ require 'watir'
9
+ require 'win32ole'
10
+ $ai = ::WIN32OLE.new('AutoItX3.Control')
11
+ $first_index = 1
12
+ $timestamp = Time.now.strftime("%Y%m%d%H%M%S")
13
+ $watir_script = true
14
+ Watir::IE.close_all
15
+ Watir::IE.visible = true
16
+ end
17
17
 
18
18
  def setup_watir_webdriver
19
19
  require 'watir-webdriver'
20
- $first_index = 0
21
- $timestamp = Time.now.strftime("%Y%m%d%H%M%S")
20
+ $first_index = 0
21
+ $timestamp = Time.now.strftime("%Y%m%d%H%M%S")
22
22
  $watir_script = false
23
23
  end
24
24
 
@@ -27,6 +27,11 @@ def open_firefox
27
27
  @browser = Watir::Browser.new :firefox
28
28
  end
29
29
 
30
+ def open_safari
31
+ setup_watir_webdriver
32
+ @browser = Watir::Browser.new(:remote, :desired_capabilities => :'safari')
33
+ end
34
+
30
35
  def open_chrome
31
36
  setup_watir_webdriver
32
37
  @browser = Watir::Browser.new :chrome
@@ -47,7 +52,7 @@ end
47
52
 
48
53
  def navigate_to_environment_url
49
54
  if @params and @params['environment'] and @params['environment']['url']
50
- url = @params['environment']['url']
55
+ url = @params['environment']['url']
51
56
  elsif @login and @login['url']
52
57
  url = @login['url']
53
58
  elsif @role and @login[@role] and @login[@role]['url']
@@ -56,6 +61,28 @@ def navigate_to_environment_url
56
61
  @browser.goto url
57
62
  end
58
63
 
64
+ def open_a_browser
65
+ if @params
66
+ puts "@params: #{@params}"
67
+ case @params["browser"]
68
+ when "FF"
69
+ open_firefox
70
+ when "IE"
71
+ open_internet_explorer
72
+ when "C", "GC"
73
+ open_chrome
74
+ when "S"
75
+ open_safari
76
+ end
77
+ else
78
+ if $watir_script
79
+ open_internet_explorer
80
+ else
81
+ open_firefox
82
+ end
83
+ end
84
+ end
85
+
59
86
  Given /^I run with Watir$/ do
60
87
  if @params and not @params["browser"] == "IE"
61
88
  puts "@params['browser']=>#{@params['browser']} not compatible with classic Watir. Loading Watir-Webdriver."
@@ -72,24 +99,12 @@ Given /^I run with Watir-webdriver$/i do
72
99
  setup_watir_webdriver
73
100
  end
74
101
 
102
+ When /^I open a browser$/i do
103
+ open_a_browser
104
+ end
105
+
75
106
  When /^I open a new browser$/i do
76
- if @params
77
- puts "@params: #{@params}"
78
- case @params["browser"]
79
- when "FF"
80
- open_firefox
81
- when "IE"
82
- open_internet_explorer
83
- when "C", "GC"
84
- open_chrome
85
- end
86
- else
87
- if $watir_script
88
- open_internet_explorer
89
- else
90
- open_firefox
91
- end
92
- end
107
+ open_a_browser
93
108
  end
94
109
 
95
110
  Given /^I open a F?f?irefox B?b?rowser$/i do
@@ -245,9 +260,9 @@ When /^I wait until "?(.*?)"? with "?(.*?)"? "(.*?)" is ready$/ do |element, how
245
260
  #what = Regexp.new(Regexp.escape(what)) unless how =~ /index|text/i or what.is_a?(Regexp)
246
261
  ok = false
247
262
  if $watir_script
248
- if Watir::Wait.until {@browser.element(how, what).exists?}
249
- if Watir::Wait.until {@browser.element(how, what).visible?}
250
- if Watir::Wait.until {@browser.element(how, what).enabled?}
263
+ if Watir::Wait.until { @browser.element(how, what).exists? }
264
+ if Watir::Wait.until { @browser.element(how, what).visible? }
265
+ if Watir::Wait.until { @browser.element(how, what).enabled? }
251
266
  ok = true
252
267
  end
253
268
  end
@@ -261,8 +276,8 @@ When /^I wait until "?(.*?)"? with "?(.*?)"? "(.*?)" is ready$/ do |element, how
261
276
  when 'text field'
262
277
  sleep 2
263
278
  #if @browser.text_field(how.to_sym, what).wait_until_present
264
- ok = true
265
- #end
279
+ ok = true
280
+ #end
266
281
  else
267
282
  if @browser.element(how.to_sym, what).wait_until_present
268
283
  ok = true
@@ -298,14 +313,14 @@ end
298
313
 
299
314
  Given /^I load data spreadsheet "(.*?)" for "(.*?)"$/ do |file, feature|
300
315
  require 'roo'
301
- @workbook = Excel.new(file)
302
- @feature_name = feature #File.basename(feature, ".feature")
316
+ @workbook = Excel.new(file)
317
+ @feature_name = feature #File.basename(feature, ".feature")
303
318
  step "I load @login from spreadsheet"
304
319
  step "I load @var from spreadsheet"
305
320
  end
306
321
 
307
322
  Then /^I load @login from spreadsheet$/ do
308
- @login = Hash.new
323
+ @login = Hash.new
309
324
  @workbook.default_sheet = @workbook.sheets[0]
310
325
 
311
326
  script_col = 0
@@ -354,10 +369,10 @@ Then /^I load @login from spreadsheet$/ do
354
369
  end
355
370
 
356
371
  Then /^I load @var from spreadsheet$/ do
357
- @var = Hash.new
372
+ @var = Hash.new
358
373
  @workbook.default_sheet = @workbook.sheets[1]
359
- script_col = 0
360
- name_col = 0
374
+ script_col = 0
375
+ name_col = 0
361
376
 
362
377
  1.upto(@workbook.last_column) do |col|
363
378
  header = @workbook.cell(1, col)
metadata CHANGED
@@ -1,15 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awetestlib
3
3
  version: !ruby/object:Gem::Version
4
- hash: -223651761
5
- prerelease: 6
4
+ hash: 39
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
9
  - 30
10
- - pre
11
- - 3
12
- version: 0.1.30pre3
10
+ version: 0.1.30
13
11
  platform: x86-mingw32
14
12
  authors:
15
13
  - Anthony Woo
@@ -18,7 +16,7 @@ autorequire:
18
16
  bindir: bin
19
17
  cert_chain: []
20
18
 
21
- date: 2013-05-06 00:00:00 Z
19
+ date: 2013-05-21 00:00:00 Z
22
20
  dependencies:
23
21
  - !ruby/object:Gem::Dependency
24
22
  name: watir-webdriver
@@ -448,14 +446,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
448
446
  required_rubygems_version: !ruby/object:Gem::Requirement
449
447
  none: false
450
448
  requirements:
451
- - - ">"
449
+ - - ">="
452
450
  - !ruby/object:Gem::Version
453
- hash: 25
451
+ hash: 3
454
452
  segments:
455
- - 1
456
- - 3
457
- - 1
458
- version: 1.3.1
453
+ - 0
454
+ version: "0"
459
455
  requirements: []
460
456
 
461
457
  rubyforge_project:
@@ -465,4 +461,3 @@ specification_version: 3
465
461
  summary: Awetest DSL for automated testing of browser-based applications.
466
462
  test_files: []
467
463
 
468
- has_rdoc: