DEV: Add system test for user security keys (#23372)

This commit is contained in:
Penar Musaraj
2023-09-03 22:07:20 -04:00
committed by GitHub
parent d108762c94
commit 0a3f1852c6
8 changed files with 88 additions and 6 deletions

View File

@ -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}",

View 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