Commit 6a1a8247 authored by Rémy Coutable's avatar Rémy Coutable

Disable the QA/ElementWithPattern cop for EE-specific offenses

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent b4db4d7a
......@@ -6,12 +6,12 @@ module QA
module Nodes
class New < QA::Page::Base
view 'ee/app/views/admin/geo/nodes/_form.html.haml' do
element :node_url_field, 'text_field :url'
element :node_url_placeholder, "label :url, 'URL'"
element :node_url_field, 'text_field :url' # rubocop:disable QA/ElementWithPattern
element :node_url_placeholder, "label :url, 'URL'" # rubocop:disable QA/ElementWithPattern
end
view 'ee/app/views/admin/geo/nodes/new.html.haml' do
element :add_node_button, "submit 'Add Node'"
element :add_node_button, "submit 'Add Node'" # rubocop:disable QA/ElementWithPattern
end
def set_node_address(address)
......
......@@ -6,7 +6,7 @@ module QA
module Nodes
class Show < QA::Page::Base
view 'ee/app/views/admin/geo/nodes/index.html.haml' do
element :new_node_link, /link_to .*New node/
element :new_node_link, /link_to .*New node/ # rubocop:disable QA/ElementWithPattern
end
def new_node!
......
......@@ -4,19 +4,19 @@ module QA
module Admin
class License < QA::Page::Base
view 'ee/app/views/admin/licenses/missing.html.haml' do
element :missing_license, 'You do not have a license'
element :missing_license, 'You do not have a license' # rubocop:disable QA/ElementWithPattern
end
view 'ee/app/views/admin/licenses/show.html.haml' do
element :license_upload_link, "link_to 'Upload New License'"
element :license_upload_link, "link_to 'Upload New License'" # rubocop:disable QA/ElementWithPattern
end
view 'ee/app/views/admin/licenses/new.html.haml' do
element :license_type, 'radio_button_tag :license_type'
element :license_type_placeholder, 'Enter license key'
element :license_key_field, 'text_area :data'
element :license_key_placeholder, 'label :data, "License key"'
element :license_upload_buttonm, "submit 'Upload license'"
element :license_type, 'radio_button_tag :license_type' # rubocop:disable QA/ElementWithPattern
element :license_type_placeholder, 'Enter license key' # rubocop:disable QA/ElementWithPattern
element :license_key_field, 'text_area :data' # rubocop:disable QA/ElementWithPattern
element :license_key_placeholder, 'label :data, "License key"' # rubocop:disable QA/ElementWithPattern
element :license_upload_buttonm, "submit 'Upload license'" # rubocop:disable QA/ElementWithPattern
end
def no_license?
......
......@@ -4,7 +4,7 @@ module QA
module Main
class Banner < QA::Page::Base
view 'ee/app/helpers/ee/application_helper.rb' do
element :read_only_message, 'You are on a secondary, <b>read-only</b> Geo node.'
element :read_only_message, 'You are on a secondary, <b>read-only</b> Geo node.' # rubocop:disable QA/ElementWithPattern
end
def has_secondary_read_only_banner?
......
......@@ -6,7 +6,7 @@ module QA
def self.prepended(page)
page.module_eval do
view 'app/assets/javascripts/vue_merge_request_widget/components/states/sha_mismatch.vue' do
element :head_mismatch, "The source branch HEAD has recently changed."
element :head_mismatch, "The source branch HEAD has recently changed." # rubocop:disable QA/ElementWithPattern
end
end
end
......
......@@ -7,8 +7,8 @@ module QA
def self.prepended(page)
page.module_eval do
view 'app/views/shared/issuable/_search_bar.html.haml' do
element :issue_filter_form, /form_tag.+class: 'filter-form /
element :issue_filter_input, /%input.form-control.filtered-search/
element :issue_filter_form, /form_tag.+class: 'filter-form / # rubocop:disable QA/ElementWithPattern
element :issue_filter_input, /%input.form-control.filtered-search/ # rubocop:disable QA/ElementWithPattern
end
end
end
......
......@@ -93,7 +93,11 @@ The `element` DSL method in turn declares an element for which a corresponding
`qa-element-name-dasherized` CSS class need to be added to the view file.
You can also define a value (String or Regexp) to match to the actual view
code but **this is deprecated** in favor of the above method.
code but **this is deprecated** in favor of the above method for two reasons:
- Consistency: there is only one way to define an element
- Separation of concerns: QA uses dedicated CSS classes instead of reusing code
or classes used by other components (e.g. `js-*` classes etc.)
```ruby
view 'app/views/my/view.html.haml' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment