mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-27 10:28:24 +08:00
This commit updates `PageObjects::Pages::Automation#update` to check that the button is not disabled before clicking the button. ### Reviewer notes Instances of flakiness: 1. https://github.com/discourse/discourse/actions/runs/13864294630/job/38801362996 2. https://github.com/discourse/discourse/actions/runs/13392214535/job/37402368070
41 lines
932 B
Ruby
Vendored
41 lines
932 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Pages
|
|
class Automation < PageObjects::Pages::Base
|
|
def visit(automation)
|
|
super("/admin/plugins/automation/automation/#{automation.id}")
|
|
self
|
|
end
|
|
|
|
def set_name(name)
|
|
form.find('input[name="automation-name"]').set(name)
|
|
self
|
|
end
|
|
|
|
def has_error?(message)
|
|
form.has_content?(message)
|
|
end
|
|
|
|
def has_name?(name)
|
|
form.find_field("automation-name", with: name)
|
|
end
|
|
|
|
def set_triggerables(triggerable)
|
|
select_kit = PageObjects::Components::SelectKit.new(".triggerables")
|
|
select_kit.expand
|
|
select_kit.select_row_by_value(triggerable)
|
|
self
|
|
end
|
|
|
|
def update
|
|
form.find(".update-automation:not([disabled])").click
|
|
self
|
|
end
|
|
|
|
def form
|
|
@form ||= find(".discourse-automation-edit")
|
|
end
|
|
end
|
|
end
|
|
end
|