mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 23:48:44 +08:00
DEV: Fix flaky user preferences interface system test (#21800)
Why is this change required? The flaky system test was due to the fact that we had to poll for the user preferences interface page to reload after saving. However, this turns out to be a bug on the user perferences interface page because the page should only reload if the user has selected a new theme that is different from the site's default but we were reloading the page for users that did not have any user theme selected. Therefore there was an unnecessary reload happening when saving other fields on the user preferences interface page.
This commit is contained in:

committed by
GitHub

parent
123a77a2bc
commit
7d9a823a55
30
spec/system/page_objects/pages/user_preferences_interface.rb
Normal file
30
spec/system/page_objects/pages/user_preferences_interface.rb
Normal file
@ -0,0 +1,30 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module PageObjects
|
||||
module Pages
|
||||
class UserPreferencesInterface < PageObjects::Pages::Base
|
||||
def visit(user)
|
||||
page.visit("/u/#{user.username}/preferences/interface")
|
||||
self
|
||||
end
|
||||
|
||||
def has_bookmark_after_notification_mode?(value)
|
||||
page.has_css?(
|
||||
"#bookmark-after-notification-mode .select-kit-header[data-value=\"#{value}\"]",
|
||||
)
|
||||
end
|
||||
|
||||
def select_bookmark_after_notification_mode(value)
|
||||
page.find("#bookmark-after-notification-mode").click
|
||||
page.find(".select-kit-row[data-value=\"#{value}\"]").click
|
||||
self
|
||||
end
|
||||
|
||||
def save_changes
|
||||
click_button "Save Changes"
|
||||
expect(page).to have_content(I18n.t("js.saved"))
|
||||
self
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user