discourse-ai/spec/system/page_objects/pages/user_preferences_ai.rb

33 lines
724 B
Ruby
Raw Normal View History

2024-05-27 13:49:24 -04:00
# frozen_string_literal: true
module PageObjects
module Pages
class UserPreferencesAi < PageObjects::Pages::Base
def visit(user)
page.visit("/u/#{user.username}/preferences/ai")
self
end
def has_ai_preference_checked?(preference)
page.find(".#{preference} input").checked?
end
def has_ai_preference?(preference)
page.has_css?(".#{preference} input")
end
def has_no_ai_preference?(preference)
page.has_no_css?(".#{preference} input")
end
2024-05-27 13:49:24 -04:00
def toggle_setting(preference)
page.find(".#{preference} input").click
end
def save_changes
page.find(".save-changes").click
end
end
end
end