Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "Delete Account" scenario failing in Oracle #3036

Merged
merged 1 commit into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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