awetestlib 0.1.29pre4-x86-mingw32 → 0.1.29-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +123 -123
- data/bin/awetestlib-android-setup.rb +28 -28
- data/bin/awetestlib-cucumber-setup.rb +30 -30
- data/bin/awetestlib-driver-setup.rb +22 -22
- data/bin/awetestlib-helpers.rb +42 -42
- data/bin/awetestlib-mobile-app-setup.rb +32 -32
- data/bin/awetestlib-netbeans-setup.rb +60 -60
- data/bin/awetestlib-regression-setup.rb +30 -30
- data/bin/awetestlib-rubymine-setup.rb +45 -45
- data/lib/awetestlib/logging.rb +366 -366
- data/lib/awetestlib/regression/browser.rb +1378 -1385
- data/lib/awetestlib/regression/drag_and_drop.rb +3 -4
- data/lib/awetestlib/regression/runner.rb +2 -3
- data/lib/awetestlib/regression/tables.rb +9 -17
- data/lib/awetestlib/regression/user_input.rb +1 -1
- data/lib/awetestlib/regression/utilities.rb +24 -82
- data/lib/awetestlib/regression/validations.rb +1075 -1094
- data/lib/version.rb +2 -2
- data/netbeans_setup.md +6 -6
- data/rubymine_setup.md +5 -5
- data/setup_samples/sample_cucumber/features/step_definitions/predefined_steps.rb +354 -354
- metadata +8 -26
- data/images/netbeans1.jpg +0 -0
- data/images/netbeans2.jpg +0 -0
- data/images/netbeans3.jpg +0 -0
- data/images/netbeans4.jpg +0 -0
- data/images/netbeans5.jpg +0 -0
- data/images/rubymine1.jpg +0 -0
- data/images/rubymine2.jpg +0 -0
- data/images/rubymine3.jpg +0 -0
- data/images/rubymine4.jpg +0 -0
- data/images/scripting1.png +0 -0
- data/images/scripting2.png +0 -0
- data/images/scripting3.png +0 -0
- data/images/scripting4.png +0 -0
- data/test/demo_wwd.rb +0 -7
data/README.md
CHANGED
@@ -1,123 +1,123 @@
|
|
1
|
-
Awetestlib
|
2
|
-
==========
|
3
|
-
|
4
|
-
Run automated regression and mobile tests
|
5
|
-
|
6
|
-
After completing this guide you will be able to run tests locally from command line or from an IDE.
|
7
|
-
|
8
|
-
------------
|
9
|
-
|
10
|
-
## Prerequisites
|
11
|
-
|
12
|
-
You need to have Ruby 1.8.7 installed. You can download Ruby 1.8.7
|
13
|
-
[here](http://rubyinstaller.org/downloads/)
|
14
|
-
|
15
|
-
You can check your Ruby version using:
|
16
|
-
|
17
|
-
ruby -v
|
18
|
-
|
19
|
-
Additionally, for Windows, you will need to install the RubyInstaller DevKit to compile a few dependent gems. You can download DevKit
|
20
|
-
[here](http://rubyinstaller.org/downloads/)
|
21
|
-
and the installation directions can be found
|
22
|
-
[here](https://github.com/oneclick/rubyinstaller/wiki/Development-Kit)
|
23
|
-
|
24
|
-
## Install
|
25
|
-
|
26
|
-
In a terminal or command prompt, install the awetestlib gem:
|
27
|
-
|
28
|
-
gem install awetestlib --no-ri --no-rdoc
|
29
|
-
|
30
|
-
Note: This could take up to 5 minutes for first time installs. You may need to use 'sudo' on OSX
|
31
|
-
|
32
|
-
|
33
|
-
## Setup Regression Module
|
34
|
-
|
35
|
-
Run the following command and verify the step
|
36
|
-
|
37
|
-
awetestlib regression_setup
|
38
|
-
|
39
|
-
## Usage
|
40
|
-
|
41
|
-
Run the following command to see the different usages
|
42
|
-
|
43
|
-
awetestlib
|
44
|
-
|
45
|
-
## Setup Browsers
|
46
|
-
|
47
|
-
### Setup Safari (Mac OS X only)
|
48
|
-
|
49
|
-
To setup support for Safari browser, please follow the instructions at [SafariDriver](http://code.google.com/p/selenium/wiki/SafariDriver)
|
50
|
-
|
51
|
-
It is important to start a selenium-server-standalone process in a terminal session before running Safari scripts.
|
52
|
-
When using raw Watir-webdriver for Safari, open the browser with
|
53
|
-
|
54
|
-
browser = Watir::Browser.new(:remote, :desired_capabilities=>:'safari')
|
55
|
-
|
56
|
-
### Setup Chrome
|
57
|
-
To setup support for Google Chrome browser, please download the latest Chromedriver version from [here](http://code.google.com/p/chromedriver/downloads/list)
|
58
|
-
|
59
|
-
Then move the executables in your PATH. To find your PATHs, type the command below in your terminal/command prompt
|
60
|
-
|
61
|
-
For Mac OSX:
|
62
|
-
|
63
|
-
echo $PATH
|
64
|
-
|
65
|
-
For Windows:
|
66
|
-
|
67
|
-
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)
|
71
|
-
and move the executable into your PATH.
|
72
|
-
|
73
|
-
|
74
|
-
### Setup IDEs (Rubymine, Netbeans)
|
75
|
-
|
76
|
-
To setup the awetestlib gem with Rubymine use:
|
77
|
-
|
78
|
-
awetestlib rubymine_setup <ProjectName>
|
79
|
-
|
80
|
-
To setup awetestlib with Netbeans use:
|
81
|
-
|
82
|
-
awetestlib netbeans_setup <ProjectName>
|
83
|
-
|
84
|
-
You can now start your scripts within the IDE. Use the Run Configuration button.
|
85
|
-
|
86
|
-
For additional information on IDE setup, refer to the links below:
|
87
|
-
|
88
|
-
- [Netbeans IDE setup](https://github.com/3qilabs/awetestlib/blob/develop/netbeans_setup.md)
|
89
|
-
|
90
|
-
- [Rubymine IDE setup](https://github.com/3qilabs/awetestlib/blob/develop/rubymine_setup.md)
|
91
|
-
|
92
|
-
3. If you prefer to run your tests from command line, you can use the following command
|
93
|
-
- `awetestlib <script_file> [parameters]`
|
94
|
-
|
95
|
-
For example: To run a script named demo.rb in Firefox, your command will look like.
|
96
|
-
- `awetestlib demo.rb -b FF`
|
97
|
-
|
98
|
-
The full list of parameters for the command line currently are:
|
99
|
-
|
100
|
-
Usage: awetestlib <script_file> [parameters] [options]
|
101
|
-
-b, --browser BROWSER Specify a browser (IE, FF, S, C)
|
102
|
-
-r, --root_path ROOT_PATH Specify the root path
|
103
|
-
-l, --library LIBRARY Specify a library to be loaded
|
104
|
-
-x, --excel EXCEL_FILE Specify an excel file containing variables to be loaded
|
105
|
-
-v, --version VERSION Specify a browser version
|
106
|
-
-e, --environment_url URL Specify the environment URL
|
107
|
-
-f, --environment_nodename NODE Specify the environment node name
|
108
|
-
-n, --environment_name NAME Specify the environment name
|
109
|
-
-u, --selenium_remote_url URL Specify the device's remote url and port
|
110
|
-
-s, --screencap_path PATH Specify the path where screenshots will be saved
|
111
|
-
-o, --output_to_log Write to log file
|
112
|
-
--log_path_subdir SUBDIR Specify log path relative to root_path
|
113
|
-
--report_all_test_refs Include list of all error/test case reference ids actually validated
|
114
|
-
|
115
|
-
To start writing your own script, refer to the [Scripting Guide/Wiki](https://github.com/3qilabs/awetestlib/wiki/Getting-Started---Scripting) wiki
|
116
|
-
|
117
|
-
### Cucumber Support
|
118
|
-
|
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.
|
120
|
-
|
121
|
-
Visit our [wiki](https://github.com/3qilabs/awetestlib/wiki/Predefined-Cucumber-Web-Steps) to see the list of predefined steps provided by awetestlib
|
122
|
-
|
123
|
-
|
1
|
+
Awetestlib
|
2
|
+
==========
|
3
|
+
|
4
|
+
Run automated regression and mobile tests
|
5
|
+
|
6
|
+
After completing this guide you will be able to run tests locally from command line or from an IDE.
|
7
|
+
|
8
|
+
------------
|
9
|
+
|
10
|
+
## Prerequisites
|
11
|
+
|
12
|
+
You need to have Ruby 1.8.7 installed. You can download Ruby 1.8.7
|
13
|
+
[here](http://rubyinstaller.org/downloads/)
|
14
|
+
|
15
|
+
You can check your Ruby version using:
|
16
|
+
|
17
|
+
ruby -v
|
18
|
+
|
19
|
+
Additionally, for Windows, you will need to install the RubyInstaller DevKit to compile a few dependent gems. You can download DevKit
|
20
|
+
[here](http://rubyinstaller.org/downloads/)
|
21
|
+
and the installation directions can be found
|
22
|
+
[here](https://github.com/oneclick/rubyinstaller/wiki/Development-Kit)
|
23
|
+
|
24
|
+
## Install
|
25
|
+
|
26
|
+
In a terminal or command prompt, install the awetestlib gem:
|
27
|
+
|
28
|
+
gem install awetestlib --no-ri --no-rdoc
|
29
|
+
|
30
|
+
Note: This could take up to 5 minutes for first time installs. You may need to use 'sudo' on OSX
|
31
|
+
|
32
|
+
|
33
|
+
## Setup Regression Module
|
34
|
+
|
35
|
+
Run the following command and verify the step
|
36
|
+
|
37
|
+
awetestlib regression_setup
|
38
|
+
|
39
|
+
## Usage
|
40
|
+
|
41
|
+
Run the following command to see the different usages
|
42
|
+
|
43
|
+
awetestlib
|
44
|
+
|
45
|
+
## Setup Browsers
|
46
|
+
|
47
|
+
### Setup Safari (Mac OS X only)
|
48
|
+
|
49
|
+
To setup support for Safari browser, please follow the instructions at [SafariDriver](http://code.google.com/p/selenium/wiki/SafariDriver)
|
50
|
+
|
51
|
+
It is important to start a selenium-server-standalone process in a terminal session before running Safari scripts.
|
52
|
+
When using raw Watir-webdriver for Safari, open the browser with
|
53
|
+
|
54
|
+
browser = Watir::Browser.new(:remote, :desired_capabilities=>:'safari')
|
55
|
+
|
56
|
+
### Setup Chrome
|
57
|
+
To setup support for Google Chrome browser, please download the latest Chromedriver version from [here](http://code.google.com/p/chromedriver/downloads/list)
|
58
|
+
|
59
|
+
Then move the executables in your PATH. To find your PATHs, type the command below in your terminal/command prompt
|
60
|
+
|
61
|
+
For Mac OSX:
|
62
|
+
|
63
|
+
echo $PATH
|
64
|
+
|
65
|
+
For Windows:
|
66
|
+
|
67
|
+
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)
|
71
|
+
and move the executable into your PATH.
|
72
|
+
|
73
|
+
|
74
|
+
### Setup IDEs (Rubymine, Netbeans)
|
75
|
+
|
76
|
+
To setup the awetestlib gem with Rubymine use:
|
77
|
+
|
78
|
+
awetestlib rubymine_setup <ProjectName>
|
79
|
+
|
80
|
+
To setup awetestlib with Netbeans use:
|
81
|
+
|
82
|
+
awetestlib netbeans_setup <ProjectName>
|
83
|
+
|
84
|
+
You can now start your scripts within the IDE. Use the Run Configuration button.
|
85
|
+
|
86
|
+
For additional information on IDE setup, refer to the links below:
|
87
|
+
|
88
|
+
- [Netbeans IDE setup](https://github.com/3qilabs/awetestlib/blob/develop/netbeans_setup.md)
|
89
|
+
|
90
|
+
- [Rubymine IDE setup](https://github.com/3qilabs/awetestlib/blob/develop/rubymine_setup.md)
|
91
|
+
|
92
|
+
3. If you prefer to run your tests from command line, you can use the following command
|
93
|
+
- `awetestlib <script_file> [parameters]`
|
94
|
+
|
95
|
+
For example: To run a script named demo.rb in Firefox, your command will look like.
|
96
|
+
- `awetestlib demo.rb -b FF`
|
97
|
+
|
98
|
+
The full list of parameters for the command line currently are:
|
99
|
+
|
100
|
+
Usage: awetestlib <script_file> [parameters] [options]
|
101
|
+
-b, --browser BROWSER Specify a browser (IE, FF, S, C)
|
102
|
+
-r, --root_path ROOT_PATH Specify the root path
|
103
|
+
-l, --library LIBRARY Specify a library to be loaded
|
104
|
+
-x, --excel EXCEL_FILE Specify an excel file containing variables to be loaded
|
105
|
+
-v, --version VERSION Specify a browser version
|
106
|
+
-e, --environment_url URL Specify the environment URL
|
107
|
+
-f, --environment_nodename NODE Specify the environment node name
|
108
|
+
-n, --environment_name NAME Specify the environment name
|
109
|
+
-u, --selenium_remote_url URL Specify the device's remote url and port
|
110
|
+
-s, --screencap_path PATH Specify the path where screenshots will be saved
|
111
|
+
-o, --output_to_log Write to log file
|
112
|
+
--log_path_subdir SUBDIR Specify log path relative to root_path
|
113
|
+
--report_all_test_refs Include list of all error/test case reference ids actually validated
|
114
|
+
|
115
|
+
To start writing your own script, refer to the [Scripting Guide/Wiki](https://github.com/3qilabs/awetestlib/wiki/Getting-Started---Scripting) wiki
|
116
|
+
|
117
|
+
### Cucumber Support
|
118
|
+
|
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.
|
120
|
+
|
121
|
+
Visit our [wiki](https://github.com/3qilabs/awetestlib/wiki/Predefined-Cucumber-Web-Steps) to see the list of predefined steps provided by awetestlib
|
122
|
+
|
123
|
+
|
@@ -1,28 +1,28 @@
|
|
1
|
-
def awetestlib_android_setup
|
2
|
-
if ARGV[1].nil?
|
3
|
-
@proj_dir = "sample_android"
|
4
|
-
else
|
5
|
-
@proj_dir = ARGV[1]
|
6
|
-
end
|
7
|
-
|
8
|
-
@cucumber_dir = File.join(FileUtils.pwd, @proj_dir)
|
9
|
-
@source_dir = File.join(File.dirname(__FILE__), '..', 'setup_samples', 'sample_android')
|
10
|
-
|
11
|
-
if File.exists?(@cucumber_dir)
|
12
|
-
puts "Android project directory already exists."
|
13
|
-
exit 1
|
14
|
-
end
|
15
|
-
|
16
|
-
msg("Question") do
|
17
|
-
puts "I'm about to create an android project named #{@proj_dir} in this directory"
|
18
|
-
puts "Please hit return to confirm that's what you want."
|
19
|
-
puts "Enter anything else and hit return to abort."
|
20
|
-
puts "NOTE: You may need to run this command as an administrator."
|
21
|
-
end
|
22
|
-
exit 2 unless STDIN.gets.chomp == ''
|
23
|
-
FileUtils.cp_r(@source_dir, @cucumber_dir)
|
24
|
-
msg("Info") do
|
25
|
-
puts "Configuring files and settings"
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
1
|
+
def awetestlib_android_setup
|
2
|
+
if ARGV[1].nil?
|
3
|
+
@proj_dir = "sample_android"
|
4
|
+
else
|
5
|
+
@proj_dir = ARGV[1]
|
6
|
+
end
|
7
|
+
|
8
|
+
@cucumber_dir = File.join(FileUtils.pwd, @proj_dir)
|
9
|
+
@source_dir = File.join(File.dirname(__FILE__), '..', 'setup_samples', 'sample_android')
|
10
|
+
|
11
|
+
if File.exists?(@cucumber_dir)
|
12
|
+
puts "Android project directory already exists."
|
13
|
+
exit 1
|
14
|
+
end
|
15
|
+
|
16
|
+
msg("Question") do
|
17
|
+
puts "I'm about to create an android project named #{@proj_dir} in this directory"
|
18
|
+
puts "Please hit return to confirm that's what you want."
|
19
|
+
puts "Enter anything else and hit return to abort."
|
20
|
+
puts "NOTE: You may need to run this command as an administrator."
|
21
|
+
end
|
22
|
+
exit 2 unless STDIN.gets.chomp == ''
|
23
|
+
FileUtils.cp_r(@source_dir, @cucumber_dir)
|
24
|
+
msg("Info") do
|
25
|
+
puts "Configuring files and settings"
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -1,30 +1,30 @@
|
|
1
|
-
def awetestlib_cucumber_setup
|
2
|
-
if ARGV[1].nil?
|
3
|
-
@proj_dir = "sample_cucumber"
|
4
|
-
else
|
5
|
-
@proj_dir = ARGV[1]
|
6
|
-
end
|
7
|
-
|
8
|
-
@cucumber_dir = File.join(FileUtils.pwd, @proj_dir)
|
9
|
-
@source_dir = File.join(File.dirname(__FILE__), '..', 'setup_samples', 'sample_cucumber')
|
10
|
-
|
11
|
-
if File.exists?(@cucumber_dir)
|
12
|
-
puts "Cucumber project directory already exists."
|
13
|
-
exit 1
|
14
|
-
end
|
15
|
-
|
16
|
-
msg("Question") do
|
17
|
-
puts "I'm about to create a cucumber project named #{@proj_dir} in this directory"
|
18
|
-
puts "Please hit return to confirm that's what you want."
|
19
|
-
puts "Enter anything else and hit return to abort."
|
20
|
-
puts "NOTE: You may need to run this command as an administrator."
|
21
|
-
end
|
22
|
-
exit 2 unless STDIN.gets.chomp == ''
|
23
|
-
FileUtils.cp_r(@source_dir, @cucumber_dir)
|
24
|
-
msg("Info") do
|
25
|
-
puts "Configuring files and settings"
|
26
|
-
puts "From the sample_cucumber/features folder, you may now run command below:"
|
27
|
-
puts "cucumber yahoo_mail.feature"
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
1
|
+
def awetestlib_cucumber_setup
|
2
|
+
if ARGV[1].nil?
|
3
|
+
@proj_dir = "sample_cucumber"
|
4
|
+
else
|
5
|
+
@proj_dir = ARGV[1]
|
6
|
+
end
|
7
|
+
|
8
|
+
@cucumber_dir = File.join(FileUtils.pwd, @proj_dir)
|
9
|
+
@source_dir = File.join(File.dirname(__FILE__), '..', 'setup_samples', 'sample_cucumber')
|
10
|
+
|
11
|
+
if File.exists?(@cucumber_dir)
|
12
|
+
puts "Cucumber project directory already exists."
|
13
|
+
exit 1
|
14
|
+
end
|
15
|
+
|
16
|
+
msg("Question") do
|
17
|
+
puts "I'm about to create a cucumber project named #{@proj_dir} in this directory"
|
18
|
+
puts "Please hit return to confirm that's what you want."
|
19
|
+
puts "Enter anything else and hit return to abort."
|
20
|
+
puts "NOTE: You may need to run this command as an administrator."
|
21
|
+
end
|
22
|
+
exit 2 unless STDIN.gets.chomp == ''
|
23
|
+
FileUtils.cp_r(@source_dir, @cucumber_dir)
|
24
|
+
msg("Info") do
|
25
|
+
puts "Configuring files and settings"
|
26
|
+
puts "From the sample_cucumber/features folder, you may now run command below:"
|
27
|
+
puts "cucumber yahoo_mail.feature"
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -1,22 +1,22 @@
|
|
1
|
-
require 'pry'
|
2
|
-
def awetestlib_driver_setup
|
3
|
-
current_dir = Dir.pwd
|
4
|
-
drivers_dir = File.expand_path(File.join(File.dirname(__FILE__), "..", "drivers"))
|
5
|
-
# binding.pry
|
6
|
-
ie_driver = File.join(drivers_dir,"IEDriverServer.exe")
|
7
|
-
chrome_driver = File.join(drivers_dir,"chromedriver.exe")
|
8
|
-
msg("Question") do
|
9
|
-
puts "I'm about to put the chromedriver and IEDriverServer in this directory"
|
10
|
-
puts "If it already exists, we will overwrite it"
|
11
|
-
puts "Please hit return to confirm that's what you want."
|
12
|
-
puts "Enter anything else and hit return to abort."
|
13
|
-
puts "NOTE: You may need to run this command as an administrator."
|
14
|
-
end
|
15
|
-
exit 2 unless STDIN.gets.chomp == ''
|
16
|
-
FileUtils.cp(ie_driver, current_dir)
|
17
|
-
FileUtils.cp(chrome_driver,current_dir)
|
18
|
-
msg("Info") do
|
19
|
-
puts "Successfully copied chromedriver and IEDriverServer to #{current_dir}"
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
1
|
+
require 'pry'
|
2
|
+
def awetestlib_driver_setup
|
3
|
+
current_dir = Dir.pwd
|
4
|
+
drivers_dir = File.expand_path(File.join(File.dirname(__FILE__), "..", "drivers"))
|
5
|
+
# binding.pry
|
6
|
+
ie_driver = File.join(drivers_dir,"IEDriverServer.exe")
|
7
|
+
chrome_driver = File.join(drivers_dir,"chromedriver.exe")
|
8
|
+
msg("Question") do
|
9
|
+
puts "I'm about to put the chromedriver and IEDriverServer in this directory"
|
10
|
+
puts "If it already exists, we will overwrite it"
|
11
|
+
puts "Please hit return to confirm that's what you want."
|
12
|
+
puts "Enter anything else and hit return to abort."
|
13
|
+
puts "NOTE: You may need to run this command as an administrator."
|
14
|
+
end
|
15
|
+
exit 2 unless STDIN.gets.chomp == ''
|
16
|
+
FileUtils.cp(ie_driver, current_dir)
|
17
|
+
FileUtils.cp(chrome_driver,current_dir)
|
18
|
+
msg("Info") do
|
19
|
+
puts "Successfully copied chromedriver and IEDriverServer to #{current_dir}"
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
data/bin/awetestlib-helpers.rb
CHANGED
@@ -1,42 +1,42 @@
|
|
1
|
-
def msg(title, &block)
|
2
|
-
puts "\n" + "-"*10 + title + "-"*10
|
3
|
-
block.call
|
4
|
-
puts "-"*10 + "-------" + "-"*10 + "\n"
|
5
|
-
end
|
6
|
-
|
7
|
-
|
8
|
-
def print_usage
|
9
|
-
puts <<EOF
|
10
|
-
Usage Options:
|
11
|
-
|
12
|
-
awetestlib regression_setup
|
13
|
-
setup awetest regression and register autoitx3.dll in Windows
|
14
|
-
|
15
|
-
awetestlib rubymine_setup <project_name>
|
16
|
-
setup a rubymine project
|
17
|
-
|
18
|
-
awetestlib netbeans_setup <project_name>
|
19
|
-
setup a netbeans project
|
20
|
-
|
21
|
-
awetestlib mobile_app_setup <project_name>
|
22
|
-
setup a mobile app project
|
23
|
-
|
24
|
-
awetestlib cucumber_setup <project_name>
|
25
|
-
setup cucumber regression and provide skeleton folder structure
|
26
|
-
|
27
|
-
awetestlib <script_file> [parameters]
|
28
|
-
run an awetest regression script
|
29
|
-
|
30
|
-
EOF
|
31
|
-
end
|
32
|
-
|
33
|
-
def check_script_type(options)
|
34
|
-
script_options = ['Regression', 'Cucumber']
|
35
|
-
if script_options.include? ARGV[0]
|
36
|
-
options[:script_type] = ARGV[0]
|
37
|
-
options[:script_file] = ARGV[1]
|
38
|
-
else
|
39
|
-
options[:script_type] = 'Regression'
|
40
|
-
options[:script_file] = ARGV[0]
|
41
|
-
end
|
42
|
-
end
|
1
|
+
def msg(title, &block)
|
2
|
+
puts "\n" + "-"*10 + title + "-"*10
|
3
|
+
block.call
|
4
|
+
puts "-"*10 + "-------" + "-"*10 + "\n"
|
5
|
+
end
|
6
|
+
|
7
|
+
|
8
|
+
def print_usage
|
9
|
+
puts <<EOF
|
10
|
+
Usage Options:
|
11
|
+
|
12
|
+
awetestlib regression_setup
|
13
|
+
setup awetest regression and register autoitx3.dll in Windows
|
14
|
+
|
15
|
+
awetestlib rubymine_setup <project_name>
|
16
|
+
setup a rubymine project
|
17
|
+
|
18
|
+
awetestlib netbeans_setup <project_name>
|
19
|
+
setup a netbeans project
|
20
|
+
|
21
|
+
awetestlib mobile_app_setup <project_name>
|
22
|
+
setup a mobile app project
|
23
|
+
|
24
|
+
awetestlib cucumber_setup <project_name>
|
25
|
+
setup cucumber regression and provide skeleton folder structure
|
26
|
+
|
27
|
+
awetestlib <script_file> [parameters]
|
28
|
+
run an awetest regression script
|
29
|
+
|
30
|
+
EOF
|
31
|
+
end
|
32
|
+
|
33
|
+
def check_script_type(options)
|
34
|
+
script_options = ['Regression', 'Cucumber']
|
35
|
+
if script_options.include? ARGV[0]
|
36
|
+
options[:script_type] = ARGV[0]
|
37
|
+
options[:script_file] = ARGV[1]
|
38
|
+
else
|
39
|
+
options[:script_type] = 'Regression'
|
40
|
+
options[:script_file] = ARGV[0]
|
41
|
+
end
|
42
|
+
end
|
@@ -1,32 +1,32 @@
|
|
1
|
-
def awetestlib_mobile_app_setup
|
2
|
-
if ARGV[1].nil?
|
3
|
-
@proj_dir = "sample_mobile_app"
|
4
|
-
else
|
5
|
-
@proj_dir = ARGV[1]
|
6
|
-
end
|
7
|
-
|
8
|
-
@cucumber_dir = File.join(FileUtils.pwd, @proj_dir)
|
9
|
-
@source_dir = File.join(File.dirname(__FILE__), '..', 'setup_samples', 'sample_mobile_app')
|
10
|
-
|
11
|
-
if File.exists?(@cucumber_dir)
|
12
|
-
puts "Mobile app project directory already exists."
|
13
|
-
exit 1
|
14
|
-
end
|
15
|
-
|
16
|
-
msg("Question") do
|
17
|
-
puts "I'm about to create a mobile app project named #{ARGV[1]} in this directory" if ARGV[1]
|
18
|
-
puts "I'm about to create a mobile app project named sample_mobile_app in this directory" if ARGV[1].nil?
|
19
|
-
puts "Please hit return to confirm that's what you want."
|
20
|
-
puts "Enter anything else and hit return to abort."
|
21
|
-
puts "NOTE: You may need to run this command as an administrator."
|
22
|
-
end
|
23
|
-
exit 2 unless STDIN.gets.chomp == ''
|
24
|
-
|
25
|
-
FileUtils.cp_r(@source_dir, @cucumber_dir)
|
26
|
-
|
27
|
-
msg("Info") do
|
28
|
-
puts "Configuring files and settings..."
|
29
|
-
puts "A skeleton project has been created with a features and step definitions folder"
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
1
|
+
def awetestlib_mobile_app_setup
|
2
|
+
if ARGV[1].nil?
|
3
|
+
@proj_dir = "sample_mobile_app"
|
4
|
+
else
|
5
|
+
@proj_dir = ARGV[1]
|
6
|
+
end
|
7
|
+
|
8
|
+
@cucumber_dir = File.join(FileUtils.pwd, @proj_dir)
|
9
|
+
@source_dir = File.join(File.dirname(__FILE__), '..', 'setup_samples', 'sample_mobile_app')
|
10
|
+
|
11
|
+
if File.exists?(@cucumber_dir)
|
12
|
+
puts "Mobile app project directory already exists."
|
13
|
+
exit 1
|
14
|
+
end
|
15
|
+
|
16
|
+
msg("Question") do
|
17
|
+
puts "I'm about to create a mobile app project named #{ARGV[1]} in this directory" if ARGV[1]
|
18
|
+
puts "I'm about to create a mobile app project named sample_mobile_app in this directory" if ARGV[1].nil?
|
19
|
+
puts "Please hit return to confirm that's what you want."
|
20
|
+
puts "Enter anything else and hit return to abort."
|
21
|
+
puts "NOTE: You may need to run this command as an administrator."
|
22
|
+
end
|
23
|
+
exit 2 unless STDIN.gets.chomp == ''
|
24
|
+
|
25
|
+
FileUtils.cp_r(@source_dir, @cucumber_dir)
|
26
|
+
|
27
|
+
msg("Info") do
|
28
|
+
puts "Configuring files and settings..."
|
29
|
+
puts "A skeleton project has been created with a features and step definitions folder"
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|