discourse/spec/system/page_objects/pages/user_preferences_security.rb
Penar Musaraj a1c1f7ce75
DEV: Standardize session confirmation prompt (#24212)
Switches to using a dialog to confirm a session (i.e. sudo mode for
account changes where we want to be extra sure the current user is who
they say they are) to match what we do with passkeys.
2023-11-07 11:26:10 -05:00

20 lines
476 B
Ruby

# frozen_string_literal: true
module PageObjects
module Pages
class UserPreferencesSecurity < PageObjects::Pages::Base
def visit(user)
page.visit("/u/#{user.username}/preferences/security")
self
end
def visit_second_factor(password)
click_button "Manage Two-Factor Authentication"
find(".dialog-body input#password").fill_in(with: password)
find(".dialog-body .btn-primary").click
end
end
end
end