forked from richdownie/watircuke
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
127 lines (77 loc) · 4.07 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
INSTALL
First be sure to have installed Ruby(1.8.7) and RubyGems
Then install:
gem install geminstaller
Then checkout the WatirCuke git repo (if not yet done ;) ) and type
geminstaller config/geminstaller.yml
This will install all necessary gems.
Then install JSSH for FireWatir:
http://wiki.openqa.org/display/WTR/FireWatir+Installation
TextMate or Redcar editor snippets:
Any of the editors like TextMate or Redcar syntax recognition and snippets for Cucumber
https://github.com/bmabey/cucumber-tmbundle
To have WatirCuke support snippets just unpack the WatirCuke.tmbundle.zip which is in my github in TextMateBundles repo and place it in
TextMate:
~/Library/Application Support/TextMate/Bundles
Then in TextMate -> Bundles -> Bundle Editor -> Reload Bundles
Redcar:
~/.redcar/Bundles/
Snippets should work for .feature files.
Below are currently supported sentences:
Actions:
link[tab] I click the "some" button
checkbox[tab] I click the "some" checkbox
image[tab] I click the "some" image
link[tab] I click/onmouseover the "some" link (with alert)
radio[tab] I click the "some" radio button
table[tab] I click row "some" in the "some" table
list[tab] I select "some" from "from list"
tf[tab] I fill in the text field "text field name" with "some text"
df[tab] I fill in the date field "text field name" with "*fraze" *from http://chronic.rubyforge.org/ are supported
ff[tab] I fill in the file field "file field name" with "file path"
div[tab] I click the "some" div
*screenshot[tab] I take a screenshot
debug[tab] I debug
refresh[tab] I refresh the page
Check results:
check_image[tab] Then I should see the "some image" image
check_span[tab] Then I should see the span "some class" with "some text"
check_sentence[tab] Then I should (NOT )?see the sentence "some sentence"
check_text[tab] Then I should (NOT )?see the text "some text"
check_all[tab] Then I check all objects (this will dump all page objects to file)
Paths redirection:
red[tab] I am redirected to "some"
on[tab] I am on the "server" page
goto[tab] I go to "some url"
sleep[tab] I sleep for "some"
sleepu[tab] sleep until I see the text "text"
tag @new_feature - putted above the scenario will force watircuke to make a screenshot after each action.
Configuration:
Configuration is kept in the config/config.yml file
- You can specify running browser using one of : ie, firefox, chrome, safari
browser: ie
- **Fixtures/Language files separated with " " (files which contains translations without the .yml extension)
fixtures: login logout
- true / false for check for missing translation
check_translation: true
- Only will work if above check_translation is set to true.
Below is a template for regexp which will look after each scenario for missing translations ie: @
translation_tag: "@[0-9a-zA-Z]+_[0-9a-zA-Z]+" - this will match every string on page which fits to template
How to run:
1) WatirCuke can be run with tags like:
./WatirCuke.rb @tag1,@tag2 output
2) Can be run with feature files:
./WatirCuke.rb features/file.feature output
All above will produce the html output and move it into test_results folder
3) WatirCuke can be run with standard CUCUMBER : cucumber -t @tags -f format -o output
*screenshot - will be dropped in test_results/test_datetime/screenshots/ - this structure is created each time cucumber is being run
** Fixtures/Language files can be dropped into : 'features/fixtures' path.
They need to be in YML format like:
login:
login_button: Sign up
Then in scenario you have to use it like:
I click the ":login.login_button" button
That will import the value from attached fixture file.
***cukewatir maximizes the Gherkin speak and minimizes the Watir code.
License:
MIT