discourse/spec/system/page_objects/modals/base.rb
Martin Brennan 641e94fc3c
FEATURE: Allow changing slug on create channel (#19928)
This commit allows us to set the channel slug when creating new chat
channels. As well as this, it introduces a new `SlugsController` which can
generate a slug using `Slug.for` and a name string for input. We call this
after the user finishes typing the channel name (debounced) and fill in
the autogenerated slug in the background, and update the slug input
placeholder.

This autogenerated slug is used by default, but if the user writes anything
else in the input it will be used instead.
2023-01-23 14:48:33 +10:00

27 lines
468 B
Ruby

# frozen_string_literal: true
module PageObjects
module Modals
class Base
include Capybara::DSL
include RSpec::Matchers
def close
find(".modal-close").click
end
def cancel
find(".d-modal-cancel").click
end
def click_outside
find(".modal-outer-container").click(x: 0, y: 0)
end
def click_primary_button
find(".modal-footer .btn-primary").click
end
end
end
end