2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2018-12-19 14:47:15 +00:00
|
|
|
# This file defines custom Capybara selectors for DRYed specs.
|
|
|
|
|
|
|
|
Capybara.add_selector(:href) do
|
|
|
|
css { |href| %(a[href="#{href}"]) }
|
|
|
|
end
|
|
|
|
|
|
|
|
Capybara.add_selector(:active_content) do
|
|
|
|
css { |content_class| ['.content.active', content_class].compact.join(' ') }
|
|
|
|
end
|
|
|
|
|
2020-04-13 18:24:03 +00:00
|
|
|
Capybara.add_selector(:active_ticket_article) do
|
|
|
|
css { |article| ['.content.active', "#article-#{article.id}" ].compact.join(' ') }
|
|
|
|
end
|
|
|
|
|
2018-12-19 14:47:15 +00:00
|
|
|
Capybara.add_selector(:manage) do
|
|
|
|
css { 'a[href="#manage"]' }
|
|
|
|
end
|
|
|
|
|
|
|
|
Capybara.add_selector(:clues_close) do
|
|
|
|
css { '.js-modal--clue .js-close' }
|
|
|
|
end
|
|
|
|
|
|
|
|
Capybara.add_selector(:richtext) do
|
2019-07-03 16:14:28 +00:00
|
|
|
css { |name| "div[data-name=#{name || 'body'}]" }
|
2018-12-19 14:47:15 +00:00
|
|
|
end
|
2019-08-07 12:55:54 +00:00
|
|
|
|
|
|
|
Capybara.add_selector(:text_module) do
|
|
|
|
css { |id| %(.shortcut > ul > li[data-id="#{id}"]) }
|
|
|
|
end
|
2019-09-04 07:42:50 +00:00
|
|
|
|
|
|
|
Capybara.add_selector(:macro) do
|
|
|
|
css { |id| %(.js-submitDropdown > ul > li[data-id="#{id}"]) }
|
|
|
|
end
|
|
|
|
|
|
|
|
Capybara.add_selector(:macro_batch) do
|
2020-12-08 09:17:21 +00:00
|
|
|
css { |id| %(.batch-overlay-macro-entry[data-id='#{id}'] .batch-overlay-macro-entry-name) }
|
2019-09-04 07:42:50 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
Capybara.add_selector(:table_row) do
|
|
|
|
css { |id| %(tr[data-id='#{id}']) }
|
|
|
|
end
|
2019-09-18 17:25:04 +00:00
|
|
|
|
|
|
|
Capybara.add_selector(:link_containing) do
|
|
|
|
xpath { |text| ".//a//*[text()[contains(.,\"#{text}\")]]" }
|
|
|
|
end
|
2021-05-17 15:12:45 +00:00
|
|
|
|
|
|
|
Capybara.add_selector(:task_active) do
|
|
|
|
css { '.tasks .task.is-active' }
|
|
|
|
end
|
|
|
|
|
|
|
|
Capybara.add_selector(:task_with) do
|
|
|
|
css { |task_key| ".tasks .task[data-key='#{task_key}']" }
|
|
|
|
end
|
2022-02-24 11:33:52 +00:00
|
|
|
|
|
|
|
Capybara.add_selector(:draft_sidebar_button) do
|
|
|
|
css { '.tabsSidebar-tab[data-tab=shared_draft]' }
|
|
|
|
end
|
|
|
|
|
|
|
|
Capybara.add_selector(:draft_sidebar) do
|
|
|
|
css { '.shared-drafts-manage' }
|
|
|
|
end
|
|
|
|
|
|
|
|
Capybara.add_selector(:draft_share_button) do
|
|
|
|
css { '.attributeBar-draft' }
|
|
|
|
end
|
|
|
|
|
|
|
|
Capybara.add_selector(:draft_save_button) do
|
|
|
|
css { '.js-dropdownActionSaveDraft' }
|
|
|
|
end
|