mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-04 23:30:21 +08:00
This particular system test is taking a long time (~20 seconds) on CI because it is doing many full page loads. This commit refactors the test to be more efficient about the number of full page loads triggered by the tests thus reducing the runtime by half. Co-authored-by: Krzysztof Kotlarek <kotlarek.krzysztof@gmail.com>
35 lines
887 B
Ruby
35 lines
887 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Pages
|
|
class AdminFlagForm < PageObjects::Pages::Base
|
|
def fill_in_name(name)
|
|
form.field("name").fill_in(name)
|
|
self
|
|
end
|
|
|
|
def fill_in_description(description)
|
|
form.field("description").fill_in(description)
|
|
self
|
|
end
|
|
|
|
def select_applies_to(applies_to)
|
|
dropdown = PageObjects::Components::SelectKit.new(".admin-flag-form__applies-to")
|
|
dropdown.expand
|
|
dropdown.select_row_by_value(applies_to)
|
|
dropdown.collapse
|
|
self
|
|
end
|
|
|
|
def click_save
|
|
form.submit
|
|
expect(page).to have_no_css(".admin-config.flags.new")
|
|
expect(page).to have_css(".admin-flag-item__name")
|
|
end
|
|
|
|
def form
|
|
@form ||= PageObjects::Components::FormKit.new(".admin-flag-form .form-kit")
|
|
end
|
|
end
|
|
end
|
|
end
|