DEV: Add more page objects (#18972)
This commit is contained in:
parent
66130dc8c1
commit
09b7433167
|
@ -43,6 +43,7 @@ export default Mixin.create({
|
|||
validationMessage: null,
|
||||
isSecret: oneWay("setting.secret"),
|
||||
setting: null,
|
||||
attributeBindings: ["setting.setting:data-setting"],
|
||||
|
||||
@discourseComputed("buffered.value", "setting.value")
|
||||
dirty(bufferVal, settingVal) {
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module PageObjects
|
||||
module Pages
|
||||
class AdminSettings < PageObjects::Pages::Base
|
||||
def visit_filtered_plugin_setting(filter)
|
||||
visit("/admin/site_settings/category/plugins?filter=#{filter}")
|
||||
self
|
||||
end
|
||||
|
||||
def toggle_setting(setting_name, text = '')
|
||||
setting = find(".admin-detail .row.setting[data-setting='#{setting_name}']")
|
||||
setting.find('.setting-value span', text: text).click
|
||||
setting.find('.setting-controls button.ok').click
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -6,12 +6,12 @@ module PageObjects
|
|||
# keeping the various category related features combined for now
|
||||
|
||||
def visit(category)
|
||||
Capybara.current_session.visit("/c/#{category.id}")
|
||||
page.visit("/c/#{category.id}")
|
||||
self
|
||||
end
|
||||
|
||||
def visit_settings(category)
|
||||
Capybara.current_session.visit("/c/#{category.slug}/edit/settings")
|
||||
page.visit("/c/#{category.slug}/edit/settings")
|
||||
self
|
||||
end
|
||||
|
||||
|
@ -25,8 +25,8 @@ module PageObjects
|
|||
self
|
||||
end
|
||||
|
||||
def toggle_setting(text)
|
||||
find('.edit-category-tab label.checkbox-label', text: text).click
|
||||
def toggle_setting(setting, text = '')
|
||||
find(".edit-category-tab .#{setting} label.checkbox-label", text: text).click
|
||||
self
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module PageObjects
|
||||
module Pages
|
||||
class User < PageObjects::Pages::Base
|
||||
def find(selector)
|
||||
page.find(".user-content-wrapper #{selector}")
|
||||
end
|
||||
|
||||
def active_user_primary_navigation
|
||||
find(".user-primary-navigation li a.active")
|
||||
end
|
||||
|
||||
def active_user_secondary_navigation
|
||||
find(".user-secondary-navigation li a.active")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue