Commit b41b2377 authored by GitLab Bot's avatar GitLab Bot

Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-07-17

# Conflicts:
#	spec/helpers/projects_helper_spec.rb

[ci skip]
parents 7efc5eba 6fdc6976
...@@ -175,6 +175,7 @@ export default { ...@@ -175,6 +175,7 @@ export default {
<span <span
:aria-label="stage.title" :aria-label="stage.title"
aria-hidden="true" aria-hidden="true"
class="no-pointer-events"
> >
<icon :name="borderlessIcon" /> <icon :name="borderlessIcon" />
</span> </span>
......
...@@ -110,7 +110,7 @@ code { ...@@ -110,7 +110,7 @@ code {
padding: 2px 4px; padding: 2px 4px;
color: $red-600; color: $red-600;
background-color: $red-100; background-color: $red-100;
border-radius: 3px; border-radius: $border-radius-default;
.code > & { .code > & {
background-color: inherit; background-color: inherit;
...@@ -128,7 +128,8 @@ table { ...@@ -128,7 +128,8 @@ table {
border-spacing: 0; border-spacing: 0;
} }
.tooltip { .tooltip,
.no-pointer-events {
// Fix bootstrap4 bug whereby tooltips flicker when they are hovered over their borders // Fix bootstrap4 bug whereby tooltips flicker when they are hovered over their borders
pointer-events: none; pointer-events: none;
} }
......
...@@ -9,12 +9,8 @@ ...@@ -9,12 +9,8 @@
.gfm-project_member { .gfm-project_member {
padding: 0 2px; padding: 0 2px;
border-radius: #{$border-radius-default / 2}; background-color: $blue-100;
background-color: $user-mention-bg; border-radius: $border-radius-default;
&:hover {
background-color: $user-mention-bg-hover;
}
} }
.gfm-color_chip { .gfm-color_chip {
......
...@@ -53,6 +53,7 @@ module QA ...@@ -53,6 +53,7 @@ module QA
autoload :User, 'qa/factory/resource/user' autoload :User, 'qa/factory/resource/user'
autoload :ProjectMilestone, 'qa/factory/resource/project_milestone' autoload :ProjectMilestone, 'qa/factory/resource/project_milestone'
autoload :Wiki, 'qa/factory/resource/wiki' autoload :Wiki, 'qa/factory/resource/wiki'
autoload :File, 'qa/factory/resource/file'
autoload :Fork, 'qa/factory/resource/fork' autoload :Fork, 'qa/factory/resource/fork'
end end
...@@ -136,6 +137,15 @@ module QA ...@@ -136,6 +137,15 @@ module QA
autoload :Show, 'qa/page/group/show' autoload :Show, 'qa/page/group/show'
end end
module File
autoload :Form, 'qa/page/file/form'
autoload :Show, 'qa/page/file/show'
module Shared
autoload :CommitMessage, 'qa/page/file/shared/commit_message'
end
end
module Project module Project
autoload :New, 'qa/page/project/new' autoload :New, 'qa/page/project/new'
autoload :Show, 'qa/page/project/show' autoload :Show, 'qa/page/project/show'
......
module QA
module Factory
module Resource
class File < Factory::Base
attr_accessor :name,
:content,
:commit_message
dependency Factory::Resource::Project, as: :project do |project|
project.name = 'project-with-new-file'
end
def initialize
@name = 'QA Test - File name'
@content = 'QA Test - File content'
@commit_message = 'QA Test - Commit message'
end
def fabricate!
project.visit!
Page::Project::Show.act { go_to_new_file! }
Page::File::Form.perform do |page|
page.add_name(@name)
page.add_content(@content)
page.add_commit_message(@commit_message)
page.commit_changes
end
end
end
end
end
end
module QA
module Page
module File
class Form < Page::Base
include Shared::CommitMessage
view 'app/views/projects/blob/_editor.html.haml' do
element :file_name, "text_field_tag 'file_name'"
element :editor, '#editor'
end
view 'app/views/projects/_commit_button.html.haml' do
element :commit_changes, "button_tag 'Commit changes'"
end
def add_name(name)
fill_in 'file_name', with: name
end
def add_content(content)
text_area.set content
end
def remove_content
text_area.send_keys([:command, 'a'], :backspace)
end
def commit_changes
click_on 'Commit changes'
end
private
def text_area
find('#editor>textarea', visible: false)
end
end
end
end
end
module QA
module Page
module File
module Shared
module CommitMessage
def self.included(base)
base.view 'app/views/shared/_commit_message_container.html.haml' do
element :commit_message, "text_area_tag 'commit_message'"
end
end
def add_commit_message(message)
fill_in 'commit_message', with: message
end
end
end
end
end
end
module QA
module Page
module File
class Show < Page::Base
include Shared::CommitMessage
view 'app/helpers/blob_helper.rb' do
element :edit_button, "_('Edit')"
element :delete_button, /label:\s+"Delete"/
end
view 'app/views/projects/blob/_remove.html.haml' do
element :delete_file_button, "button_tag 'Delete file'"
end
def click_edit
click_on 'Edit'
end
def click_delete
click_on 'Delete'
end
def click_delete_file
click_on 'Delete file'
end
end
end
end
end
...@@ -33,10 +33,18 @@ module QA ...@@ -33,10 +33,18 @@ module QA
element :tree_holder, '.tree-holder' element :tree_holder, '.tree-holder'
end end
view 'app/presenters/project_presenter.rb' do
element :new_file_button, "label: _('New file'),"
end
def project_name def project_name
find('.qa-project-name').text find('.qa-project-name').text
end end
def go_to_new_file!
click_on 'New file'
end
def switch_to_branch(branch_name) def switch_to_branch(branch_name)
find_element(:branches_select).click find_element(:branches_select).click
......
...@@ -9,7 +9,7 @@ module QA ...@@ -9,7 +9,7 @@ module QA
end end
def pathname def pathname
@pathname ||= Pathname.new(File.join(__dir__, '../../../', @path)) @pathname ||= Pathname.new(::File.join(__dir__, '../../../', @path))
.cleanpath.expand_path .cleanpath.expand_path
end end
...@@ -23,7 +23,7 @@ module QA ...@@ -23,7 +23,7 @@ module QA
# elements' existence. # elements' existence.
# #
@missing ||= @elements.dup.tap do |elements| @missing ||= @elements.dup.tap do |elements|
File.foreach(pathname.to_s) do |line| ::File.foreach(pathname.to_s) do |line|
elements.reject! { |element| element.matches?(line) } elements.reject! { |element| element.matches?(line) }
end end
end end
......
module QA
describe 'File Functionality', :core do
it 'lets a user create, edit and delete a file via WebUI' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
# Create
file_name = 'QA Test - File name'
file_content = 'QA Test - File content'
commit_message_for_create = 'QA Test - Create new file'
Factory::Resource::File.fabricate! do |file|
file.name = file_name
file.content = file_content
file.commit_message = commit_message_for_create
end
expect(page).to have_content('The file has been successfully created.')
expect(page).to have_content(file_name)
expect(page).to have_content(file_content)
expect(page).to have_content(commit_message_for_create)
# Edit
updated_file_content = 'QA Test - Updated file content'
commit_message_for_update = 'QA Test - Update file'
Page::File::Show.act { click_edit }
Page::File::Form.act do
remove_content
add_content(updated_file_content)
add_commit_message(commit_message_for_update)
commit_changes
end
expect(page).to have_content('Your changes have been successfully committed.')
expect(page).to have_content(updated_file_content)
expect(page).to have_content(commit_message_for_update)
# Delete
commit_message_for_delete = 'QA Test - Delete file'
Page::File::Show.act do
click_delete
add_commit_message(commit_message_for_delete)
click_delete_file
end
expect(page).to have_content('The file has been successfully deleted.')
expect(page).to have_content(commit_message_for_delete)
expect(page).to have_no_content(file_name)
end
end
end
...@@ -288,6 +288,7 @@ describe ProjectsHelper do ...@@ -288,6 +288,7 @@ describe ProjectsHelper do
expect(helper.send(:default_clone_protocol)).to eq('https') expect(helper.send(:default_clone_protocol)).to eq('https')
end end
end end
<<<<<<< HEAD
context 'when gitlab.config.kerberos is enabled and user is logged in' do context 'when gitlab.config.kerberos is enabled and user is logged in' do
it 'returns krb5 as default protocol' do it 'returns krb5 as default protocol' do
...@@ -297,6 +298,8 @@ describe ProjectsHelper do ...@@ -297,6 +298,8 @@ describe ProjectsHelper do
expect(helper.send(:default_clone_protocol)).to eq('krb5') expect(helper.send(:default_clone_protocol)).to eq('krb5')
end end
end end
=======
>>>>>>> upstream/master
end end
describe '#last_push_event' do describe '#last_push_event' 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