discourse/spec/system/page_objects/components/admin_onboarding_banner.rb
Gabriel Grubba cba702c88f
FEATURE: Add "Use Predefined Topics" modal to admin onboarding banner (#37826)
Continuing the work from
https://github.com/discourse/discourse/pull/37583 we are adding a few
options to our users to start creating content and topics in their new
community

This makes the predefined topics usage clearer and not random, and this
also adds a way for plugins to hook into the admin onboarding
experience, using the "admin-onboarding-start-posting-options` behavior
object and `StartPostingOption` class

When we have a plugin hooked up to this, it shows the option picker; if
not, it goes directly to predefined options:

Default behavior:



https://github.com/user-attachments/assets/d8e3eaf7-dc36-4f1e-b9e2-5bb12f353e88


with 1+ options:


https://github.com/user-attachments/assets/c05be6b0-4ff8-477b-9a9d-f755846730b5

---------

Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
2026-02-25 13:55:18 -03:00

39 lines
871 B
Ruby

# frozen_string_literal: true
module PageObjects
module Components
class AdminOnboardingBanner < PageObjects::Components::Base
def visible?
has_css?(".admin-onboarding-banner")
end
def not_visible?
has_no_css?(".admin-onboarding-banner")
end
def close
find(".admin-onboarding-banner .btn-close").click
end
def step(step_id)
find("div##{step_id}")
end
def step_checkbox(step_id)
find("div##{step_id} .onboarding-step__checkbox > svg")
end
def step_completed?(step_id)
step_checkbox(step_id)[:class].include?("checked")
end
def step_not_completed?(step_id)
!step_completed?(step_id)
end
def click_step_action(step_id)
find("div##{step_id} .onboarding-step__action .btn").click
end
end
end
end