diff --git a/tests/browser/features/step_definitions/common_article_steps.rb b/tests/browser/features/step_definitions/common_article_steps.rb index c16a05d..453bc8a 100644 --- a/tests/browser/features/step_definitions/common_article_steps.rb +++ b/tests/browser/features/step_definitions/common_article_steps.rb @@ -34,7 +34,12 @@ end Then(/^I should see a toast with message "(.+)"$/) do |msg| step "I should see a toast notification" - expect(on(ArticlePage).toast_element.when_present.text).to match msg + on(ArticlePage) do |page| + page.wait_until do + page.toast_element.when_present.text.include? msg + end + expect(page.toast_element.when_present.text).to match msg + end end Then /^I should see a drawer with message "(.+)"$/ do |text|