こんな感じ
# coding: utf-8
require'calabash-android/calabash_steps'
もし /^"(.*?)"ボタンを押す$/ do |text|
step %{I press the "#{text}" button}
end
ならば /^"(.*?)"と表示されていること$/ do |text|
step %{I should see "#{text}"}
end
こんなの
もし /^ログインIDに"(.*?)"と入力する$/ do|arg1|
pending # express the regexp above with the code you wish you had
end
もし /^パスワードに"(.*?)"と入力する$/ do |arg1|
pending # express the regexp above with the code you wish you had
end
これをstep_definitions/***_steps.rbにコピペする
16.
ステップの編集
もし /^ログインIDに"(.*?)"と入力する$/ do|loginId|
step %{I enter "#{loginId}" into "LoginId"}
end
・何をしているか?
contentDescriptionが”LoginId”のEditTextにログインIDを入力している
こんな感じでどんどんステップを書いていく。
ステップ用のコードはgithubに書いてあるからそ
れを参考に日本語で定義し直せばいい。
https://github.com/calabash/calabash-android/blob/master/ruby-gem/lib/calabash-android/
canned_steps.md