Skip to content

Commit

Permalink
Merge pull request #3036 from 3scale/THREESCALE-8549_oracle_delete_ac…
Browse files Browse the repository at this point in the history
…count

Fix "Delete Account" scenario failing in Oracle
  • Loading branch information
josemigallas committed Aug 9, 2022
2 parents a0b7bb9 + 67dacc1 commit 4758771
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
20 changes: 19 additions & 1 deletion features/step_definitions/flash_steps.rb
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
2 changes: 1 addition & 1 deletion features/step_definitions/plans_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def delete_plan_from_table_action(plan)
accept_confirm do
find_action_for_plan(/delete/i, plan).click
end
assert has_content?('The plan was deleted')
assert_flash 'The plan was deleted'
assert_not has_content?(plan.name) # TODO: assert table row not whole content
end

Expand Down

0 comments on commit 4758771

Please sign in to comment.