SimpliTest 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +22 -0
- data/SimpliTest.gemspec +42 -0
- data/bin/SimpliTest +22 -0
- data/lib/SimpliTest.rb +2 -0
- data/lib/SimpliTest/cli/main.rb +305 -0
- data/lib/SimpliTest/config/configuration.rb +107 -0
- data/lib/SimpliTest/config/directory_paths.rb +36 -0
- data/lib/SimpliTest/config/environment.rb +67 -0
- data/lib/SimpliTest/config/local_environment.rb +20 -0
- data/lib/SimpliTest/config/profiles/chrome.rb +18 -0
- data/lib/SimpliTest/config/profiles/firefox.rb +14 -0
- data/lib/SimpliTest/config/profiles/internet_explorer.rb +12 -0
- data/lib/SimpliTest/config/profiles/phantom.rb +9 -0
- data/lib/SimpliTest/config/profiles/phantom_debug.rb +12 -0
- data/lib/SimpliTest/config/profiles/selenium.rb +13 -0
- data/lib/SimpliTest/config/screen_size.rb +25 -0
- data/lib/SimpliTest/config/steps.rb +8 -0
- data/lib/SimpliTest/helpers/data_validation.rb +60 -0
- data/lib/SimpliTest/helpers/file.rb +38 -0
- data/lib/SimpliTest/helpers/project_setup.rb +186 -0
- data/lib/SimpliTest/helpers/step_helpers/custom_chrome_helpers.rb +14 -0
- data/lib/SimpliTest/helpers/step_helpers/custom_date_helpers.rb +64 -0
- data/lib/SimpliTest/helpers/step_helpers/custom_form_helpers.rb +66 -0
- data/lib/SimpliTest/helpers/step_helpers/custom_phantomjs_helpers.rb +49 -0
- data/lib/SimpliTest/helpers/step_helpers/custom_selenium_helpers.rb +41 -0
- data/lib/SimpliTest/helpers/step_helpers/html_selectors_helpers.rb +154 -0
- data/lib/SimpliTest/helpers/step_helpers/navigation_helpers.rb +196 -0
- data/lib/SimpliTest/helpers/step_helpers/tolerance_for_sync_issues.rb +38 -0
- data/lib/SimpliTest/helpers/step_helpers/within_helpers.rb +6 -0
- data/lib/SimpliTest/helpers/windows_ui.rb +52 -0
- data/lib/SimpliTest/steps/debugging_steps.rb +19 -0
- data/lib/SimpliTest/steps/form_steps.rb +352 -0
- data/lib/SimpliTest/steps/form_verification_steps.rb +190 -0
- data/lib/SimpliTest/steps/navigation_steps.rb +47 -0
- data/lib/SimpliTest/steps/scoper.rb +42 -0
- data/lib/SimpliTest/steps/verification_steps.rb +306 -0
- data/lib/SimpliTest/tasks/document.rb +169 -0
- data/lib/SimpliTest/tasks/examples.rb +18 -0
- data/lib/SimpliTest/tasks/internal_release.rb +39 -0
- data/lib/SimpliTest/tasks/testinstall.rb +5 -0
- data/lib/SimpliTest/templates/NewSimpliTestProject/Readme.txt +5 -0
- data/lib/SimpliTest/templates/NewSimpliTestProject/cucumber.yml +26 -0
- data/lib/SimpliTest/templates/NewSimpliTestProject/documentation/step_definitions.html +87 -0
- data/lib/SimpliTest/templates/NewSimpliTestProject/features/specifications/RegressionTests/HelloWorld.feature +4 -0
- data/lib/SimpliTest/templates/NewSimpliTestProject/features/specifications/SmokeTest/HelloWorld.feature +4 -0
- data/lib/SimpliTest/templates/NewSimpliTestProject/features/specifications/accessibilityTests/HelloWorld.feature +4 -0
- data/lib/SimpliTest/templates/NewSimpliTestProject/features/support/config/environments.yml +11 -0
- data/lib/SimpliTest/templates/NewSimpliTestProject/features/support/config/pages.yml +26 -0
- data/lib/SimpliTest/templates/NewSimpliTestProject/features/support/config/selectors.yml +44 -0
- data/lib/SimpliTest/templates/NewSimpliTestProject/features/support/config/settings.yml +26 -0
- data/lib/SimpliTest/templates/NewSimpliTestProject/features/support/env.rb +33 -0
- data/lib/SimpliTest/templates/NewSimpliTestProject/license.txt +30 -0
- data/lib/SimpliTest/templates/document/css/style.css +28 -0
- data/lib/SimpliTest/templates/document/index.html +60 -0
- data/lib/version.rb +3 -0
- metadata +395 -0
@@ -0,0 +1,169 @@
|
|
1
|
+
|
2
|
+
=begin
|
3
|
+
##########Background###############
|
4
|
+
This file adds a rake task to generate documentation for the Step Definitions available
|
5
|
+
in this gem
|
6
|
+
It basically reads each file in the web steps folder, looks for a step definition pattern and parses them
|
7
|
+
into three columns:
|
8
|
+
Step(Regex): The regular expression used by the Step Definition
|
9
|
+
Example step in plain language: Exactly as you would use in your feature files
|
10
|
+
Arguments the step definition accepts
|
11
|
+
|
12
|
+
################Usage:###############
|
13
|
+
To print this on a Mac or a Linux system with the hirb gem installed: 'gem install hirb'
|
14
|
+
simply type
|
15
|
+
rake document
|
16
|
+
|
17
|
+
On lesser systems :) (and of course of Mac and Linux too), generate a csv with:
|
18
|
+
rake document[csv]
|
19
|
+
|
20
|
+
ZSH(and some other shell) users, escape the argument with:
|
21
|
+
rake document\[csv\]
|
22
|
+
=end
|
23
|
+
|
24
|
+
desc 'List all defined steps'
|
25
|
+
task :document, :format do |t, args|
|
26
|
+
format = args[:format]
|
27
|
+
initialize_variables
|
28
|
+
if format == 'csv'
|
29
|
+
@csv = true
|
30
|
+
require 'csv'
|
31
|
+
CSV.open('step_definitions.csv', 'w') do |csv|
|
32
|
+
csv << @columns
|
33
|
+
generate_steps_document(csv)
|
34
|
+
end
|
35
|
+
alert "SUCCESS::Documentation generated in step_definitions.csv"
|
36
|
+
elsif format == 'html'
|
37
|
+
@html = true
|
38
|
+
initialize_html_variables
|
39
|
+
@html_content = @html_content.gsub('@header_row', generate_table_row_from(@columns, true))
|
40
|
+
generate_steps_document
|
41
|
+
FileUtils.cp(@html_document, @new_project_documentation_dir)
|
42
|
+
alert "SUCCESS::Documentation generated in step_definitions.html"
|
43
|
+
else
|
44
|
+
if hirb_installed?
|
45
|
+
require 'hirb'
|
46
|
+
extend Hirb::Console
|
47
|
+
generate_steps_document
|
48
|
+
else
|
49
|
+
puts "Please either pass a format identifier like 'document[html] document[csv] or gem install hirb for console output'"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def initialize_variables
|
55
|
+
#@potential_step = /^\s*(?:Given|When|Then|And)\s+|\//
|
56
|
+
@gem_dir = SimpliTest.path_to_gem_dir
|
57
|
+
@step_regex = /(?:Given|When|Then|And)[\s\(]*\/(.*)\/([imxo]*)[\s\)]*do\s*(?:$|\|(.*)\|)/
|
58
|
+
@step_definition_dir = SimpliTest.path_to_steps_dir
|
59
|
+
@example_regex = /#Example:(.*)/
|
60
|
+
@columns = [:category, :step, :example, :arguments]
|
61
|
+
end
|
62
|
+
|
63
|
+
def initialize_html_variables
|
64
|
+
@templates_dir = SimpliTest.path_to_templates_dir
|
65
|
+
@new_project_documentation_dir = File.join(@templates_dir, 'NewSimpliTestProject', 'documentation')
|
66
|
+
@html_template = File.join(@templates_dir, "document/index.html")
|
67
|
+
@html_dir = File.join(@templates_dir, "document")
|
68
|
+
@html_content = File.join(@gem_dir, File.read(@html_template))
|
69
|
+
@css_file = File.join(@templates_dir, "document/css/style.css")
|
70
|
+
@html_document = "step_definitions.html"
|
71
|
+
@table_body = ''
|
72
|
+
end
|
73
|
+
|
74
|
+
def generate_steps_document(csv=nil)
|
75
|
+
print_heading_on_console
|
76
|
+
Dir.glob(File.join(@step_definition_dir,'*.rb')).each do |step_file|
|
77
|
+
print_file_name_for(step_file, csv)
|
78
|
+
results = []
|
79
|
+
File.new(step_file).read.each_line.each_cons(3) do |previous_line, line, next_line|
|
80
|
+
#next unless line =~ @potential_step
|
81
|
+
step_match = @step_regex.match(line)
|
82
|
+
next unless step_match
|
83
|
+
example_match = @example_regex.match(previous_line)
|
84
|
+
example = example_match ? example_match[1] : 'N/A'
|
85
|
+
matches = step_match.captures
|
86
|
+
results << capture_row_with(matches, example, csv, @category)
|
87
|
+
end
|
88
|
+
print_on_console(results)
|
89
|
+
generate_html_document if @html
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
|
94
|
+
def print_heading_on_console
|
95
|
+
return if @csv || @html
|
96
|
+
puts "CUCUMBER steps:"
|
97
|
+
puts ""
|
98
|
+
end
|
99
|
+
|
100
|
+
def print_file_name_for(step_file, csv)
|
101
|
+
@category = category_from(step_file)
|
102
|
+
if csv
|
103
|
+
elsif @html
|
104
|
+
else
|
105
|
+
puts "Category: #{@category}"
|
106
|
+
puts ""
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
def print_on_console(results)
|
111
|
+
return if @csv || @html
|
112
|
+
table results, :resize => false, :fields => [:step, :example, :arguments]
|
113
|
+
puts ""
|
114
|
+
puts ""
|
115
|
+
end
|
116
|
+
|
117
|
+
def capture_row_with(matches, example, csv, file_name)
|
118
|
+
step_elements = value_of([file_name, matches[0], example, matches[2]])
|
119
|
+
if csv
|
120
|
+
csv << step_elements
|
121
|
+
elsif @html
|
122
|
+
@table_body << generate_table_row_from(step_elements)
|
123
|
+
else
|
124
|
+
OpenStruct.new(
|
125
|
+
:step => value_of(matches[0]),
|
126
|
+
:example => value_of(example),
|
127
|
+
:arguments => value_of(matches[2])
|
128
|
+
)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
def generate_table_row_from(array, header=false)
|
133
|
+
tag = header ? 'th' : 'td'
|
134
|
+
row = array.map{|x| "<#{tag}>#{x}</#{tag}>"}.join
|
135
|
+
"<tr>#{row}</tr>"
|
136
|
+
end
|
137
|
+
|
138
|
+
def generate_html_document
|
139
|
+
content = @html_content.gsub('@table_body', @table_body)
|
140
|
+
content_with_responsive_label = content.gsub('@responsive_label', responsive_labels_for(@columns))
|
141
|
+
css = File.read(@css_file)
|
142
|
+
content_with_css = content_with_responsive_label.gsub('@css', css)
|
143
|
+
content_with_version_number = content_with_css.gsub('@version', SimpliTest::VERSION)
|
144
|
+
document = File.open(@html_document, "w") {|file| file.write(content_with_version_number)}
|
145
|
+
end
|
146
|
+
|
147
|
+
def responsive_labels_for(array)
|
148
|
+
label = ''
|
149
|
+
array.each_with_index.collect do |header, index|
|
150
|
+
label << "td:nth-of-type(#{index+1}):before { content: '#{header}'; }"
|
151
|
+
end
|
152
|
+
label
|
153
|
+
end
|
154
|
+
|
155
|
+
def value_of(value)
|
156
|
+
return value.map {|member| value_of(member) } if value.is_a?(Array)
|
157
|
+
(value.nil? || value.empty?) ? 'N/A' : value
|
158
|
+
end
|
159
|
+
|
160
|
+
def category_from(file_name)
|
161
|
+
File.basename(file_name).gsub(/\.rb/,'').gsub(/_/,' ').gsub(/steps/,'')
|
162
|
+
end
|
163
|
+
|
164
|
+
def hirb_installed?
|
165
|
+
dep = Gem::Dependency.new('hirb')
|
166
|
+
hirb = dep.matching_specs
|
167
|
+
!hirb.empty?
|
168
|
+
end
|
169
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
drivers = %w(selenium phantom chrome)
|
2
|
+
drivers_with_parallel = drivers + ["parallel"]
|
3
|
+
|
4
|
+
task :default => drivers_with_parallel.map { |d| "examples:#{d}" }.flatten
|
5
|
+
|
6
|
+
namespace :examples do
|
7
|
+
drivers.each do |driver|
|
8
|
+
Cucumber::Rake::Task.new(driver,"run features using #{driver}") do |t|
|
9
|
+
t.profile=driver
|
10
|
+
end
|
11
|
+
end
|
12
|
+
desc "run features using parallel_cucumber"
|
13
|
+
task :parallel do
|
14
|
+
puts "run features in parallel"
|
15
|
+
`bundle exec parallel_cucumber features`
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'bundler'
|
2
|
+
Bundler::GemHelper.class_eval do
|
3
|
+
def release_gem_internally(built_gem_path=nil, force=false)
|
4
|
+
guard_clean
|
5
|
+
built_gem_path ||= build_gem
|
6
|
+
tag_version { git_push } unless already_tagged?
|
7
|
+
rubygem_push_internally(built_gem_path, force) if gem_push?
|
8
|
+
end
|
9
|
+
|
10
|
+
def rubygem_push_internally(path, force)
|
11
|
+
require 'geminabox'
|
12
|
+
if Pathname.new("~/.gem/geminabox").expand_path.exist?
|
13
|
+
if on_cgi_network?
|
14
|
+
command = force ? "gem inabox -o '#{path}'" : "gem inabox '#{path}'"
|
15
|
+
sh('git push -u gitlab master --follow-tags')
|
16
|
+
Bundler.ui.confirm "Pushed latest update and tags to gitlab"
|
17
|
+
sh(command)
|
18
|
+
Bundler.ui.confirm "Pushed #{name} #{version} to rubygems.cgifederal.com"
|
19
|
+
else
|
20
|
+
raise "You are not on the CGI VPN Network. Please connect to the VPN and try again"
|
21
|
+
end
|
22
|
+
else
|
23
|
+
raise "Your geminabox credentials aren't set. Run `gem inabox` to set them."
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def on_cgi_network?
|
28
|
+
Net::HTTP.get_response(URI.parse 'http://rubygems.cgifederal.com').code == '200' rescue false
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
desc "Create tag v#{SimpliTest::VERSION} and build and push SimpliTest-#{SimpliTest::VERSION}.gem to rubygems.cgifederal.com"
|
35
|
+
task :internal_release, [:force] => :build do |t, args|
|
36
|
+
force = args[:force] == 'force'
|
37
|
+
Bundler::GemHelper.new.release_gem_internally(nil, force)
|
38
|
+
end
|
39
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# This file lets you create shortcuts for running your test suite.
|
2
|
+
# The simplest use case for this would be when you have multiple environments (in the environments.yml file)
|
3
|
+
# then you might want to create different profiles for each environment as such:
|
4
|
+
# production: "ENVIRONMENT=Production -r features/support features"
|
5
|
+
# testing: "ENVIRONMENT=Testing -r features/support features"
|
6
|
+
# devb1: "ENVIRONMENT=DEVB1 -r features/support features"
|
7
|
+
# Then you can run your tests against those environments with commands like these:
|
8
|
+
# cucumber --profile testing
|
9
|
+
# cucumber --profile devb1
|
10
|
+
#
|
11
|
+
# For a full description of options available here check out: https://github.com/cucumber/cucumber/wiki/cucumber.yml
|
12
|
+
#
|
13
|
+
<% common = '-r features/support features ' %>
|
14
|
+
<% html = '--format html -o results.html ' %>
|
15
|
+
<% test_number = ENV['TEST_ENV_NUMBER'].nil? || ENV['TEST_ENV_NUMBER'].empty? ? '1' : ENV['TEST_ENV_NUMBER'] %>
|
16
|
+
<% parallel = "--format json -o results-#{test_number}.json " %>
|
17
|
+
<% without_wip = '--tags ~@wip ' %>
|
18
|
+
parallel: <%= parallel + without_wip + common %>
|
19
|
+
|
20
|
+
# *********************************************************************************************
|
21
|
+
# DO NOT DELETE OR MODIFY ANYTHING ABOVE THIS LINE
|
22
|
+
# *********************************************************************************************
|
23
|
+
default: <%= without_wip + html + common %>
|
24
|
+
production: ENVIRONMENT=Production <%= without_wip + html + common %>
|
25
|
+
test: ENVIRONMENT=Test <%= without_wip + html + common %>
|
26
|
+
dev: ENVIRONMENT=Dev <%= without_wip + html + common %>
|
@@ -0,0 +1,87 @@
|
|
1
|
+
<html>
|
2
|
+
|
3
|
+
<head>
|
4
|
+
<meta charset='UTF-8'>
|
5
|
+
|
6
|
+
<title>SimpliTest Steps</title>
|
7
|
+
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
9
|
+
<script type="text/javascript" charset="utf8" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.js"></script>
|
10
|
+
<script type="text/javascript" charset="utf8" src="http://cdnjs.cloudflare.com/ajax/libs/datatables/1.9.4/jquery.dataTables.min.js"></script>
|
11
|
+
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
|
12
|
+
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
|
13
|
+
<script>
|
14
|
+
$(document).ready( function () {
|
15
|
+
$('.dataTable').dataTable( {
|
16
|
+
"bPaginate": false
|
17
|
+
} );
|
18
|
+
} );
|
19
|
+
</script>
|
20
|
+
<style>* {
|
21
|
+
margin: 0;
|
22
|
+
padding: 0;
|
23
|
+
}
|
24
|
+
body {
|
25
|
+
font: 14px/1.4 Georgia, Serif;
|
26
|
+
}
|
27
|
+
p {
|
28
|
+
margin: 20px 0;
|
29
|
+
}
|
30
|
+
|
31
|
+
/*
|
32
|
+
Generic Styling, for Desktops/Laptops
|
33
|
+
*/
|
34
|
+
table {
|
35
|
+
width: 100%;
|
36
|
+
border-collapse: collapse;
|
37
|
+
}
|
38
|
+
th {
|
39
|
+
background: #333;
|
40
|
+
color: white;
|
41
|
+
font-weight: bold;
|
42
|
+
}
|
43
|
+
td, th {
|
44
|
+
padding: 6px;
|
45
|
+
border: 1px solid #ccc;
|
46
|
+
text-align: left;
|
47
|
+
}
|
48
|
+
</style>
|
49
|
+
</head>
|
50
|
+
|
51
|
+
<div class="container">
|
52
|
+
<div class="row clearfix">
|
53
|
+
<div class="col-md-12 column">
|
54
|
+
<div class="row clearfix">
|
55
|
+
<div class="col-md-12 column">
|
56
|
+
<div class="page-header">
|
57
|
+
<h1>
|
58
|
+
SimpliTest <span>Available Steps</span>
|
59
|
+
</h1>
|
60
|
+
</div>
|
61
|
+
</div>
|
62
|
+
</div>
|
63
|
+
<div class="row clearfix">
|
64
|
+
<div class="col-md-8 column">
|
65
|
+
<p>
|
66
|
+
Version: 0.0.1 of SimpliTest adds the following steps to the framework.
|
67
|
+
</p>
|
68
|
+
</div>
|
69
|
+
<div class="col-md-4 column">
|
70
|
+
</div>
|
71
|
+
</div>
|
72
|
+
<table class="dataTable table table-striped table-bordered">
|
73
|
+
<thead>
|
74
|
+
<tr>
|
75
|
+
<tr><th>category</th><th>step</th><th>example</th><th>arguments</th></tr>
|
76
|
+
</tr>
|
77
|
+
</thead>
|
78
|
+
<tbody>
|
79
|
+
<tr><td>debugging </td><td>^show me the page$</td><td> Then show me the page</td><td>N/A</td></tr><tr><td>debugging </td><td>^I wait (\d+) second(?:|s)$</td><td> And I wait 10 seconds</td><td>seconds</td></tr><tr><td>debugging </td><td>^I take a screenshot$</td><td> And I take a screenshot</td><td>N/A</td></tr><tr><td>form </td><td>^(?:|I )fill in the following:$</td><td> When I fill in the following:</td><td>fields</td></tr><tr><td>form </td><td>^(?:|I )attach the file "([^"]*)" to "([^"]*)"$</td><td> When I attach the file "sample.txt" to "field_name"</td><td>file, field</td></tr><tr><td>form </td><td>^(?:|I )fill in "([^"]*)" with "([^"]*)"$</td><td> When I fill in "Name" with "my name"</td><td>field, value</td></tr><tr><td>form </td><td>^(?:|I )fill in "([^"]*)" with:$</td><td> See Gist</td><td>field, value</td></tr><tr><td>form </td><td>^I enter "(.*?)" in the "(.*?)" field$</td><td> And I enter "I made this" in the "Describe yourself" field</td><td>value, field</td></tr><tr><td>form </td><td>^I key in the date "(.*?)" in the "(.*?)" field$</td><td> Then I key in the date "12/01/2013" in the "Date" field</td><td>date_rule, field</td></tr><tr><td>form </td><td>^I key in "(.*?)" in the "(.*)" field$</td><td> When I key in "22031" in the "Location" field</td><td>text, field</td></tr><tr><td>form </td><td>^(?:|I )select "([^"]*)" from "([^"]*)"$</td><td> When I select "Male" from "Sex"</td><td>value, select_field_name_id_or_text</td></tr><tr><td>form </td><td>^(?:|I )check "([^"]*)"$</td><td> And I check "Accept user agrement"</td><td>field</td></tr><tr><td>form </td><td>^(?:|I )uncheck "([^"]*)"$</td><td> When I uncheck "Send me letters"</td><td>field</td></tr><tr><td>form </td><td>^(?:I|i) select following values from "([^"]*)":$</td><td> When I select following values from "Filters": Accepts Gherkin Table</td><td>field, values</td></tr><tr><td>form </td><td>^(?:I|i) unselect following values from "([^"]*)":$</td><td> When I unselect following values from "Filters": Accepts Gherkin Table</td><td>field, values</td></tr><tr><td>form </td><td>^(?:|I )choose "([^"]*)"$</td><td> When I choose "radio 1"</td><td>field</td></tr><tr><td>form </td><td>^(?:|I )press "([^"]*)"$</td><td> When I press "Submit"</td><td>button</td></tr><tr><td>form </td><td>^I press the (first|last|[0-9]+(?:th|st|rd|nd)) instance of "(.*?)"$</td><td> When I press the 4th instance of "nextButton"</td><td>index,link</td></tr><tr><td>form </td><td>^I click the (first|last|next|previous) page button$</td><td> When I click the next page button</td><td>index</td></tr><tr><td>form </td><td>^I click the "(.*?)" (?:button|link)$</td><td> When I click the "Submit" button</td><td>button_or_link</td></tr><tr><td>form </td><td>^I go to page (\d+)$</td><td> When I go to page 1</td><td>page_number</td></tr><tr><td>form </td><td>^I move focus away from "(.*)"$</td><td> Not implemented yet</td><td>locator</td></tr><tr><td>form </td><td>^I press keydown on "(.*)"$</td><td> When I press keydown on "LocationCSSSelector"</td><td>locator</td></tr><tr><td>form </td><td>^I hover over "(.*?)"$</td><td> And I hover over "BidPlansMenu"</td><td>locator</td></tr><tr><td>form </td><td>^I accept the confirmation dialog box$</td><td> And I accept the confirmation dialog</td><td>N/A</td></tr><tr><td>form </td><td>^(?:|I )[Ss]witch to the iframe$</td><td> And I switch to the iframe</td><td>N/A</td></tr><tr><td>form </td><td>^I attach file "([^"]*)" to "([^"]*)"$</td><td> Then I attach file "testAttachment.txt" to "File"</td><td>file, field</td></tr><tr><td>form </td><td>^(?:|I )[Ee]nter today's date in the "([^"]*)" field$</td><td> Then I enter today's date in the "date" field"</td><td>locator</td></tr><tr><td>form </td><td>^I verify "([^"]*)" field has today's date$</td><td> Then I verify "date" field has today's date</td><td>locator</td></tr><tr><td>form </td><td>^I right-click on "(.*?)" and then click the "(.*?)" option$</td><td> When I right-click "some element" and then click "Some Link" option</td><td> locator, link</td></tr><tr><td>form </td><td>^I click the "(.*?)" tab$</td><td> When I click the "Submit" tab</td><td>button_or_link</td></tr><tr><td>form verification </td><td>^the "([^"]*)" field(?: within (.*))? should contain "([^"]*)"$</td><td> Then the "Name" field should contain "my name"</td><td>field, parent, value</td></tr><tr><td>form verification </td><td>^the "([^"]*)" field(?: within (.*))? should not contain "([^"]*)"$</td><td> And the "Name" field should not contain "not my name" </td><td>field, parent, value</td></tr><tr><td>form verification </td><td>^the select "([^"]*)" should have following options:$</td><td> Then the select "Your favorite colors": Table</td><td>field, options</td></tr><tr><td>form verification </td><td>^the following values should be selected in "([^"]*)":$</td><td> And the following values should be selected in "Your favorite colors": Table </td><td>select_box, values</td></tr><tr><td>form verification </td><td>^the following values should not be selected in "([^"]*)":$</td><td> And the following values should not be selected in "Your favorite colors":</td><td>select_box, values</td></tr><tr><td>form verification </td><td>^the "([^"]*)" checkbox(?: within (.*))? should be checked$</td><td> And the "Accept user agrement" checkbox should be checked</td><td>label, parent</td></tr><tr><td>form verification </td><td>^the "([^"]*)" checkbox(?: within (.*))? should not be checked$</td><td> And the "Do not touch me" checkbox should not be checked</td><td>label, parent</td></tr><tr><td>form verification </td><td>^the "(.*?)" selectbox should contain:$</td><td> And the "Sex" selectbox should contain: Table</td><td>locator, options</td></tr><tr><td>form verification </td><td>^the "(.*?)" radio should be selected$</td><td> And the "radio 1" radio should be selected</td><td>locator</td></tr><tr><td>form verification </td><td>^the "(.*?)" radio should not be selected$</td><td> And the "radio 2" radio should not be selected</td><td>locator</td></tr><tr><td>form verification </td><td>^"(.*?)" should be the default date for "(.*?)"$</td><td> Then "12/31/2013" should be the default date for "datepicker"</td><td>date_rule, field</td></tr><tr><td>form verification </td><td>^I enter user name from excel in "(.*?)"$</td><td> Then I enter user name from excel in "Username" </td><td>locator</td></tr><tr><td>form verification </td><td>^I enter password from excel in "([^"]*)" field$</td><td> Then I enter user name from excel in "Username" </td><td>locator</td></tr><tr><td>form verification </td><td>[Rr]ead file "(.*?)"$</td><td>N/A</td><td>filepath</td></tr><tr><td>navigation </td><td>^(?:|I )am on the "(.*)" (?:page|Page)$</td><td> Given I am on the "home" page</td><td>page_name</td></tr><tr><td>navigation </td><td>^(?:|I )go to the "(.*)" page$</td><td> When I go to the "other" page</td><td>page_name</td></tr><tr><td>navigation </td><td>^(?:|I )follow "([^"]*)"$</td><td> When I follow "Privacy Policy"</td><td>link</td></tr><tr><td>navigation </td><td>^(?:|I )maximize the window$</td><td> When I maximize the window</td><td>N/A</td></tr><tr><td>navigation </td><td>^(?:|I )switch to the (.*) window$</td><td> And I switch to the last window</td><td>first_or_last</td></tr><tr><td>navigation </td><td>^(?:|I )[Ss]witch to the frame$</td><td> And I switch to the frame</td><td>N/A</td></tr><tr><td>navigation </td><td>^(?:|I )[Aa]ccept (?:|the )popup(?:| window)$</td><td> Then I Accept the popup window</td><td>N/A</td></tr><tr><td>navigation </td><td>^(?:|I )[Dd]ismiss (?:|the )popup(?:| window)$</td><td> Then I Dismiss the popup window</td><td>N/A</td></tr><tr><td>scoper</td><td>^(.*) within(?: the| an?)? (.*)$</td><td>N/A</td><td>step_def, parent</td></tr><tr><td>scoper</td><td>^(.*) within(?: the| an?)? (.*):$</td><td>N/A</td><td>step_def, parent, table_or_string</td></tr><tr><td>scoper</td><td>^(.*) in the new window$</td><td>N/A</td><td>step_def</td></tr><tr><td>verification </td><td>^I should be redirected to the "(.*)" page$</td><td> Then I should be redirected to the "congratulations" page</td><td>page_name</td></tr><tr><td>verification </td><td>^I should be redirected to the "(.*?)" page with some parameters$</td><td> Then I should be redirected to the "Results" page with some parameters</td><td>page_name</td></tr><tr><td>verification </td><td>^(?:|I )should be on the "(.*)" page$</td><td> Then I should be on the "congratulations" page</td><td>page_name</td></tr><tr><td>verification </td><td>^(?:|I )should see "(.*)"$</td><td> And I should see "Great, you can click links!"</td><td>text</td></tr><tr><td>verification </td><td>^(?:|I )should not see "(.*)"$</td><td> And I should not see "some bla-bla"</td><td>text</td></tr><tr><td>verification </td><td>^(?:|I )should see \/([^\/]*)\/([imxo])?$</td><td> Then I should see /great/i</td><td>regexp,flags</td></tr><tr><td>verification </td><td>^(?:|I )should not see \/([^\/]*)\/([imxo])?$</td><td> Then I should not see /bla-bla/i</td><td>regexp,flags</td></tr><tr><td>verification </td><td>^I should see all of the texts:?$</td><td> Then I should see all of the texts: <pass a table with text values></td><td>table</td></tr><tr><td>verification </td><td>^I should see the "(.*?)" text as "(.*)"$</td><td> Not yet implemented</td><td>locator, text</td></tr><tr><td>verification </td><td>^(?: |I )should see the "(.*)"(?: button| link)$</td><td> Then I should see the "Submit" button</td><td>link_or_button_text</td></tr><tr><td>verification </td><td>^(?: |I )should not see the "(.*)"(?: button| link)$</td><td> And I should not see the "Click Me" link</td><td>button_or_link_text</td></tr><tr><td>verification </td><td>^I should see an? link that points to "([^"]*)"$</td><td> Then I should see a link that points to "http://www.google.com/"</td><td>href_destination</td></tr><tr><td>verification </td><td>^the (first|last|[0-9]+(?:th|st|rd|nd)) instance of "(.*?)" should be disabled$</td><td> Then the 5th instance of "Page1PaginationLinks" should be disabled</td><td>index, button_or_link</td></tr><tr><td>verification </td><td>^I should see that all asset references on the page are valid$</td><td> Then I should see that all asset references on the page are valid</td><td>N/A</td></tr><tr><td>verification </td><td>^I should see that all links on the page are valid$</td><td> And I should see that all links on the page are valid</td><td>N/A</td></tr><tr><td>verification </td><td>^I should be on page (\d+)$</td><td> Then I should be on page 2</td><td>page_number</td></tr><tr><td>verification </td><td>^I should see the following(?: errors| list):$</td><td> Not yet implemented</td><td>table</td></tr><tr><td>verification </td><td>^I should see an? "([^"]*)" tag around the text "([^"]*)"$</td><td> Then I should see a "td" tag around "bla"</td><td>tag_name, text</td></tr><tr><td>verification </td><td>^I should see an? "([^"]*)" with "([^"]*)" of "([^"]*)"$</td><td> Then I should see a "div" with "id" of "ui-datepicker-div"</td><td>tag_name, attribute_name, attribute_value</td></tr><tr><td>verification </td><td>^I should see the image "([^"]*)"$</td><td> Then I should see the image "Image1.jpg"</td><td>image_name</td></tr><tr><td>verification </td><td>^I should see all of the images:?$</td><td> Then I should see all of the images: <accepts a list of image names(src)></td><td>table</td></tr><tr><td>verification </td><td>^(?:|I )should see text "(.*)" as alt text for (.*)$</td><td> Then I should see text "some alt text" as alt text for ImageSelector</td><td>alt_text, locator</td></tr><tr><td>verification </td><td>^I should see the HTML5 audio source "([^"]*)"$</td><td> Then I should see the HTML5 audio source "Audio.mp3"</td><td>audio_name</td></tr><tr><td>verification </td><td>^I should see all of the HTML5 audio sources:?$</td><td> Then I should see the HTML5 audio sources: <Accepts a list of audio file names></td><td>table</td></tr><tr><td>verification </td><td>^I should see the HTML5 video source "([^"]*)"$</td><td> Then I should see the HTML5 video source "video1.mp4"</td><td>video_name</td></tr><tr><td>verification </td><td>^I should see all of the HTML5 video sources:$</td><td> Then I should see the HTML5 video sources: <accepts a table of video sources></td><td>table</td></tr><tr><td>verification </td><td>^I should see (\d+) elements? kind of (.+)$</td><td> Then I should see 2 elements kind of table's header</td><td>count, locator</td></tr><tr><td>verification </td><td>^I should not see elements? kind of (.+)$</td><td> And I should not see elements kind of paragraphs</td><td>locator</td></tr><tr><td>verification </td><td>^I should see "(.*?)" as "(.*?)" value$</td><td> Not Implemented yet</td><td>arg1, arg2</td></tr><tr><td>verification </td><td>^I should see the correct "(.*)"$</td><td> Then I should see the correct "MedicareGovHeader"</td><td>section</td></tr>
|
80
|
+
</tbody>
|
81
|
+
</table>
|
82
|
+
</div>
|
83
|
+
</div>
|
84
|
+
</div>
|
85
|
+
</body>
|
86
|
+
|
87
|
+
</html>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# This file is used to manage some global settings for your test project.
|
2
|
+
# This file must be valid YAML
|
3
|
+
# You can read about YAML syntax here: http://www.ansibleworks.com/docs/YAMLSyntax.html
|
4
|
+
# This YAML checker may come in handy too: http://yamllint.com/
|
5
|
+
# *********************************************************************************************
|
6
|
+
|
7
|
+
---
|
8
|
+
Production: "http://replace with production environment url .com/"
|
9
|
+
Test: "http://replace with test environment url .com/"
|
10
|
+
Dev: "http://replace with dev environment url .com/"
|
11
|
+
Staging: "http://replace with staging environment url .com/"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# This file is used to manage paths to the various pages in the your application.
|
2
|
+
# Paths set here can be refered to by their name in steps such as:
|
3
|
+
# Given I am on the "form" page
|
4
|
+
# OR
|
5
|
+
# Then I should be redirected to the "other" page
|
6
|
+
# Both "form" and "other" in these examples are looked up in this file during test case execution.
|
7
|
+
# If they are not found, the test case will fail.
|
8
|
+
# You can provide both full URLs and relative paths in this file. For example, you can point to external links
|
9
|
+
# like this:
|
10
|
+
# google_maps: http://maps.google.com
|
11
|
+
# When providing URLs, you must provide the full URL (including http or https)
|
12
|
+
# In most cases though, it makes more sense to simply provide a relative path like:
|
13
|
+
# search: '/search.html'
|
14
|
+
# If the current environment is set to:
|
15
|
+
# Production: 'http://your production url.com'
|
16
|
+
# Then the "search" page in this example is understood to be
|
17
|
+
# 'http://your production url.com/search.html'
|
18
|
+
# This file must be valid YAML
|
19
|
+
# You can read about YAML syntax here: http://www.ansibleworks.com/docs/YAMLSyntax.html
|
20
|
+
# This YAML checker may come in handy too: http://yamllint.com/
|
21
|
+
# *********************************************************************************************
|
22
|
+
|
23
|
+
---
|
24
|
+
form: form/page
|
25
|
+
home: ""
|
26
|
+
other: other/page
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# This file is used to manage selectors for the test project.
|
2
|
+
# Selectors are used to look up specific elements in the HTML page.
|
3
|
+
#
|
4
|
+
# An element can be anything enclosed in a valid HTML tag, for example:
|
5
|
+
# <div id="map"></div> is an element and so is:
|
6
|
+
#
|
7
|
+
# When performing tests it is sometimes useful to be able to refer to a specific element.
|
8
|
+
# In most cases you can do this by referencing the Name or the label of the element. For example:
|
9
|
+
# to click a button with the name "Search" you can simply write a step:
|
10
|
+
#
|
11
|
+
# And I click on the "Search" button
|
12
|
+
#
|
13
|
+
# and this will work on most web pages without any special set up. The framework here is making an intelligent guess
|
14
|
+
# about what you mean based on some common web standards. Sometimes these guesses are not accurate (like when you have two Search buttons on the same page) or worse the framework
|
15
|
+
# just refuses to guess (when attributes like name, id or label are not correctly set in the DOM). In such cases you would need to specify a selector in this file.
|
16
|
+
#
|
17
|
+
# For example in the step:
|
18
|
+
#
|
19
|
+
# Then I should see "correct results" within "ResultsTable"
|
20
|
+
#
|
21
|
+
# You might have to first set up a selector called "ResultsTable" in this file.
|
22
|
+
# You can set up selectors using xpath or a css selector. For a better understanding of
|
23
|
+
# xpath try: http://www.w3schools.com/xpath/ and
|
24
|
+
# css selectors: http://www.w3schools.com/cssref/css_selectors.asp
|
25
|
+
#
|
26
|
+
# It is always preferred to use the CSS selectors where possible. CSS Selectors are faster and work better with resource constrained mobile devices.
|
27
|
+
# You can add a css selector for a table element in the web page:
|
28
|
+
# <table id='resultsTable'>....</table>
|
29
|
+
# like this:
|
30
|
+
# ResultsTable: "css:table#resultsTable"
|
31
|
+
#
|
32
|
+
# If you need to use xpath then for the same table element it will be:
|
33
|
+
# ResultsTable: "xpath:/html/body/table[@id='resultsTable']"
|
34
|
+
#
|
35
|
+
# This file must be valid YAML
|
36
|
+
# You can read about YAML syntax here: http://www.ansibleworks.com/docs/YAMLSyntax.html
|
37
|
+
# This YAML checker may come in handy too: http://yamllint.com/
|
38
|
+
# *********************************************************************************************
|
39
|
+
|
40
|
+
---
|
41
|
+
Header1CSS: "css:html > body > table > tbody > tr > th:first-child"
|
42
|
+
Header2Xpath: "xpath:/html/body/table/tbody/tr[1]/th[2]"
|
43
|
+
SquirrelImageCSS: "css:img"
|
44
|
+
SquirrelImageXpath: "xpath:/html/body/img[1]"
|