discourse/spec/system/page_objects/pages/admin_new_features.rb
Krzysztof Kotlarek 433fadbd52
FEATURE: allow admins to enable announced experimental features (#29244)
Toggle the button to enable the experimental site setting from "What's new" announcement.

The toggle button is displayed when:
- site setting exists and is boolean;
- potentially required plugin is enabled.
2024-10-22 10:56:58 +11:00

47 lines
1.1 KiB
Ruby

# frozen_string_literal: true
module PageObjects
module Pages
class AdminNewFeatures < PageObjects::Pages::Base
def visit
page.visit("/admin/whats-new")
self
end
def has_screenshot?
page.has_css?(".admin-new-feature-item__screenshot")
end
def has_no_screenshot?
page.has_no_css?(".admin-new-feature-item__screenshot")
end
def has_toggle_experiment_button?
page.has_css?(".admin-new-feature-item__feature-toggle")
end
def has_learn_more_link?
page.has_css?(".admin-new-feature-item__learn-more")
end
def has_emoji?
page.has_css?(".admin-new-feature-item__new-feature-emoji")
end
def has_no_emoji?
page.has_no_css?(".admin-new-feature-item__new-feature-emoji")
end
def has_version?(version)
element = find(".admin-new-feature-item__new-feature-version")
element.has_text?(version)
end
def has_date?(date)
element = find(".admin-config-area-card__title")
element.has_text?(date)
end
end
end
end