2022-11-10 08:00:12 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module PageObjects
|
|
|
|
module Pages
|
|
|
|
class Category < PageObjects::Pages::Base
|
|
|
|
# keeping the various category related features combined for now
|
|
|
|
|
|
|
|
def visit(category)
|
2022-11-11 04:44:40 -05:00
|
|
|
page.visit("/c/#{category.id}")
|
2022-11-10 08:00:12 -05:00
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def visit_settings(category)
|
2022-11-11 04:44:40 -05:00
|
|
|
page.visit("/c/#{category.slug}/edit/settings")
|
2022-11-10 08:00:12 -05:00
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def back_to_category
|
|
|
|
find(".edit-category-title-bar span", text: "Back to category").click
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def save_settings
|
|
|
|
find("#save-category").click
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
2022-11-11 04:44:40 -05:00
|
|
|
def toggle_setting(setting, text = "")
|
|
|
|
find(".edit-category-tab .#{setting} label.checkbox-label", text: text).click
|
2022-11-10 08:00:12 -05:00
|
|
|
self
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|