Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
8cb2f6c5
Commit
8cb2f6c5
authored
Jul 14, 2021
by
Erick Banks
Committed by
Ramya Authappan
Jul 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
End to end test for branch switcher fetch policy
parent
39393b4e
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
160 additions
and
0 deletions
+160
-0
app/assets/javascripts/pipeline_editor/components/commit/commit_form.vue
...scripts/pipeline_editor/components/commit/commit_form.vue
+1
-0
app/assets/javascripts/pipeline_editor/components/file_nav/branch_switcher.vue
...s/pipeline_editor/components/file_nav/branch_switcher.vue
+2
-0
qa/qa.rb
qa/qa.rb
+4
-0
qa/qa/page/project/pipeline_editor/show.rb
qa/qa/page/project/pipeline_editor/show.rb
+45
-0
qa/qa/page/project/sub_menus/ci_cd.rb
qa/qa/page/project/sub_menus/ci_cd.rb
+18
-0
qa/qa/specs/features/browser_ui/4_verify/pipeline/pipeline_editor_branch_switcher_spec.rb
...4_verify/pipeline/pipeline_editor_branch_switcher_spec.rb
+90
-0
No files found.
app/assets/javascripts/pipeline_editor/components/commit/commit_form.vue
View file @
8cb2f6c5
...
...
@@ -103,6 +103,7 @@ export default {
v-model=
"targetBranch"
class=
"gl-font-monospace!"
required
data-qa-selector=
"target_branch_field"
/>
<gl-form-checkbox
v-if=
"!isCurrentBranchTarget"
...
...
app/assets/javascripts/pipeline_editor/components/file_nav/branch_switcher.vue
View file @
8cb2f6c5
...
...
@@ -211,6 +211,7 @@ export default {
:header-text=
"$options.i18n.dropdownHeader"
:text=
"currentBranch"
icon=
"branch"
data-qa-selector=
"branch_selector_button"
>
<gl-search-box-by-type
:debounce=
"$options.inputDebounce"
@
input=
"setSearchTerm"
/>
<gl-dropdown-section-header>
...
...
@@ -228,6 +229,7 @@ export default {
:key=
"branch"
:is-checked=
"currentBranch === branch"
:is-check-item=
"true"
data-qa-selector=
"menu_branch_button"
@
click=
"selectBranch(branch)"
>
{{
branch
}}
...
...
qa/qa.rb
View file @
8cb2f6c5
...
...
@@ -297,6 +297,10 @@ module QA
autoload
:New
,
'qa/page/project/pipeline/new'
end
module
PipelineEditor
autoload
:Show
,
'qa/page/project/pipeline_editor/show'
end
module
Tag
autoload
:Index
,
'qa/page/project/tag/index'
autoload
:New
,
'qa/page/project/tag/new'
...
...
qa/qa/page/project/pipeline_editor/show.rb
0 → 100644
View file @
8cb2f6c5
# frozen_string_literal: true
module
QA
module
Page
module
Project
module
PipelineEditor
class
Show
<
QA
::
Page
::
Base
view
'app/assets/javascripts/pipeline_editor/components/file_nav/branch_switcher.vue'
do
element
:branch_selector_button
element
:menu_branch_button
end
view
'app/assets/javascripts/pipeline_editor/components/commit/commit_form.vue'
do
element
:target_branch_field
end
def
has_branch_selector_button?
has_element?
:branch_selector_button
end
def
click_branch_selector_button
wait_until
(
reload:
false
)
do
has_element?
(
:branch_selector_button
)
end
click_element
(
:branch_selector_button
,
skip_finished_loading_check:
true
)
end
def
select_branch_from_dropdown
(
branch_to_switch_to
)
wait_until
(
reload:
false
)
do
has_element?
(
:menu_branch_button
)
end
click_element
(
:menu_branch_button
,
text:
branch_to_switch_to
,
skip_finished_loading_check:
true
)
end
def
target_branch_name
wait_until
(
reload:
false
)
do
has_element?
(
:target_branch_field
)
end
find_element
(
:target_branch_field
,
skip_finished_loading_check:
true
).
value
end
end
end
end
end
end
qa/qa/page/project/sub_menus/ci_cd.rb
View file @
8cb2f6c5
...
...
@@ -20,6 +20,24 @@ module QA
click_element
(
:sidebar_menu_link
,
menu_item:
'CI/CD'
)
end
end
def
go_to_pipeline_editor
hover_ci_cd_pipelines
do
within_submenu
do
click_element
(
:sidebar_menu_item_link
,
menu_item:
'Editor'
)
end
end
end
private
def
hover_ci_cd_pipelines
within_sidebar
do
find_element
(
:sidebar_menu_link
,
menu_item:
'CI/CD'
).
hover
yield
end
end
end
end
end
...
...
qa/qa/specs/features/browser_ui/4_verify/pipeline/pipeline_editor_branch_switcher_spec.rb
0 → 100644
View file @
8cb2f6c5
# frozen_string_literal: true
module
QA
RSpec
.
describe
'Verify'
do
describe
'Pipeline editor'
,
:requires_admin
do
let
(
:project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
'pipeline-editor-project'
end
end
let!
(
:commit
)
do
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
commit
.
project
=
project
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
add_files
(
[
{
file_path:
'.gitlab-ci.yml'
,
content:
default_file_content
}
]
)
end
end
let!
(
:production_push
)
do
Resource
::
Repository
::
Push
.
fabricate!
do
|
push
|
push
.
repository_http_uri
=
project
.
repository_http_location
.
uri
push
.
branch_name
=
'production'
push
.
file_name
=
'.gitlab-ci.yml'
push
.
file_content
=
production_file_content
end
end
let
(
:default_file_content
)
do
<<~
YAML
stages:
- test
initialize:
stage: test
script:
- echo "initialized in
#{
project
.
default_branch
}
"
YAML
end
let
(
:production_file_content
)
do
<<~
YAML
stages:
- test
initialize:
stage: test
script:
- echo "initialized in production"
YAML
end
before
do
Runtime
::
Feature
.
enable
(
:pipeline_editor_branch_switcher
)
Flow
::
Login
.
sign_in
project
.
visit!
Page
::
Project
::
Menu
.
perform
(
&
:go_to_pipeline_editor
)
end
after
do
Runtime
::
Feature
.
disable
(
:pipeline_editor_branch_switcher
)
project
.
remove_via_api!
Page
::
Main
::
Menu
.
perform
(
&
:sign_out
)
end
it
'can switch branches and target branch field updates accordingly'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1856'
do
Page
::
Project
::
PipelineEditor
::
Show
.
perform
do
|
show
|
expect
(
show
).
to
have_branch_selector_button
show
.
click_branch_selector_button
show
.
select_branch_from_dropdown
(
production_push
.
branch_name
)
expect
(
show
.
target_branch_name
).
to
eq
(
production_push
.
branch_name
)
show
.
click_branch_selector_button
show
.
select_branch_from_dropdown
(
project
.
default_branch
)
expect
(
show
.
target_branch_name
).
to
eq
(
project
.
default_branch
)
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment