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
This commit is contained in:
jdlrobson 2017-08-01 11:47:07 -07:00
parent 8803101c52
commit ebef44d0fe
1 changed files with 6 additions and 1 deletions

View File

@ -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|