cucumber-rails 0.3.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.rspec +1 -0
- data/.rvmrc +1 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +194 -0
- data/History.txt +101 -1
- data/LICENSE +22 -0
- data/README.md +77 -0
- data/Rakefile +3 -19
- data/config/cucumber.yml +1 -0
- data/cucumber-rails.gemspec +37 -101
- data/dev_tasks/cucumber.rake +1 -1
- data/dev_tasks/rspec.rake +6 -11
- data/features/allow_rescue.feature +63 -0
- data/features/capybara_javascript_drivers.feature +87 -0
- data/features/database_cleaner.feature +44 -0
- data/features/emulate_javascript.feature +34 -0
- data/features/inspect_query_string.feature +37 -0
- data/features/install_cucumber_rails.feature +16 -0
- data/features/mongoid.feature +53 -0
- data/features/multiple_databases.feature +74 -0
- data/features/named_selectors.feature +33 -0
- data/features/no_database.feature +70 -0
- data/features/pseduo_class_selectors.feature +24 -0
- data/features/rerun_profile.feature +38 -0
- data/features/rest_api.feature +47 -0
- data/features/routing.feature +18 -0
- data/features/select_dates.feature +99 -0
- data/features/step_definitions/cucumber_rails_steps.rb +80 -6
- data/features/support/env.rb +8 -2
- data/features/test_unit.feature +43 -0
- data/lib/cucumber/rails/capybara/javascript_emulation.rb +83 -0
- data/lib/cucumber/rails/capybara/select_dates_and_times.rb +50 -0
- data/lib/cucumber/rails/capybara.rb +6 -0
- data/lib/cucumber/rails/hooks/active_record.rb +14 -0
- data/lib/cucumber/rails/hooks/allow_rescue.rb +8 -0
- data/lib/cucumber/rails/hooks/database_cleaner.rb +13 -0
- data/lib/cucumber/rails/hooks/mail.rb +5 -0
- data/lib/cucumber/rails/hooks.rb +4 -0
- data/lib/cucumber/rails/rspec.rb +4 -6
- data/lib/cucumber/rails/world.rb +13 -35
- data/lib/cucumber/rails.rb +8 -0
- data/lib/cucumber/rails3/action_controller.rb +12 -0
- data/lib/cucumber/rails3/active_record.rb +8 -0
- data/lib/cucumber/rails3/application.rb +17 -0
- data/lib/cucumber/rails3.rb +16 -0
- data/lib/cucumber/web/tableish.rb +50 -9
- data/lib/generators/cucumber/feature/feature_generator.rb +8 -17
- data/lib/generators/cucumber/feature/named_arg.rb +2 -0
- data/{templates/feature → lib/generators/cucumber/feature/templates}/feature.erb +10 -12
- data/{templates/feature → lib/generators/cucumber/feature/templates}/steps.erb +1 -1
- data/lib/generators/cucumber/install/USAGE +15 -0
- data/lib/generators/cucumber/install/install_generator.rb +88 -0
- data/lib/generators/cucumber/install/templates/config/cucumber.yml.erb +8 -0
- data/lib/generators/cucumber/install/templates/step_definitions/web_steps.rb.erb +192 -0
- data/lib/generators/cucumber/install/templates/step_definitions/web_steps_cs.rb.erb +127 -0
- data/lib/generators/cucumber/install/templates/step_definitions/web_steps_da.rb.erb +105 -0
- data/lib/generators/cucumber/install/templates/step_definitions/web_steps_de.rb.erb +127 -0
- data/lib/generators/cucumber/install/templates/step_definitions/web_steps_es.rb.erb +127 -0
- data/lib/generators/cucumber/install/templates/step_definitions/web_steps_ja.rb.erb +140 -0
- data/lib/generators/cucumber/install/templates/step_definitions/web_steps_ko.rb.erb +142 -0
- data/lib/generators/cucumber/install/templates/step_definitions/web_steps_no.rb.erb +105 -0
- data/lib/generators/cucumber/install/templates/step_definitions/web_steps_pt-BR.rb.erb +132 -0
- data/lib/generators/cucumber/install/templates/support/_rails_each_run.rb.erb +36 -0
- data/lib/generators/cucumber/install/templates/support/_rails_prefork.rb.erb +1 -0
- data/{templates/skeleton → lib/generators/cucumber/install/templates}/support/capybara.rb +0 -4
- data/{templates/skeleton → lib/generators/cucumber/install/templates}/support/paths.rb +11 -5
- data/{templates/skeleton → lib/generators/cucumber/install/templates}/support/rails.rb.erb +2 -2
- data/{templates/skeleton → lib/generators/cucumber/install/templates}/support/rails_spork.rb.erb +2 -2
- data/lib/generators/cucumber/install/templates/support/selectors.rb +39 -0
- data/lib/generators/cucumber/install/templates/support/web_steps_warning.txt +19 -0
- data/{templates/skeleton → lib/generators/cucumber/install/templates}/tasks/cucumber.rake.erb +18 -0
- data/spec/cucumber/web/tableish_spec.rb +83 -6
- data/spec/spec_helper.rb +1 -4
- metadata +299 -73
- data/HACKING.rdoc +0 -34
- data/README.rdoc +0 -64
- data/VERSION +0 -1
- data/features/rails2.feature +0 -56
- data/features/rails3.feature +0 -52
- data/features/support/matchers/files.rb +0 -17
- data/generators/cucumber/USAGE +0 -14
- data/generators/cucumber/cucumber_generator.rb +0 -89
- data/generators/cucumber/templates/step_definitions/web_steps_ja.rb.erb +0 -136
- data/generators/feature/USAGE +0 -12
- data/generators/feature/feature_generator.rb +0 -47
- data/lib/cucumber/rails/action_controller.rb +0 -65
- data/lib/cucumber/rails/active_record.rb +0 -34
- data/lib/cucumber/rails/capybara_javascript_emulation.rb +0 -72
- data/lib/cucumber/rails/test_unit.rb +0 -9
- data/lib/generators/cucumber/feature/feature_base.rb +0 -29
- data/lib/generators/cucumber/skeleton/USAGE +0 -21
- data/lib/generators/cucumber/skeleton/skeleton_base.rb +0 -202
- data/lib/generators/cucumber/skeleton/skeleton_generator.rb +0 -64
- data/rvm.yml +0 -22
- data/spec/generators/cucumber/skeleton/skeleton_base_spec.rb +0 -84
- data/spec/spec.opts +0 -2
- data/templates/skeleton/config/cucumber.yml.erb +0 -7
- data/templates/skeleton/environments/cucumber.rb.erb +0 -37
- data/templates/skeleton/step_definitions/capybara_steps.rb.erb +0 -197
- data/templates/skeleton/step_definitions/web_steps_cs.rb.erb +0 -136
- data/templates/skeleton/step_definitions/web_steps_da.rb.erb +0 -114
- data/templates/skeleton/step_definitions/web_steps_de.rb.erb +0 -136
- data/templates/skeleton/step_definitions/web_steps_es.rb.erb +0 -136
- data/templates/skeleton/step_definitions/web_steps_no.rb.erb +0 -114
- data/templates/skeleton/step_definitions/web_steps_pt-BR.rb.erb +0 -140
- data/templates/skeleton/step_definitions/webrat_steps.rb.erb +0 -268
- data/templates/skeleton/support/_rails_each_run.rb +0 -34
- data/templates/skeleton/support/_rails_prefork.rb.erb +0 -10
- data/templates/skeleton/support/webrat.rb +0 -8
- /data/{templates/skeleton → lib/generators/cucumber/install/templates}/script/cucumber +0 -0
- /data/{templates/skeleton → lib/generators/cucumber/install/templates}/support/edit_warning.txt +0 -0
@@ -0,0 +1,127 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
<%= embed_file('support/web_steps_warning.txt') %>
|
3
|
+
|
4
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
|
5
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "selectors"))
|
6
|
+
|
7
|
+
# Single-line step scoper
|
8
|
+
Wenn /^(.*) innerhalb ([^:]+)$/ do |step, parent|
|
9
|
+
with_scope(parent) { Wenn step }
|
10
|
+
end
|
11
|
+
|
12
|
+
# Multi-line step scoper
|
13
|
+
Wenn /^(.*) innerhalb ([^:]+):$/ do |step, parent, table_or_string|
|
14
|
+
with_scope(parent) { Wenn "#{step}:", table_or_string }
|
15
|
+
end
|
16
|
+
|
17
|
+
Angenommen /^(?:|ich )bin auf (.+)$/ do |page_name|
|
18
|
+
Given %{I am on #{page_name}}
|
19
|
+
end
|
20
|
+
|
21
|
+
Wenn /^(?:|ich )auf (.+) gehe$/ do |page_name|
|
22
|
+
When %{I go to #{page_name}}
|
23
|
+
end
|
24
|
+
|
25
|
+
Wenn /^(?:|ich )auf "([^"]*)" drücke$/ do |button|
|
26
|
+
When %{I press "#{button}"}
|
27
|
+
end
|
28
|
+
|
29
|
+
Wenn /^(?:|ich )auf "([^"]*)" klicke$/ do |link|
|
30
|
+
When %{I follow "#{link}"}
|
31
|
+
end
|
32
|
+
|
33
|
+
Wenn /^(?:|ich )"([^"]*)" mit "([^"]*)" ausfülle$/ do |field, value|
|
34
|
+
When %{I fill in "#{field}" with "#{value}"}
|
35
|
+
end
|
36
|
+
|
37
|
+
Wenn /^(?:|ich )"([^"]*)" in "([^"]*)" eingebe$/ do |value, field|
|
38
|
+
When %{I fill in "#{value}" for "#{field}"}
|
39
|
+
end
|
40
|
+
|
41
|
+
Wenn /^(?:|ich )folgendes eingebe:$/ do |fields|
|
42
|
+
When %{I fill in the following:}, fields
|
43
|
+
end
|
44
|
+
|
45
|
+
Wenn /^(?:|ich )"([^"]*)" in "([^"]*)" auswähle$/ do |value, field|
|
46
|
+
When %{I select "#{value}" from "#{field}"}
|
47
|
+
end
|
48
|
+
|
49
|
+
Wenn /^(?:|ich )"([^"]*)" als Datum und Uhrzeit auswähle$/ do |time|
|
50
|
+
When %{I select "#{time}" as the date and time}
|
51
|
+
end
|
52
|
+
|
53
|
+
Wenn /^(?:|ich )"([^"]*)" als "([^"]*)" Datum und Uhrzeit auswähle$/ do |datetime, datetime_label|
|
54
|
+
When %{I select "#{datetime}" as the "#{datetime_label}" date and time}
|
55
|
+
end
|
56
|
+
|
57
|
+
Wenn /^(?:|ich )"([^"]*)" als Uhrzeit auswähle$/ do |time|
|
58
|
+
When %{I select "#{time}" as the time}
|
59
|
+
end
|
60
|
+
|
61
|
+
Wenn /^(?:|ich )"([^"]*)" als "([^"]*)" Uhrzeit auswähle$/ do |time, time_label|
|
62
|
+
When %{I select "#{time}" as the "#{time_label}" time}
|
63
|
+
end
|
64
|
+
|
65
|
+
Wenn /^(?:|ich )"([^"]*)" als Datum auswähle$/ do |date|
|
66
|
+
When %{I select "#{date}" as the date}
|
67
|
+
end
|
68
|
+
|
69
|
+
Wenn /^(?:|ich )"([^"]*)" als "([^"]*)" Datum auswähle$/ do |date, date_label|
|
70
|
+
When %{I select "#{date}" as the "#{date_label}" date}
|
71
|
+
end
|
72
|
+
|
73
|
+
Wenn /^(?:|ich )"([^"]*)" anhake$/ do |field|
|
74
|
+
When %{I check "#{field}"}
|
75
|
+
end
|
76
|
+
|
77
|
+
Wenn /^(?:|ich )"([^"]*)" abhake$/ do |field|
|
78
|
+
When %{I uncheck "#{field}"}
|
79
|
+
end
|
80
|
+
|
81
|
+
Wenn /^(?:|ich )"([^"]*)" auswähle$/ do |field|
|
82
|
+
When %{I choose "#{field}"}
|
83
|
+
end
|
84
|
+
|
85
|
+
Wenn /^(?:|ich )die Datei "([^"]*)" als "([^"]*)" anhänge$/ do |path, field|
|
86
|
+
When %{I attach the file "#{path}" to "#{field}"}
|
87
|
+
end
|
88
|
+
|
89
|
+
Dann /^(?:|ich sollte |sollte (?:|ich )?)"([^"]*)" sehen$/ do |text|
|
90
|
+
Then %{I should see "#{text}"}
|
91
|
+
end
|
92
|
+
|
93
|
+
Dann /^(?:|ich sollte |sollte (?:|ich )?)\/([^\/]*)\/ sehen$/ do |regexp|
|
94
|
+
Then %{I should see /#{regexp}/}
|
95
|
+
end
|
96
|
+
|
97
|
+
Dann /^(?:|ich sollte |sollte (?:|ich )?)nicht "([^"]*)" sehen$/ do |text|
|
98
|
+
Then %{I should not see "#{text}"}
|
99
|
+
end
|
100
|
+
|
101
|
+
Dann /^(?:|ich sollte |sollte (?:|ich )?)nicht \/([^\/]*)\/ sehen$/ do |regexp|
|
102
|
+
Then %{I should not see /#{regexp}/}
|
103
|
+
end
|
104
|
+
|
105
|
+
Dann /^(?:|sollte )das "([^"]*)" Feld (?:|sollte )"([^"]*)" enthalten$/ do |field, value|
|
106
|
+
Then %{the "#{field}" field should contain "#{value}"}
|
107
|
+
end
|
108
|
+
|
109
|
+
Dann /^(?:|sollte )das "([^"]*)" Feld (?:|sollte )nicht "([^"]*)" enthalten$/ do |field, value|
|
110
|
+
Then %{the "#{field}" field should not contain "#{value}"}
|
111
|
+
end
|
112
|
+
|
113
|
+
Dann /^(?:|sollte )die "([^"]*)" Checkbox (?:|sollte )angehakt sein$/ do |label|
|
114
|
+
Then %{the "#{label}" checkbox should be checked}
|
115
|
+
end
|
116
|
+
|
117
|
+
Dann /^(?:|sollte )die "([^"]*)" Checkbox (?:|sollte )nicht angehakt sein$/ do |label|
|
118
|
+
Then %{the "#{label}" checkbox should not be checked}
|
119
|
+
end
|
120
|
+
|
121
|
+
Dann /^(?:|ich sollte |sollte (?:|ich )?)auf (.+) sein$/ do |page_name|
|
122
|
+
Then %{I should be on #{page_name}}
|
123
|
+
end
|
124
|
+
|
125
|
+
Dann /^zeig mir die Seite$/ do
|
126
|
+
Then %{show me the page}
|
127
|
+
end
|
@@ -0,0 +1,127 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
<%= embed_file('support/web_steps_warning.txt') %>
|
3
|
+
|
4
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
|
5
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "selectors"))
|
6
|
+
|
7
|
+
# Single-line step scoper
|
8
|
+
Cuando /^(.*) dentro de ([^:]+)$/ do |step, parent|
|
9
|
+
with_scope(parent) { Cuando step }
|
10
|
+
end
|
11
|
+
|
12
|
+
# Multi-line step scoper
|
13
|
+
Cuando /^(.*) dentro de ([^:]+):$/ do |step, parent, table_or_string|
|
14
|
+
with_scope(parent) { Cuando "#{step}:", table_or_string }
|
15
|
+
end
|
16
|
+
|
17
|
+
Dado /^que estoy en (.+)$/ do |page_name|
|
18
|
+
Given %{I am on #{page_name}}
|
19
|
+
end
|
20
|
+
|
21
|
+
Cuando /^voy a (.+)$/ do |page_name|
|
22
|
+
When %{I go to #{page_name}}
|
23
|
+
end
|
24
|
+
|
25
|
+
Cuando /^apreto "([^"]*)"$/ do |button|
|
26
|
+
When %{I press "#{button}"}
|
27
|
+
end
|
28
|
+
|
29
|
+
Cuando /^clickeo "([^"]*)"$/ do |link|
|
30
|
+
When %{I follow "#{link}"}
|
31
|
+
end
|
32
|
+
|
33
|
+
Cuando /^completo "([^"]*)" con "([^"]*)"$/ do |field, value|
|
34
|
+
When %{I fill in "#{field}" with "#{value}"}
|
35
|
+
end
|
36
|
+
|
37
|
+
Cuando /^completo "([^"]*)" para "([^"]*)"$/ do |value, field|
|
38
|
+
When %{I fill in "#{value}" for "#{field}"}
|
39
|
+
end
|
40
|
+
|
41
|
+
Cuando /^completo lo siguiente:$/ do |fields|
|
42
|
+
When %{I fill in the following:}, fields
|
43
|
+
end
|
44
|
+
|
45
|
+
Cuando /^selecciono "([^"]*)" de "([^"]*)"$/ do |value, field|
|
46
|
+
When %{I select "#{value}" from "#{field}"}
|
47
|
+
end
|
48
|
+
|
49
|
+
Cuando /^selecciono "([^"]*)" como la fecha y la hora$/ do |time|
|
50
|
+
When %{I select "#{time}" as the date and time}
|
51
|
+
end
|
52
|
+
|
53
|
+
Cuando /^selecciono "([^"]*)" como la fecha y la hora "([^"]*)"$/ do |datetime, datetime_label|
|
54
|
+
When %{I select "#{datetime}" as the "#{datetime_label}" date and time}
|
55
|
+
end
|
56
|
+
|
57
|
+
Cuando /^selecciono "([^"]*)" como la hora$/ do |time|
|
58
|
+
When %{I select "#{time}" as the time}
|
59
|
+
end
|
60
|
+
|
61
|
+
Cuando /^selecciono "([^"]*)" como la hora "([^"]*)"$/ do |time, time_label|
|
62
|
+
When %{I select "#{time}" as the "#{time_label}" time}
|
63
|
+
end
|
64
|
+
|
65
|
+
Cuando /^selecciono "([^"]*)" como la fecha$/ do |date|
|
66
|
+
When %{I select "#{date}" as the date}
|
67
|
+
end
|
68
|
+
|
69
|
+
Cuando /^selecciono "([^"]*)" como la fecha "([^"]*)"$/ do |date, date_label|
|
70
|
+
When %{I select "#{date}" as the "#{date_label}" date}
|
71
|
+
end
|
72
|
+
|
73
|
+
Cuando /^marco "([^"]*)"$/ do |field|
|
74
|
+
When %{I check "#{field}"}
|
75
|
+
end
|
76
|
+
|
77
|
+
Cuando /^desmarco "([^"]*)"$/ do |field|
|
78
|
+
When %{I uncheck "#{field}"}
|
79
|
+
end
|
80
|
+
|
81
|
+
Cuando /^elijo "([^"]*)"$/ do |field|
|
82
|
+
When %{I choose "#{field}"}
|
83
|
+
end
|
84
|
+
|
85
|
+
Cuando /^adjunto el archivo "([^"]*)" a "([^"]*)"$/ do |path, field|
|
86
|
+
When %{I attach the file "#{path}" to "#{field}"}
|
87
|
+
end
|
88
|
+
|
89
|
+
Entonces /^debería ver "([^"]*)"$/ do |text|
|
90
|
+
Then %{I should see "#{text}"}
|
91
|
+
end
|
92
|
+
|
93
|
+
Entonces /^debería ver \/([^\/]*)\/$/ do |regexp|
|
94
|
+
Then %{I should see /#{regexp}/}
|
95
|
+
end
|
96
|
+
|
97
|
+
Entonces /^no debería ver "([^"]*)"$/ do |text|
|
98
|
+
Then %{I should not see "#{text}"}
|
99
|
+
end
|
100
|
+
|
101
|
+
Entonces /^no debería ver \/([^\/]*)\/$/ do |regexp|
|
102
|
+
Then %{I should not see /#{regexp}/}
|
103
|
+
end
|
104
|
+
|
105
|
+
Entonces /^el campo "([^"]*)" debería contener "([^"]*)"$/ do |field, value|
|
106
|
+
Then %{the "#{field}" field should contain "#{value}"}
|
107
|
+
end
|
108
|
+
|
109
|
+
Entonces /^el campo "([^"]*)" no debería contener "([^"]*)"$/ do |field, value|
|
110
|
+
Then %{the "#{field}" field should not contain "#{value}"}
|
111
|
+
end
|
112
|
+
|
113
|
+
Entonces /^la checkbox "([^"]*)" debería estar marcada$/ do |label|
|
114
|
+
Then %{the "#{label}" checkbox should be checked}
|
115
|
+
end
|
116
|
+
|
117
|
+
Entonces /^la checkbox "([^"]*)" no debería estar marcada$/ do |label|
|
118
|
+
Then %{the "#{label}" checkbox should not be checked}
|
119
|
+
end
|
120
|
+
|
121
|
+
Entonces /^debería estar en (.+)$/ do |page_name|
|
122
|
+
Then %{I should be on #{page_name}}
|
123
|
+
end
|
124
|
+
|
125
|
+
Entonces /^mostrame la página$/ do
|
126
|
+
Then %{show me the page}
|
127
|
+
end
|
@@ -0,0 +1,140 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
<%= embed_file('support/web_steps_warning.txt') %>
|
3
|
+
|
4
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
|
5
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "selectors"))
|
6
|
+
|
7
|
+
前提 /^"([^"]*)"ページを表示している$/ do |page_name|
|
8
|
+
Given %{I am on #{page_name}}
|
9
|
+
end
|
10
|
+
|
11
|
+
もし /^"([^"]*)"ページを表示する$/ do |page_name|
|
12
|
+
When %{I go to #{page_name}}
|
13
|
+
end
|
14
|
+
|
15
|
+
もし /^"([^"]*)"ボタンをクリックする$/ do |button|
|
16
|
+
When %{I press "#{button}"}
|
17
|
+
end
|
18
|
+
|
19
|
+
もし /^"([^"]*)"リンクをクリックする$/ do |link|
|
20
|
+
When %{I follow "#{link}"}
|
21
|
+
end
|
22
|
+
|
23
|
+
もし /^"([^"]*)"の"([^"]*)"リンクをクリックする$/ do |parent, link|
|
24
|
+
When %{I follow "#{link}" within "#{parent}"}
|
25
|
+
end
|
26
|
+
|
27
|
+
もし /^"([^"]*)"に"([^"]*)"と入力する$/ do |field, value|
|
28
|
+
When %{I fill in "#{field}" with "#{value}"}
|
29
|
+
end
|
30
|
+
|
31
|
+
# less difference to %{I fill in "#{value}" for "#{field}"} with above in Japanese.
|
32
|
+
|
33
|
+
もし /^以下の項目を入力する:$/ do |fields|
|
34
|
+
When %{I fill in the following:}, fields
|
35
|
+
end
|
36
|
+
|
37
|
+
もし /^"([^"]*)"から"([^"]*)"を選択する$/ do |field, value|
|
38
|
+
When %{I select "#{value}" from "#{field}"}
|
39
|
+
end
|
40
|
+
|
41
|
+
もし /^日時として"([^"]*)"を選択する$/ do |time|
|
42
|
+
When %{I select "#{time}" as the date and time}
|
43
|
+
end
|
44
|
+
|
45
|
+
もし /^"([^"]*)"の日時として"([^"]*)"を選択する$/ do |datetime_label, datetime|
|
46
|
+
When %{I select "#{datetime}" as the "#{datetime_label}" date and time}
|
47
|
+
end
|
48
|
+
|
49
|
+
もし /^時間として"([^"]*)"を選択する$/ do |time|
|
50
|
+
When %{I select "#{time}" as the time}
|
51
|
+
end
|
52
|
+
|
53
|
+
もし /^"([^"]*)"の時間として"([^"]*)"を選択する$/ do |time_label, time|
|
54
|
+
When %{I select "#{time}" as the "#{time_label}" time}
|
55
|
+
end
|
56
|
+
|
57
|
+
もし /^日付として"([^"]*)"を選択する$/ do |date|
|
58
|
+
When %{I select "#{date}" as the date}
|
59
|
+
end
|
60
|
+
|
61
|
+
もし /^"([^"]*)"の日付として"([^"]*)"を選択する$/ do |date_label, date|
|
62
|
+
When %{I select "#{date}" as the "#{date_label}" date}
|
63
|
+
end
|
64
|
+
|
65
|
+
もし /^"([^"]*)"をチェックする$/ do |field|
|
66
|
+
When %{I check "#{field}"}
|
67
|
+
end
|
68
|
+
|
69
|
+
もし /^"([^"]*)"のチェックを外す$/ do |field|
|
70
|
+
When %{I uncheck "#{field}"}
|
71
|
+
end
|
72
|
+
|
73
|
+
もし /^"([^"]*)"を選択する$/ do |field|
|
74
|
+
When %{I choose "#{field}"}
|
75
|
+
end
|
76
|
+
|
77
|
+
もし /^"([^"]*)"としてファイル"([^"]*)"を選択する$/ do |field, path|
|
78
|
+
When %{I attach the file "#{path}" to "#{field}"}
|
79
|
+
end
|
80
|
+
|
81
|
+
ならば /^"([^"]*)"と表示されていること$/ do |text|
|
82
|
+
Then %{I should see "#{text}"}
|
83
|
+
end
|
84
|
+
|
85
|
+
ならば /^"([^"]*)"に"([^"]*)"と表示されていること$/ do |selector, text|
|
86
|
+
Then %{I should see "#{text}" within "#{selector}"}
|
87
|
+
end
|
88
|
+
|
89
|
+
ならば /^\/([^\/]*)\/と表示されていること$/ do |regexp|
|
90
|
+
Then %{I should see /#{regexp}/}
|
91
|
+
end
|
92
|
+
|
93
|
+
ならば /^"([^"]*)"に\/([^\/]*)\/と表示されていること$/ do |selector, regexp|
|
94
|
+
Then %{I should see \/#{regexp}\/ within "#{selector}"}
|
95
|
+
end
|
96
|
+
|
97
|
+
ならば /^"([^"]*)"と表示されていないこと$/ do |text|
|
98
|
+
Then %{I should not see "#{text}"}
|
99
|
+
end
|
100
|
+
|
101
|
+
ならば /^"([^"]*)"に"([^"]*)"と表示されていないこと$/ do |selector, text|
|
102
|
+
Then %{I should not see "#{text}" within "#{selector}"}
|
103
|
+
end
|
104
|
+
|
105
|
+
ならば /^\/([^\/]*)\/と表示されていないこと$/ do |regexp|
|
106
|
+
Then %{I should not see /#{regexp}/}
|
107
|
+
end
|
108
|
+
|
109
|
+
ならば /^"([^"]*)"に\/([^\/]*)\/と表示されていないこと$/ do |selector, regexp|
|
110
|
+
Then %{I should not see \/#{regexp}\/ within "#{selector}"}
|
111
|
+
end
|
112
|
+
|
113
|
+
ならば /^入力項目"([^"]*)"に"([^"]*)"と表示されていること$/ do |field, value|
|
114
|
+
Then %{the "#{field}" field should contain "#{value}"}
|
115
|
+
end
|
116
|
+
|
117
|
+
ならば /^入力項目"([^"]*)"に"([^"]*)"と表示されていないこと$/ do |field, value|
|
118
|
+
Then %{the "#{field}" field should not contain "#{value}"}
|
119
|
+
end
|
120
|
+
|
121
|
+
ならば /^"([^"]*)"がチェックされていること$/ do |label|
|
122
|
+
Then %{the "#{label}" checkbox should be checked}
|
123
|
+
end
|
124
|
+
|
125
|
+
ならば /^"([^"]*)"がチェックされていないこと$/ do |label|
|
126
|
+
Then %{the "#{label}" checkbox should not be checked}
|
127
|
+
end
|
128
|
+
|
129
|
+
ならば /^"([^"]*)"ページを表示していること$/ do |page_name|
|
130
|
+
Then %{I should be on #{page_name}}
|
131
|
+
end
|
132
|
+
|
133
|
+
show_me_the_page = lambda { Then %{show me the page} }
|
134
|
+
|
135
|
+
ならば /^ページを表示する$/, &show_me_the_page
|
136
|
+
ならば /^画面を目視$/, &show_me_the_page
|
137
|
+
|
138
|
+
# backword-compat for old japanese translation.
|
139
|
+
ならば /^デバッグ(?:のため)?$/, &show_me_the_page
|
140
|
+
|
@@ -0,0 +1,142 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
<%= embed_file('support/web_steps_warning.txt') %>
|
3
|
+
|
4
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
|
5
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "selectors"))
|
6
|
+
|
7
|
+
조건 /^(.+)페이지에 있습니다$/ do |page_name|
|
8
|
+
Given %{I am on #{page_name}}
|
9
|
+
end
|
10
|
+
|
11
|
+
만일 /^(.+)페이지로 갑니다$/ do |page_name|
|
12
|
+
When %{I go to #{page_name}}
|
13
|
+
end
|
14
|
+
|
15
|
+
만일 /^"([^"]*)"버튼을 누릅니다$/ do |button|
|
16
|
+
When %{I press "#{button}"}
|
17
|
+
end
|
18
|
+
|
19
|
+
만일 /^"([^"]*)"링크를 클릭합니다$/ do |link|
|
20
|
+
When %{I follow "#{link}"}
|
21
|
+
end
|
22
|
+
|
23
|
+
만일 /^"([^"]*)"안에 있는 "([^"]*)"링크를 클릭합니다$/ do |parent, link|
|
24
|
+
When %{I follow "#{link}" within "#{parent}"}
|
25
|
+
end
|
26
|
+
|
27
|
+
만일 /^"([^"]*)"에 "([^"]*)"라고 적습니다$/ do |field, value|
|
28
|
+
When %{I fill in "#{field}" with "#{value}"}
|
29
|
+
end
|
30
|
+
|
31
|
+
만일 /^"([^"]*)"라고 "([^"]*)"에 적습니다$/ do |value, field|
|
32
|
+
When %{I fill in "#{value}" for "#{field}"}
|
33
|
+
end
|
34
|
+
|
35
|
+
만일 /^아레의 목록을 입력합니다$/ do |fields|
|
36
|
+
When %{I fill in the following:}, fields
|
37
|
+
end
|
38
|
+
|
39
|
+
만일 /^"([^"]*)"를 "([^"]*)"으로 합니다$/ do |field, value|
|
40
|
+
When %{I select "#{value}" from "#{field}"}
|
41
|
+
end
|
42
|
+
|
43
|
+
만일 /^날짜와 시간를 "([^"]*)"으로 합니다$/ do |time|
|
44
|
+
When %{I select "#{time}" as the date and time}
|
45
|
+
end
|
46
|
+
|
47
|
+
만일 /^"([^"]*)"의 날짜와 시간을 "([^"]*)"으로 합니다$/ do |datetime_label, datetime|
|
48
|
+
When %{I select "#{datetime}" as the "#{datetime_label}" date and time}
|
49
|
+
end
|
50
|
+
|
51
|
+
만일 /^시간을 "([^"]*)"으로 합니다$/ do |time|
|
52
|
+
When %{I select "#{time}" as the time}
|
53
|
+
end
|
54
|
+
|
55
|
+
만일 /^"([^"]*)"의 시간을 "([^"]*)"으로 합니다$/ do |time_label, time|
|
56
|
+
When %{I select "#{time}" as the "#{time_label}" time}
|
57
|
+
end
|
58
|
+
|
59
|
+
만일 /^날짜를 "([^"]*)"으로 합니다$/ do |date|
|
60
|
+
When %{I select "#{date}" as the date}
|
61
|
+
end
|
62
|
+
|
63
|
+
만일 /^"([^"]*)"의 날짜를 "([^"]*)"으로 합니다$/ do |date_label, date|
|
64
|
+
When %{I select "#{date}" as the "#{date_label}" date}
|
65
|
+
end
|
66
|
+
|
67
|
+
만일 /^"([^"]*)"를 체크합니다$/ do |field|
|
68
|
+
When %{I check "#{field}"}
|
69
|
+
end
|
70
|
+
|
71
|
+
만일 /^"([^"]*)"의 체크를 해제합니다$/ do |field|
|
72
|
+
When %{I uncheck "#{field}"}
|
73
|
+
end
|
74
|
+
|
75
|
+
만일 /^"([^"]*)"를 고릅니다$/ do |field|
|
76
|
+
When %{I choose "#{field}"}
|
77
|
+
end
|
78
|
+
|
79
|
+
만일 /^"([^"]*)"에 "([^"]*)"파일을 첨부합니다$/ do |field, path|
|
80
|
+
When %{I attach the file "#{path}" to "#{field}"}
|
81
|
+
end
|
82
|
+
|
83
|
+
그러면 /^"([^"]*)"가 보여야 합니다$/ do |text|
|
84
|
+
Then %{I should see "#{text}"}
|
85
|
+
end
|
86
|
+
|
87
|
+
그러면 /^"([^"]*)"안에 "([^"]*)"가 보여야 합니다$/ do |selector, text|
|
88
|
+
Then %{I should see "#{text}" within "#{selector}"}
|
89
|
+
end
|
90
|
+
|
91
|
+
그러면 /^\/([^\/]*)\/가 보여야 합니다$/ do |regexp|
|
92
|
+
Then %{I should see /#{regexp}/}
|
93
|
+
end
|
94
|
+
|
95
|
+
그러면 /^"([^"]*)"안에 \/([^\/]*)\/가 보여야 합니다$/ do |selector, regexp|
|
96
|
+
Then %{I should see /#{regexp}/ within "#{selector}"}
|
97
|
+
end
|
98
|
+
|
99
|
+
그러면 /^"([^"]*)"가 보이면 안됩니다$/ do |text|
|
100
|
+
Then %{I should not see "#{text}"}
|
101
|
+
end
|
102
|
+
|
103
|
+
그러면 /^"([^"]*)"안에 "([^"]*)"가 보이면 안됩니다$/ do |selector, text|
|
104
|
+
Then %{I should not see "#{text}" within "#{selector}"}
|
105
|
+
end
|
106
|
+
|
107
|
+
그러면 /^\/([^\/]*)\/가 보이면 안됩니다$/ do |regexp|
|
108
|
+
Then %{I should not see /#{regexp}/}
|
109
|
+
end
|
110
|
+
|
111
|
+
그러면 /^"([^"]*)"안에 \/([^\/]*)\/가 보이면 안됩니다$/ do |selector, regexp|
|
112
|
+
Then %{I should not see /#{regexp}/ within "#{selector}"}
|
113
|
+
end
|
114
|
+
|
115
|
+
그러면 /^"([^"]*)"는 "([^"]*)"이어야 합니다$/ do |field, value|
|
116
|
+
Then %{the "#{field}" field should contain "#{value}"}
|
117
|
+
end
|
118
|
+
|
119
|
+
그러면 /^"([^"]*)"는 "([^"]*)"이면 안됩니다$/ do |field, value|
|
120
|
+
Then %{the "#{field}" field should not contain "#{value}"}
|
121
|
+
end
|
122
|
+
|
123
|
+
그러면 /^"([^"]*)"는 체크되어 있어야 합니다$/ do |label|
|
124
|
+
Then %{the "#{label}" checkbox should be checked}
|
125
|
+
end
|
126
|
+
|
127
|
+
그러면 /^"([^"]*)"는 체크되어 있으면 안됩니다$/ do |label|
|
128
|
+
Then %{the "#{label}" checkbox should not be checked}
|
129
|
+
end
|
130
|
+
|
131
|
+
그러면 /^(.+)에 있어야 합니다$/ do |page_name|
|
132
|
+
Then %{I should be on #{page_name}}
|
133
|
+
end
|
134
|
+
|
135
|
+
그러면 /^다음 쿼리들이 나와야합니다:$/ do |expected_pairs|
|
136
|
+
Then %{I should have the following query string:}
|
137
|
+
end
|
138
|
+
|
139
|
+
그러면 /^페이지를 엽니다$/ do
|
140
|
+
Then %{show me the page}
|
141
|
+
end
|
142
|
+
|
@@ -0,0 +1,105 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
<%= embed_file('support/web_steps_warning.txt') %>
|
3
|
+
|
4
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
|
5
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "selectors"))
|
6
|
+
|
7
|
+
# Single-line step scoper
|
8
|
+
Når /^(.*) under ([^:]+)$/ do |step, parent|
|
9
|
+
with_scope(parent) { Når step }
|
10
|
+
end
|
11
|
+
|
12
|
+
# Multi-line step scoper
|
13
|
+
Når /^(.*) under ([^:]+):$/ do |step, parent, table_or_string|
|
14
|
+
with_scope(parent) { Når "#{step}:", table_or_string }
|
15
|
+
end
|
16
|
+
|
17
|
+
Gitt /^(?:|at )jeg står på (.*)$/ do |page_name|
|
18
|
+
Given %{I am on #{page_name}}
|
19
|
+
end
|
20
|
+
|
21
|
+
Når /^jeg går til (.*)$/ do |page_name|
|
22
|
+
When %{I go to #{page_name}}
|
23
|
+
end
|
24
|
+
|
25
|
+
Når /^jeg trykker "([^"]*)"$/ do |button|
|
26
|
+
When %{I press "#{button}"}
|
27
|
+
end
|
28
|
+
|
29
|
+
Når /^jeg klikker "([^"]*)"$/ do |link|
|
30
|
+
When %{I follow "#{link}"}
|
31
|
+
end
|
32
|
+
|
33
|
+
Når /^jeg fyller inn "([^"]*)" med "([^"]*)"$/ do |field, value|
|
34
|
+
When %{I fill in "#{field}" with "#{value}"}
|
35
|
+
end
|
36
|
+
|
37
|
+
Når /^jeg fyller inn "([^"]*)" for "([^"]*)"$/ do |value, field|
|
38
|
+
When %{I fill in "#{value}" for "#{field}"}
|
39
|
+
end
|
40
|
+
|
41
|
+
Når /^jeg fyller inn følgende:$/ do |fields|
|
42
|
+
When %{I fill in the following:}, fields
|
43
|
+
end
|
44
|
+
|
45
|
+
Når /^jeg velger "([^"]*)" fra "([^"]*)"$/ do |value, field|
|
46
|
+
When %{I select "#{value}" from "#{field}"}
|
47
|
+
end
|
48
|
+
|
49
|
+
# Missing: date stuff
|
50
|
+
|
51
|
+
Når /^jeg krysser av "([^"]*)"$/ do |field|
|
52
|
+
When %{I check "#{field}"}
|
53
|
+
end
|
54
|
+
|
55
|
+
Når /^jeg fjerner avkrysning for "([^"]*)"$/ do |field|
|
56
|
+
When %{I uncheck "#{field}"}
|
57
|
+
end
|
58
|
+
|
59
|
+
Når /^jeg velger "([^"]*)"$/ do |field|
|
60
|
+
When %{I choose "#{field}"}
|
61
|
+
end
|
62
|
+
|
63
|
+
Når /^jeg legger ved filen "([^"]*)" til "([^"]*)"$/ do |path, field|
|
64
|
+
When %{I attach the file "#{path}" to "#{field}"}
|
65
|
+
end
|
66
|
+
|
67
|
+
Så /^(?:skal jeg|jeg skal) se "([^"]*)"$/ do |text|
|
68
|
+
Then %{I should see "#{text}"}
|
69
|
+
end
|
70
|
+
|
71
|
+
Så /^(?:skal jeg|jeg skal) se \/([^\/]*)\/$/ do |regexp|
|
72
|
+
Then %{I should see /#{regexp}/}
|
73
|
+
end
|
74
|
+
|
75
|
+
Så /^(?:skal jeg|jeg skal) ikke se "([^"]*)"$/ do |text|
|
76
|
+
Then %{I should not see "#{text}"}
|
77
|
+
end
|
78
|
+
|
79
|
+
Så /^(?:skal jeg|jeg skal) ikke se \/([^\/]*)\/$/ do |regexp|
|
80
|
+
Then %{I should not see /#{regexp}/}
|
81
|
+
end
|
82
|
+
|
83
|
+
Så /^(?:skal )"([^"]*)" feltet (?:skal )inneholde "([^"]*)"$/ do |field, value|
|
84
|
+
Then %{the "#{field}" field should contain "#{value}"}
|
85
|
+
end
|
86
|
+
|
87
|
+
Så /^(?:skal ) "([^"]*)" feltet (?:skal )ikke inneholde "([^"]*)"$/ do |field, value|
|
88
|
+
Then %{the "#{field}" field should not contain "#{value}"}
|
89
|
+
end
|
90
|
+
|
91
|
+
Så /^(?:skal ) "([^"]*)" avkrysningsboksen (?:skal )være krysset av$/ do |label|
|
92
|
+
Then %{the "#{label}" checkbox should be checked}
|
93
|
+
end
|
94
|
+
|
95
|
+
Så /^(?:skal ) "([^"]*)" avkrysningsboksen (?:skal )ikke være krysset av$/ do |label|
|
96
|
+
Then %{the "#{label}" checkbox should not be checked}
|
97
|
+
end
|
98
|
+
|
99
|
+
Så /^(?:skal jeg|jeg skal) komme til (.+)$/ do |page_name|
|
100
|
+
Then %{I should be on #{page_name}}
|
101
|
+
end
|
102
|
+
|
103
|
+
Så /^vil jeg se siden$/ do |page_name|
|
104
|
+
Then %{show me the page}
|
105
|
+
end
|