Skip to content

Commit

Permalink
Try to fix some flaky tests by ensuring notifications are removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
GUI committed Mar 3, 2024
1 parent f8f74a3 commit 78638b4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/admin_ui/login/test_local_provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ def test_update_my_account_with_password
fill_in "Confirm New Password", :with => "password234567"
click_button "Save"
assert_text("Successfully saved the admin")
page.execute_script("window.PNotifyRemoveAll()")
@admin.reload
assert(@admin.password_hash)
refute_equal(original_password_hash, @admin.password_hash)
Expand Down
1 change: 1 addition & 0 deletions test/admin_ui/test_api_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def test_form

click_button("Save")
assert_text("Successfully saved")
page.execute_script("window.PNotifyRemoveAll()")

user = ApiUser.order(:created_at => :desc).first
visit "/admin/#/api_users/#{user.id}/edit"
Expand Down
3 changes: 3 additions & 0 deletions test/admin_ui/test_apis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def test_form

click_button("Save")
assert_text("Successfully saved")
page.execute_script("window.PNotifyRemoveAll()")

api = ApiBackend.order(:created_at => :desc).first
visit "/admin/#/apis/#{api.id}/edit"
Expand Down Expand Up @@ -378,6 +379,7 @@ def test_nested_select_menu_behavior_inside_modals
# Save the API.
click_button("Save")
assert_text("Successfully saved")
page.execute_script("window.PNotifyRemoveAll()")

# Edit again.
click_link api.name
Expand Down Expand Up @@ -410,6 +412,7 @@ def test_nested_select_menu_behavior_inside_modals
# Save the API.
click_button("Save")
assert_text("Successfully saved")
page.execute_script("window.PNotifyRemoveAll()")

# Edit again.
click_link api.name
Expand Down
1 change: 1 addition & 0 deletions test/admin_ui/test_config_publish_submit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def test_publishing_changes
visit "/admin/#/config/publish"
click_button("Publish")
assert_text("Successfully published the configuration")
page.execute_script("window.PNotifyRemoveAll()")

assert_text("Published configuration is up to date")
active_config = PublishedConfig.active_config
Expand Down
1 change: 1 addition & 0 deletions test/admin_ui/test_roles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def test_share_roles_between_users_and_apis_forms
click_button("Save")

assert_text("Successfully saved the user")
page.execute_script("window.PNotifyRemoveAll()")

user = ApiUser.find_by!(:email => "#{unique_test_id}@example.com")
assert_equal(["test-new-user-role"], user.roles)
Expand Down

0 comments on commit 78638b4

Please sign in to comment.