-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3036 from 3scale/THREESCALE-8549_oracle_delete_ac…
…count Fix "Delete Account" scenario failing in Oracle
- Loading branch information
Showing
2 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
Then /^I should see the flash message "([^"]*)"$/ do |flash_text| | ||
find(:xpath, "//div[@id='flash-messages'] | //div[@id='flashWrapper']").text.should have_content(flash_text) | ||
assert_flash flash_text | ||
end | ||
|
||
def assert_flash(message) | ||
# Sometimes the flash hides before the a test asserts it and fails. Therefore, we target that the flash element | ||
# is rendered with the proper message, regardless of visibility. | ||
|
||
# For admin portal see app/views/shared/provider/_flash.html.erb | ||
# For dev portal see lib/developer_portal/app/views/shared/_flash_message.html.erb | ||
# and app/assets/javascripts/flash-buyer.js | ||
|
||
if has_css?('#flashWrapper', visible: :all) | ||
assert has_css?('#flashWrapper span', visible: :all, text: message, wait: 10) || | ||
has_css?('#flashWrapper p', visible: :all, text: message, wait: 10), "No flash has been found" | ||
else | ||
assert has_css?('#flash-messages', text: message), "No flash has been found" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters