mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: flaky flags system spec (#29039)
Because of unreliability, the spec was temporarily disabled. However, it is ensuring that the custom flags system is working correctly. Therefore it would be great to enable it again. I made a few fixes to try to mitigate this situation: - Reduced amount of Redis calls; - When deleting, ensure that the modal is closed before checking the result; - Moved duplicated name tests to a separate block; - Increased wait time to 3 times the default because I noticed that sometimes it gets stuck for a moment. Most of the time it is fast, but sometimes when I run tests in a loop 50 times I see slowness.
This commit is contained in:
committed by
GitHub
parent
48c908c04d
commit
4ea3d69979
@@ -23,6 +23,11 @@ module PageObjects
|
||||
|
||||
def click_save
|
||||
form.submit
|
||||
expect(page).to have_no_css(
|
||||
".admin-config.flags.new",
|
||||
wait: Capybara.default_max_wait_time * 3,
|
||||
)
|
||||
expect(page).to have_css(".admin-flag-item__name", wait: Capybara.default_max_wait_time * 3)
|
||||
end
|
||||
|
||||
def form
|
||||
|
||||
@@ -60,7 +60,7 @@ module PageObjects
|
||||
end
|
||||
|
||||
def has_no_flag?(flag)
|
||||
has_no_css?(".admin-flag-item.#{flag}")
|
||||
has_no_css?(".admin-flag-item.#{flag}", wait: Capybara.default_max_wait_time * 3)
|
||||
end
|
||||
|
||||
def has_saved_flag?(key)
|
||||
@@ -103,6 +103,7 @@ module PageObjects
|
||||
|
||||
def confirm_delete
|
||||
find(".dialog-footer .btn-primary").click
|
||||
expect(page).to have_no_css(".dialog-body", wait: Capybara.default_max_wait_time * 3)
|
||||
self
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user