From ebef44d0fec3622fdde1e35464b19c2e1477bd35 Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Tue, 1 Aug 2017 11:47:07 -0700 Subject: [PATCH] QA: Make sure toast is not empty before checking text value Copies approach for the text of the first heading should be accounting for the fact that the toast can have an empty message "" at any given time. Bug: T170890 Change-Id: Iba8a503a2aea30cb46fba27f000843183e9c46f1 --- .../features/step_definitions/common_article_steps.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/browser/features/step_definitions/common_article_steps.rb b/tests/browser/features/step_definitions/common_article_steps.rb index c16a05def..453bc8a23 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|