|
1 | 1 | This proof of concept demonstrates using cucumber to do searches.
|
2 | 2 |
|
3 |
| -Also, you may want to look at "this tutorial":http://watir.com/2011/01/22/simple-cucumber-watir-page-object-pattern-framework/ |
4 |
| -and "this blog series":http://www.cheezyworld.com/2010/12/16/ui-tests-putting-it-all-together/ |
5 |
| - |
6 |
| -Test using Rake |
7 |
| -=============== |
8 |
| - |
9 |
| - $ rake -T |
10 |
| - |
11 |
| - rake default # Run Cucumber features |
12 |
| - rake prod # Run Cucumber features |
| 3 | +Also, you may want to look at [this tutorial](http://watir.com/2011/01/22/simple-cucumber-watir-page-object-pattern-framework/) |
| 4 | +and [this blog series](http://www.cheezyworld.com/2010/12/16/ui-tests-putting-it-all-together/) |
13 | 5 |
|
14 | 6 | Installation
|
15 | 7 | ============
|
16 | 8 |
|
17 | 9 | This code is written in ruby and tested on 1.8.7
|
18 | 10 |
|
19 |
| - $ ruby -v |
20 |
| - ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin10.0] |
| 11 | + $ ruby -v |
| 12 | + ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin10.0] |
21 | 13 |
|
22 | 14 | You will also require the installation of the following GEMS via the commands:
|
23 | 15 |
|
24 |
| - gem install rake |
25 |
| - gem install rspec |
26 |
| - gem install watir-webdriver |
27 |
| - gem install cucumber |
| 16 | + gem install rake |
| 17 | + gem install rspec |
| 18 | + gem install watir-webdriver |
| 19 | + gem install cucumber |
| 20 | + |
| 21 | + $ gem list |
| 22 | + |
| 23 | + *** LOCAL GEMS *** |
| 24 | + |
| 25 | + childprocess (0.3.1, 0.1.9) |
| 26 | + cucumber (1.1.8, 0.3.97, 0.2.3, 0.1.12, 0.1.10) |
| 27 | + multi_json (1.0.4) |
| 28 | + rake (0.8.7, 0.8.3) |
| 29 | + rspec (2.6.0, 1.3.0, 1.2.8, 1.2.2, 1.1.11, 1.1.8, 0.5.15) |
| 30 | + rspec-core (2.6.3) |
| 31 | + rspec-expectations (2.6.0) |
| 32 | + rspec-mocks (2.6.0) |
| 33 | + rspec_generator (0.5.15) |
| 34 | + rubygems-update (1.3.6, 1.3.5, 1.3.1, 1.3.0) |
| 35 | + selenium-webdriver (2.19.0, 0.2.0) |
| 36 | + term-ansicolor (1.0.7, 1.0.4, 1.0.3) |
| 37 | + watir-webdriver (0.5.3) |
28 | 38 |
|
29 |
| - $ gem list |
| 39 | +Test using Rake |
| 40 | +=============== |
30 | 41 |
|
31 |
| - *** LOCAL GEMS *** |
| 42 | + Ensure that you have rake installed and then to see the tests available, from the root directory run rake with the option to show tasks |
32 | 43 |
|
33 |
| - childprocess (0.3.1, 0.1.9) |
34 |
| - cucumber (1.1.8, 0.3.97, 0.2.3, 0.1.12, 0.1.10) |
35 |
| - multi_json (1.0.4) |
36 |
| - rake (0.8.7, 0.8.3) |
37 |
| - rspec (2.6.0, 1.3.0, 1.2.8, 1.2.2, 1.1.11, 1.1.8, 0.5.15) |
38 |
| - rspec-core (2.6.3) |
39 |
| - rspec-expectations (2.6.0) |
40 |
| - rspec-mocks (2.6.0) |
41 |
| - rspec_generator (0.5.15) |
42 |
| - rubygems-update (1.3.6, 1.3.5, 1.3.1, 1.3.0) |
43 |
| - selenium-webdriver (2.19.0, 0.2.0) |
44 |
| - term-ansicolor (1.0.7, 1.0.4, 1.0.3) |
45 |
| - watir-webdriver (0.5.3) |
| 44 | + $ rake -T |
| 45 | + |
| 46 | + rake default # Run Cucumber features |
| 47 | + rake prod # Run Cucumber features |
46 | 48 |
|
47 |
| -Sammple run |
| 49 | +Sample run |
48 | 50 | ===========
|
49 | 51 |
|
50 |
| - $ rake |
51 |
| - (in /Users/todd/Documents/src/AutomationTutorial) |
52 |
| - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I "/Library/Ruby/Gems/1.8/gems/cucumber-1.1.8/lib:lib" "/Library/Ruby/Gems/1.8/gems/cucumber-1.1.8/bin/cucumber" --profile default |
53 |
| - Using the default profile... |
54 |
| - Code: |
55 |
| - * features/support/env.rb |
56 |
| - * config/config_common.rb |
57 |
| - * config/config_dev.rb |
58 |
| - * features/pages/bing_search_page.rb |
59 |
| - * features/pages/google_search_page.rb |
60 |
| - * features/step_definitions/search_steps.rb |
61 |
| - |
62 |
| - Features: |
63 |
| - * features/search.feature |
64 |
| - Parsing feature files took 0m0.047s |
65 |
| - |
66 |
| - Feature: |
67 |
| - Potential Assurity customers need to be able to find company information, services and address details when searching on the internet |
68 |
| - |
| 52 | + $ rake |
| 53 | + |
| 54 | + (in /Users/todd/Documents/src/AutomationTutorial) |
| 55 | + /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I "/Library/Ruby/Gems/1.8/gems/cucumber-1.1.8/lib:lib" "/Library/Ruby/Gems/1.8/gems/cucumber-1.1.8/bin/cucumber" --profile default |
| 56 | + Using the default profile... |
| 57 | + Code: |
| 58 | + * features/support/env.rb |
| 59 | + * config/config_common.rb |
| 60 | + * config/config_dev.rb |
| 61 | + * features/pages/bing_search_page.rb |
| 62 | + * features/pages/google_search_page.rb |
| 63 | + * features/step_definitions/search_steps.rb |
| 64 | + |
| 65 | + Features: |
| 66 | + * features/search.feature |
| 67 | + Parsing feature files took 0m0.047s |
| 68 | + |
| 69 | + Feature: |
| 70 | + Potential Assurity customers need to be able to find company information, services and address details when searching on the internet |
| 71 | + |
69 | 72 | Scenario: # features/search.feature:4
|
70 | 73 | Given I am using google # features/step_definitions/search_steps.rb:1
|
71 | 74 | When I search for 'Assurity' # features/step_definitions/search_steps.rb:5
|
72 | 75 | Then the top result should be 'Assurity - Ensuring Software Health - Welcome' # features/step_definitions/search_steps.rb:10
|
73 |
| - |
| 76 | + |
74 | 77 | Scenario: # features/search.feature:9
|
75 | 78 | Given I am using google # features/step_definitions/search_steps.rb:1
|
76 | 79 | When I search for 'test agile new zealand' # features/step_definitions/search_steps.rb:5
|
77 | 80 | Then the results include the text 'Assurity' # features/step_definitions/search_steps.rb:14
|
78 |
| - You need to find the appropriate method on google_search_page (Cucumber::Pending) |
79 |
| - ./features/step_definitions/search_steps.rb:15:in `/^the results include the text '(.*)'$/' |
80 |
| - features/search.feature:12:in `Then the results include the text 'Assurity'' |
| 81 | + |
| 82 | + 2 scenarios (1 pending, 1 passed) |
| 83 | + 6 steps (1 pending, 5 passed) |
| 84 | + 0m8.368s |
| 85 | + |
81 | 86 |
|
82 |
| - 2 scenarios (1 pending, 1 passed) |
83 |
| - 6 steps (1 pending, 5 passed) |
84 |
| - 0m8.368s |
|
0 commit comments