mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
DEV: Add system test for user security keys (#23372)
This commit is contained in:
@ -15,6 +15,25 @@ module PageObjects
|
||||
self
|
||||
end
|
||||
|
||||
def click_profile_tab
|
||||
click_link("user-menu-button-profile")
|
||||
has_css?("#quick-access-profile")
|
||||
self
|
||||
end
|
||||
|
||||
def click_logout_button
|
||||
find("#quick-access-profile .logout .btn").click
|
||||
has_css?(".d-header .login-button")
|
||||
self
|
||||
end
|
||||
|
||||
def sign_out
|
||||
open
|
||||
click_profile_tab
|
||||
click_logout_button
|
||||
self
|
||||
end
|
||||
|
||||
def has_group_mentioned_notification?(topic, user_that_mentioned_group, group_mentioned)
|
||||
expect(find("#quick-access-replies .group-mentioned").text).to eq(
|
||||
"#{user_that_mentioned_group.username} @#{group_mentioned.name} #{topic.title}",
|
||||
|
19
spec/system/page_objects/pages/user_preferences_security.rb
Normal file
19
spec/system/page_objects/pages/user_preferences_security.rb
Normal file
@ -0,0 +1,19 @@
|
||||
# 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_link(class: "btn-second-factor")
|
||||
|
||||
find(".second-factor input#password").fill_in(with: password)
|
||||
find(".second-factor .btn-primary").click
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user