mirror of
https://github.com/discourse/discourse.git
synced 2024-12-11 17:23:42 +08:00
9392bd0f79
The fix use the SelectKit component in the spec and improves reliability of SelectKit component to ensure expanded/collapsed state effectively set/present. Multiple lines have also been removed as they are not necessary, eg: - check button is present - click button The check is un-necesssary as we won't find the button on click if not present. This kind of checks are only necessary when another element has to be present before the button is show, eg: - check modal is displayed - click button FInally this commit changes the way the SelectKit component initializes component and now uses a css selector instead of a finder, it ensures we are always getting fresh object and allows to build complete selectors: ".context[data-id=1].foo:enabled"
24 lines
547 B
Ruby
24 lines
547 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Pages
|
|
class Discovery < PageObjects::Pages::Base
|
|
def topic_list
|
|
Components::TopicList.new
|
|
end
|
|
|
|
def category_drop
|
|
Components::SelectKit.new(".category-breadcrumb li:first-of-type .category-drop")
|
|
end
|
|
|
|
def subcategory_drop
|
|
Components::SelectKit.new(".category-breadcrumb li:nth-of-type(2) .category-drop")
|
|
end
|
|
|
|
def tag_drop
|
|
Components::SelectKit.new(".category-breadcrumb .tag-drop")
|
|
end
|
|
end
|
|
end
|
|
end
|