Commit 4f12ef0f authored by Sanad Liaquat's avatar Sanad Liaquat Committed by Luke Bennett

Update project settings qa selectors

Additionally fixes geo rename test.
parent 3801e9da
......@@ -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',
),
);
});
......@@ -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
......@@ -39,4 +39,4 @@
= link_to _('Remove avatar'), project_avatar_path(@project), data: { confirm: _('Avatar will be removed. Are you sure?')}, method: :delete, class: 'btn btn-link'
= f.submit _('Save changes'), class: "btn btn-success mt-4"
= f.submit _('Save changes'), class: "btn btn-success mt-4 qa-save-naming-topics-avatar-button"
......@@ -9,7 +9,7 @@
= link_to _("Learn more about approvals."), help_page_path("user/project/merge_requests/merge_request_approvals"), target: '_blank'
.settings-content
= form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { class: "merge-request-approval-settings-form" }, authenticity_token: true do |f|
= form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { class: "merge-request-approval-settings-form js-mr-approvals-form" }, authenticity_token: true do |f|
%input{ name: 'update_section', type: 'hidden', value: 'js-merge-request-approval-settings' }
= render 'projects/merge_request_approvals_settings_form', form: f, project: @project
= f.submit _("Save changes"), class: "btn btn-success"
......@@ -3,7 +3,7 @@
%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.btn-default.js-settings-toggle{ type: 'button' }= expanded ? _('Collapse') : _('Expand')
%button.btn.btn-default.js-settings-toggle= expanded ? _('Collapse') : _('Expand')
%p= _('Set a default template for issue descriptions.')
.settings-content
......
---
title: Improve project settings page layout and UX
merge_request: 10388
author:
type: other
......@@ -2103,9 +2103,6 @@ msgstr ""
msgid "Choose between <code>clone</code> or <code>fetch</code> to get the recent application code"
msgstr ""
msgid "Choose file..."
msgstr ""
msgid "Choose file…"
msgstr ""
......@@ -2241,12 +2238,9 @@ msgstr ""
msgid "CiVariable|Validation failed"
msgstr ""
<<<<<<< HEAD
=======
msgid "Classification Label (optional)"
msgstr ""
>>>>>>> Improve project settings page
msgid "ClassificationLabelUnavailable|is unavailable: %{reason}"
msgstr ""
......@@ -3452,12 +3446,9 @@ msgstr ""
msgid "Default classification label"
msgstr ""
<<<<<<< HEAD
=======
msgid "Default description template for issues"
msgstr ""
>>>>>>> Improve project settings page
msgid "Default first day of the week"
msgstr ""
......@@ -3847,11 +3838,10 @@ msgstr ""
msgid "Download asset"
msgstr ""
<<<<<<< HEAD
msgid "Download license"
=======
msgid "Download export"
>>>>>>> Improve project settings page
msgstr ""
msgid "Download license"
msgstr ""
msgid "Download source code"
......@@ -4508,12 +4498,6 @@ msgstr ""
msgid "External authorization request timeout"
msgstr ""
<<<<<<< HEAD
msgid "ExternalAuthorizationService|Classification Label"
msgstr ""
=======
>>>>>>> Improve project settings page
msgid "ExternalAuthorizationService|Classification label"
msgstr ""
......@@ -8608,9 +8592,6 @@ msgstr ""
msgid "Project avatar"
msgstr ""
msgid "Project avatar in repository: %{link}"
msgstr ""
msgid "Project configuration, including services"
msgstr ""
......@@ -9183,11 +9164,10 @@ msgstr ""
msgid "Removing group will cause all child projects and resources to be removed."
msgstr ""
<<<<<<< HEAD
msgid "Removing license…"
=======
msgstr ""
msgid "Removing the project will delete its repository and all related resources including issues, merge requests etc."
>>>>>>> Improve project settings page
msgstr ""
msgid "Rename"
......
......@@ -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)
......
......@@ -34,8 +34,11 @@ module QA
geo_project_renamed = "geo-after-rename-#{SecureRandom.hex(8)}"
Page::Project::Settings::Main.perform do |settings|
settings.rename_project_to(geo_project_renamed)
expect(page).to have_content "Project '#{geo_project_renamed}' was successfully updated."
settings.expand_advanced_settings do |page|
page.rename_to(geo_project_renamed)
page.update_project_path_to(geo_project_renamed)
end
end
......
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