Commit e690fccb authored by Sanad Liaquat's avatar Sanad Liaquat Committed by Luke Bennett

Update project settings qa selectors

Additionally fixes geo rename test.
parent b7f76383
......@@ -20,7 +20,7 @@ document.addEventListener('DOMContentLoaded', () => {
dirtySubmitFactory(
document.querySelectorAll(
'.js-general-settings-form, .js-mr-settings-form, .js-add-approver-form',
'.js-general-settings-form, .js-mr-settings-form, .js-mr-approvals-form',
),
);
});
......@@ -6,14 +6,14 @@
%section.settings.general-settings.no-animate.expanded#js-general-settings
.settings-header
%h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only= _('Naming, topics, avatar')
%button.btn.js-settings-toggle{ type: 'button' }= _('Collapse')
%button.btn.btn-default.js-settings-toggle{ type: 'button' }= _('Collapse')
%p= _('Update your project name, topics, description and avatar.')
.settings-content= render 'projects/settings/general'
%section.settings.sharing-permissions.no-animate#js-shared-permissions{ class: ('expanded' if expanded) }
.settings-header
%h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only= _('Visibility, project features, permissions')
%button.btn.js-settings-toggle{ type: 'button' }= expanded ? _('Collapse') : _('Expand')
%button.btn.btn-default.js-settings-toggle{ type: 'button' }= expanded ? _('Collapse') : _('Expand')
%p= _('Choose visibility level, enable/disable project features (issues, repository, wiki, snippets) and set permissions.')
.settings-content
......@@ -26,7 +26,7 @@
%section.qa-merge-request-settings.settings.merge-requests-feature.no-animate#js-merge-request-settings{ class: [('expanded' if expanded), ('hidden' if @project.project_feature.send(:merge_requests_access_level) == 0)] }
.settings-header
%h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only= _('Merge requests')
%button.btn.js-settings-toggle{ type: 'button' }= expanded ? _('Collapse') : _('Expand')
%button.btn.btn-default.js-settings-toggle{ type: 'button' }= expanded ? _('Collapse') : _('Expand')
%p= _('Choose your merge method, set up a default merge request description template.')
.settings-content
......@@ -44,7 +44,7 @@
.settings-header
%h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only
= s_('ProjectSettings|Badges')
%button.btn.js-settings-toggle{ type: 'button' }
%button.btn.btn-default.js-settings-toggle{ type: 'button' }
= expanded ? _('Collapse') : _('Expand')
%p
= s_('ProjectSettings|Customize your project badges.')
......@@ -59,7 +59,7 @@
%section.qa-advanced-settings.settings.advanced-settings.no-animate#js-project-advanced-settings{ class: ('expanded' if expanded) }
.settings-header
%h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only= _('Advanced')
%button.btn.js-settings-toggle{ type: 'button' }= expanded ? _('Collapse') : _('Expand')
%button.btn.btn-default.js-settings-toggle{ type: 'button' }= expanded ? _('Collapse') : _('Expand')
%p= _('Housekeeping, export, path, transfer, remove, archive.')
.settings-content
......@@ -105,7 +105,7 @@
%li= _('You will need to update your local repositories to point to the new location.')
- if @project.deployment_platform.present?
%li= _('Your deployment services will be broken, you will need to manually fix the services after renaming.')
= f.submit _('Change path'), class: "btn btn-warning"
= f.submit _('Change path'), class: "btn btn-warning qa-change-path-button"
- if can?(current_user, :change_namespace, @project)
.sub-section
......
- if @project.feature_available?(:issuable_default_templates)
- expanded = Rails.env.test?
%section.settings.issues-feature.no-animate#js-issue-settings{ class: [('expanded' if expanded), ('hidden' if @project.project_feature.send(:issues_access_level) == 0)] }
.settings-header
%h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only= _('Default issue template')
%button.btn.js-settings-toggle= expanded ? _('Collapse') : _('Expand')
%p= _('Set a default template for issue descriptions.')
.settings-content
= form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "issue-settings-form" }, authenticity_token: true do |f|
%input{ type: 'hidden', name: 'update_section', value: 'js-issue-settings' }
.row
.form-group.col-md-9
= f.label :issues_template, class: 'label-bold' do
= _('Default description template for issues')
= link_to icon('question-circle'), help_page_path('user/project/description_templates', anchor: 'setting-a-default-template-for-issues-and-merge-requests'), target: '_blank'
= f.text_area :issues_template, class: "form-control", rows: 3
.text-secondary
- link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('user/markdown') }
= _('Description parsed with %{link_start}GitLab Flavored Markdown%{link_end}').html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
= f.submit _('Save changes'), class: "btn btn-success"
......@@ -7,7 +7,7 @@
.form-group.col-md-5
= f.label :name, class: 'label-bold', for: 'project_name_edit' do
= _('Project name')
= f.text_field :name, class: "form-control", id: "project_name_edit"
= f.text_field :name, class: 'form-control qa-project-name-field', id: "project_name_edit"
.form-group.col-md-7
= f.label :id, class: 'label-bold' do
......
This diff is collapsed.
......@@ -4,27 +4,21 @@ module QA
module Settings
class Advanced < Page::Base
view 'app/views/projects/edit.html.haml' do
element :project_path_field, 'text_field :path' # rubocop:disable QA/ElementWithPattern
element :project_name_field, 'text_field :name' # rubocop:disable QA/ElementWithPattern
element :rename_project_button, "submit 'Rename project'" # rubocop:disable QA/ElementWithPattern
element :project_path_field
element :change_path_button
end
def rename_to(path)
fill_project_name(path)
def update_project_path_to(path)
fill_project_path(path)
rename_project!
click_change_path_button
end
def fill_project_path(path)
fill_in :project_path, with: path
fill_element :project_path_field, path
end
def fill_project_name(name)
fill_in :project_name, with: name
end
def rename_project!
click_on 'Rename project'
def click_change_path_button
click_element :change_path_button
end
end
end
......
......@@ -4,14 +4,6 @@ module QA
module Settings
module Common
include QA::Page::Settings::Common
def self.included(base)
base.class_eval do
view 'app/views/projects/edit.html.haml' do
element :advanced_settings_expand, "= expanded ? 'Collapse' : 'Expand'" # rubocop:disable QA/ElementWithPattern
end
end
end
end
end
end
......
......@@ -9,6 +9,24 @@ module QA
element :advanced_settings
end
view 'app/views/projects/settings/_general.html.haml' do
element :project_name_field
element :save_naming_topics_avatar_button
end
def rename_project_to(name)
fill_project_name(name)
click_save_changes
end
def fill_project_name(name)
fill_element :project_name_field, name
end
def click_save_changes
click_element :save_naming_topics_avatar_button
end
def expand_advanced_settings(&block)
expand_section(:advanced_settings) do
Advanced.perform(&block)
......
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