awetestlib 0.1.9-x86-mingw32 → 0.1.10-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -37,6 +37,12 @@ Additionally, you will need to install DevKit to compile a few dependent gems. Y
37
37
 
38
38
  You can now start your scripts within the IDE. Use the Run Configuration button.
39
39
 
40
+ For additional information on IDE setup, refer to the links below:
41
+
42
+ - [Netbeans IDE setup](https://github.com/3qilabs/awetestlib/blob/develop/netbeans_setup.md)
43
+
44
+ - [Rubymine IDE setup](https://github.com/3qilabs/awetestlib/blob/develop/rubymine_setup.md)
45
+
40
46
  3. If you prefer to run your tests from command line, you can use the following command
41
47
  - `awetestlib <script_file> [parameters]`
42
48
 
@@ -52,4 +58,10 @@ The full list of parameters for the command line currently are:
52
58
  -x, --excel EXCEL_FILE Specify an excel file containing variables to be loaded
53
59
  -v, --version VERSION Specify a browser version
54
60
 
61
+ ### Cucumber Support
62
+
63
+ 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.
64
+
65
+
66
+
55
67
 
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
31
31
  s.add_dependency('selenium-webdriver')
32
32
  s.add_dependency('pry')
33
33
  s.add_dependency('rdoc', '~> 3.11')
34
-
34
+ s.add_dependency('cucumber')
35
35
 
36
36
  s.require_paths = ["lib"]
37
37
  s.files = `git ls-files`.split("\n")
@@ -33,7 +33,7 @@ Gem::Specification.new do |s|
33
33
  s.add_dependency('i18n')
34
34
  s.add_dependency('rb-appscript')
35
35
  s.add_dependency('json', '1.4.6') #for safari support
36
-
36
+ s.add_dependency('cucumber')
37
37
  s.require_paths = ["lib"] #,"ext"]
38
38
  s.files = `git ls-files`.split("\n")
39
39
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
@@ -16,7 +16,8 @@ def awetestlib_cucumber_setup
16
16
  FileUtils.cp_r(@source_dir, @cucumber_dir)
17
17
  msg("Info") do
18
18
  puts "Configuring files and settings"
19
- puts "From the sample_cucumber/features folder, you may now run the following command: cucumber yahoo_mail.feature"
19
+ puts "From the sample_cucumber/features folder, you may now run command below:"
20
+ puts "cucumber yahoo_mail.feature"
20
21
  end
21
22
 
22
23
  end
data/lib/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Awetestlib
2
- VERSION = "0.1.9"
3
- VERSION_DATE = "2012-08-30"
2
+ VERSION = "0.1.10"
3
+ VERSION_DATE = "2012-09-04"
4
4
  end
data/netbeans_setup.md ADDED
@@ -0,0 +1,30 @@
1
+ Netbeans IDE Setup
2
+ =======
3
+ ------------
4
+ <br>
5
+ 1. If you ran the `awetestlib netbeans_setup` command, you should now have a folder called "sample_netbeans" in the directory you ran the command in. Open Netbeans and go to Open Project.
6
+
7
+ ![netbeans1](https://raw.github.com/anthonywoo/awetestlib/develop/images/netbeans1.jpg "netbeans1")
8
+
9
+ <br>
10
+ 2. Select the "sample_netbeans" folder that was created and click "Open Project". Your project is now loaded into Netbeans.
11
+ NOTE: Depending on the version of Netbeans you have, you may need to install the Ruby and Rails plugin.
12
+
13
+ ![netbeans2](https://raw.github.com/anthonywoo/awetestlib/develop/images/netbeans2.jpg "netbeans2")
14
+
15
+ <br>
16
+ 3. You can view the different configurations from the config dropdown. We have provided a sample "Demo" config which runs the demo.rb script. To create your own, go to "Customize..."
17
+
18
+ ![netbeans3](https://raw.github.com/anthonywoo/awetestlib/develop/images/netbeans3.jpg "netbeans3")
19
+
20
+ <br>
21
+ 4. In the configuration window, you can see the arguments for the Demo configuration. To create your own, go to "New". All the arguments (Main Script, Arguments, and Ruby Options) would be the same as the Demo configuration, the only difference would be the path to the script you want to run.
22
+
23
+ ![netbeans5](https://raw.github.com/anthonywoo/awetestlib/develop/images/netbeans5.jpg "netbeans5")
24
+
25
+ <br>
26
+ 5. Once you have the script configurations set, you can select the config you want to run from the dropdown and hit the Play button. The script will now start to run within the IDE.
27
+
28
+ ![netbeans4](https://raw.github.com/anthonywoo/awetestlib/develop/images/netbeans4.jpg "netbeans4")
29
+
30
+ <br>
data/rubymine_setup.md ADDED
@@ -0,0 +1,24 @@
1
+ Rubymine IDE Setup
2
+ =======
3
+ ------------
4
+ <br>
5
+ 1. If you ran the `awetestlib rubymine_setup` command, you should now have a folder called "sample_rubymine" in the directory you ran the command in. Open Rubymine and go to Open Directory...
6
+
7
+ ![rubymine1](https://raw.github.com/anthonywoo/awetestlib/develop/images/rubymine1.jpg "rubymine1")
8
+
9
+ <br>
10
+ 2. You can view the different configurations from the config dropdown. We have provided a sample "Demo" config which runs the demo.rb script. To create new configurations, go to Edit Configurations...
11
+
12
+ ![rubymine2](https://raw.github.com/anthonywoo/awetestlib/develop/images/rubymine2.jpg "rubymine2")
13
+
14
+ <br>
15
+ 3. In the configuration window, you can see the arguments for the Demo configuration. To create a new configuration for a new script, simply copy the Demo configuration and change the path to the script you want to run in the "Script arguments:" section.
16
+
17
+ ![rubymine3](https://raw.github.com/anthonywoo/awetestlib/develop/images/rubymine3.jpg "rubymine3")
18
+
19
+ <br>
20
+ 4. Once you have the script configurations set, you can select the config you want to run from the dropdown and hit the Play button. The script will now start to run within the IDE.
21
+
22
+ ![rubymine4](https://raw.github.com/anthonywoo/awetestlib/develop/images/rubymine4.jpg "rubymine4")
23
+
24
+ <br>
@@ -0,0 +1,76 @@
1
+ When /^I open a new browser$/ do
2
+ if @params
3
+ case @params["browser"]
4
+ when "FF"; @browser = Watir::Browser.new :firefox
5
+ when "IE"; @browser = Watir::Browser.new :ie
6
+ when "C", "GC"; @browser = Watir::Browser.new :chrome
7
+ end
8
+ else
9
+ @browser = Watir::Browser.new
10
+ end
11
+ end
12
+
13
+ Given /^I open a firefox browser$/ do
14
+ @browser = Watir::Browser.new :firefox
15
+ end
16
+
17
+ Given /^I open a chrome browser$/ do
18
+ @browser = Watir::Browser.new :chrome
19
+ end
20
+
21
+ Given /^I open an internet explorer browser$/ do
22
+ @browser = Watir::Browser.new :ie
23
+ end
24
+
25
+ Then /^I navigate to the environment url$/ do
26
+ url = @params['environment']['url']
27
+ @browser.goto url
28
+ end
29
+
30
+ Then /^I go to the url "(.*?)"$/ do |url|
31
+ @browser.goto url
32
+ end
33
+
34
+ Then /^I click "(.*?)"$/ do |element_text|
35
+ sleep 1
36
+ @browser.element(:text, element_text).click
37
+ end
38
+
39
+ Then /^I click the button "(.*?)"$/ do |element_text|
40
+ sleep 1
41
+ @browser.button(:text, element_text).click
42
+ end
43
+
44
+ Then /^I click the element with "(.*?)" "(.*?)"$/ do |arg1, arg2|
45
+ @browser.element(arg1.to_sym, arg2)
46
+ end
47
+
48
+ Then /^I should see "(.*?)"$/ do |text|
49
+ sleep 1
50
+ stm = @browser.text.include? text
51
+ if stm
52
+ true
53
+ else
54
+ fail("Did not find text #{text}")
55
+ end
56
+ end
57
+
58
+ Then /^I should not see "(.*?)"$/ do |text|
59
+ stm = @browser.text.include? text
60
+ if stm
61
+ fail("Found text #{text}")
62
+ else
63
+ true
64
+ end
65
+ end
66
+
67
+ Then /^I fill in "(.*?)" with "(.*?)"$/ do |field, value| #assumes u have label
68
+ associated_label = @browser.label(:text, field).attribute_value("for")
69
+ #associated_label = @browser.element(:xpath, '//label[contains(text(),"#{arg1}")]').attribute_value("for"))
70
+ @browser.text_field(:id, associated_label).set value
71
+ end
72
+
73
+
74
+ When /^I wait (\d+) seconds?$/ do |seconds|
75
+ sleep seconds.to_i
76
+ end
@@ -0,0 +1 @@
1
+ require 'watir-webdriver'
@@ -0,0 +1,11 @@
1
+ Feature:
2
+ I want to test cucumber
3
+
4
+ Scenario:
5
+ When I open a new browser
6
+ Then I go to the url "http://mail.yahoo.com"
7
+ Then I should see "Sign in to Yahoo!"
8
+ When I fill in "Yahoo! ID" with "automationtester88"
9
+ Then I fill in "Password" with "password1"
10
+ Then I click the button "Sign In"
11
+ Then I should see "Invalid ID or password."
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awetestlib
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 9
10
- version: 0.1.9
9
+ - 10
10
+ version: 0.1.10
11
11
  platform: x86-mingw32
12
12
  authors:
13
13
  - Anthony Woo
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-08-30 00:00:00 Z
19
+ date: 2012-09-04 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: watir-webdriver
@@ -259,6 +259,20 @@ dependencies:
259
259
  version: "3.11"
260
260
  type: :runtime
261
261
  version_requirements: *id016
262
+ - !ruby/object:Gem::Dependency
263
+ name: cucumber
264
+ prerelease: false
265
+ requirement: &id017 !ruby/object:Gem::Requirement
266
+ none: false
267
+ requirements:
268
+ - - ">="
269
+ - !ruby/object:Gem::Version
270
+ hash: 3
271
+ segments:
272
+ - 0
273
+ version: "0"
274
+ type: :runtime
275
+ version_requirements: *id017
262
276
  description: Awetest DSL for automated testing of browser-based applications.
263
277
  email: patrick@3qilabs.com
264
278
  executables:
@@ -311,7 +325,12 @@ files:
311
325
  - lib/patches/firewatir.rb
312
326
  - lib/patches/watir.rb
313
327
  - lib/version.rb
328
+ - netbeans_setup.md
314
329
  - rdoc_test.bat
330
+ - rubymine_setup.md
331
+ - setup_samples/sample_cucumber/features/step_definitions/predefined_steps.rb
332
+ - setup_samples/sample_cucumber/features/support/env.rb
333
+ - setup_samples/sample_cucumber/features/yahoo_mail.feature
315
334
  - setup_samples/sample_netbeans/demo.rb
316
335
  - setup_samples/sample_netbeans/nbproject/configs/Demo.properties
317
336
  - setup_samples/sample_netbeans/nbproject/private/config.properties