Commit 7643a872 authored by Sanad Liaquat's avatar Sanad Liaquat

Created some more qa elements

parent ffb17a3b
......@@ -12,7 +12,7 @@
.row
.form-group.col-md-6
= f.label :name, class: 'label-bold'
= f.text_field :name, class: "form-control", required: true
= f.text_field :name, class: "form-control qa-personal-access-token-name-field", required: true
.row
.form-group.col-md-6
......@@ -26,4 +26,4 @@
= render 'shared/tokens/scopes_form', prefix: 'personal_access_token', token: token, scopes: scopes
.prepend-top-default
= f.submit "Create #{type} token", class: "btn btn-success"
= f.submit "Create #{type} token", class: "btn btn-success qa-create-token-button"
......@@ -4,6 +4,6 @@
- scopes.each do |scope|
%fieldset.form-group.form-check
= check_box_tag "#{prefix}[scopes][]", scope, token.scopes.include?(scope), id: "#{prefix}_scopes_#{scope}", class: 'form-check-input'
= check_box_tag "#{prefix}[scopes][]", scope, token.scopes.include?(scope), id: "#{prefix}_scopes_#{scope}", class: "form-check-input qa-#{scope}-radio"
= label_tag ("#{prefix}_scopes_#{scope}"), scope, class: 'label-bold form-check-label'
.text-secondary= t scope, scope: [:doorkeeper, :scope_desc]
......@@ -3,9 +3,12 @@ module QA
module Profile
class PersonalAccessTokens < Page::Base
view 'app/views/shared/_personal_access_tokens_form.html.haml' do
element :personal_access_token_name_field, 'text_field :name' # rubocop:disable QA/ElementWithPattern
element :create_token_button, 'submit "Create #{type} token"' # rubocop:disable QA/ElementWithPattern, Lint/InterpolationCheck
element :scopes_api_radios, "label :scopes" # rubocop:disable QA/ElementWithPattern
element :personal_access_token_name_field
element :create_token_button
end
view 'app/views/shared/tokens/_scopes_form.html.haml' do
element :api_radio, 'qa-#{scope}-radio' # rubocop:disable QA/ElementWithPattern, Lint/InterpolationCheck
end
view 'app/views/shared/_personal_access_tokens_created_container.html.haml' do
......@@ -16,15 +19,15 @@ module QA
end
def fill_token_name(name)
fill_in 'personal_access_token_name', with: name
fill_element(:personal_access_token_name_field, name)
end
def check_api
check 'personal_access_token_scopes_api'
check_element(:api_radio)
end
def create_token
click_on 'Create personal access token'
click_element(:create_token_button)
end
def created_access_token
......
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