Seleniumで動作するこのキュウリのステップ定義がありますが、ポルターガイストドライバーNotImplementedError
で試してみると得られます。
phantom.js がインストールされ、適切に見えるステップ定義からスクリーンショットを撮ることさえできます。Ember.js/Rails アプリケーションをテストしています。ページに正しくアクセスすることを確認しますが、リンクを見つけようとすると失敗します。
When(/^I visit the App$/) do
visit("/")
end
Then(/^I should see link "(.*?)"$/) do |arg1|
find_link(arg1)
end
When(/^I click "(.*?)"$/) do |arg1|
find_link(arg1).click
end
When(/^I fill in "(.*?)" with "(.*?)"$/) do |arg1, arg2|
fill_in arg1, :with => arg2
end
When(/^I click "(.*?)" button$/) do |arg1|
find_button(arg1).click
end
正確なエラーは次のとおりです。
When I visit the App # features/step_definitions/sign_in_steps.rb:1
Then I should see link "Sign Up" # features/step_definitions/sign_in_steps.rb:5
NotImplementedError (NotImplementedError)
./features/step_definitions/sign_in_steps.rb:6:in `/^I should see link "(.*?)"$/'
features/sign_in.feature:9:in `Then I should see link "Sign Up"'