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
b90b9ba5
Commit
b90b9ba5
authored
Jul 07, 2020
by
Erick Banks
Committed by
Dan Davison
Jul 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor 3_create/jira/jira_basic_integration_spec.rb to use let syntax
parent
ae811a1f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
qa/qa/specs/features/browser_ui/3_create/jira/jira_basic_integration_spec.rb
...s/browser_ui/3_create/jira/jira_basic_integration_spec.rb
+12
-9
No files found.
qa/qa/specs/features/browser_ui/3_create/jira/jira_basic_integration_spec.rb
View file @
b90b9ba5
...
@@ -6,18 +6,19 @@ module QA
...
@@ -6,18 +6,19 @@ module QA
describe
'Jira integration'
,
:jira
,
:orchestrated
,
:requires_admin
do
describe
'Jira integration'
,
:jira
,
:orchestrated
,
:requires_admin
do
let
(
:jira_project_key
)
{
'JITP'
}
let
(
:jira_project_key
)
{
'JITP'
}
let
(
:project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
"project_with_jira_integration"
end
end
before
(
:all
)
do
before
do
page
.
visit
Vendor
::
Jira
::
JiraAPI
.
perform
(
&
:base_url
)
page
.
visit
Vendor
::
Jira
::
JiraAPI
.
perform
(
&
:base_url
)
QA
::
Support
::
Retrier
.
retry_until
(
sleep_interval:
3
,
reload_page:
page
,
max_attempts:
20
,
raise_on_failure:
true
)
do
QA
::
Support
::
Retrier
.
retry_until
(
sleep_interval:
3
,
reload_page:
page
,
max_attempts:
20
,
raise_on_failure:
true
)
do
page
.
has_text?
'Welcome to Jira'
page
.
has_text?
'Welcome to Jira'
end
end
@project
=
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
"project_with_jira_integration"
end
# Retry is required because allow_local_requests_from_web_hooks_and_services
# Retry is required because allow_local_requests_from_web_hooks_and_services
# takes some time to get enabled.
# takes some time to get enabled.
# Bug issue: https://gitlab.com/gitlab-org/gitlab/-/issues/217010
# Bug issue: https://gitlab.com/gitlab-org/gitlab/-/issues/217010
...
@@ -27,7 +28,7 @@ module QA
...
@@ -27,7 +28,7 @@ module QA
page
.
visit
Runtime
::
Scenario
.
gitlab_address
page
.
visit
Runtime
::
Scenario
.
gitlab_address
Flow
::
Login
.
sign_in_unless_signed_in
Flow
::
Login
.
sign_in_unless_signed_in
@
project
.
visit!
project
.
visit!
Page
::
Project
::
Menu
.
perform
(
&
:go_to_integrations_settings
)
Page
::
Project
::
Menu
.
perform
(
&
:go_to_integrations_settings
)
QA
::
Page
::
Project
::
Settings
::
Integrations
.
perform
(
&
:click_jira_link
)
QA
::
Page
::
Project
::
Settings
::
Integrations
.
perform
(
&
:click_jira_link
)
...
@@ -67,9 +68,11 @@ module QA
...
@@ -67,9 +68,11 @@ module QA
expect_issue_done
(
issue_key
)
expect_issue_done
(
issue_key
)
end
end
private
def
create_mr_with_description
(
description
)
def
create_mr_with_description
(
description
)
Resource
::
MergeRequest
.
fabricate!
do
|
merge_request
|
Resource
::
MergeRequest
.
fabricate!
do
|
merge_request
|
merge_request
.
project
=
@
project
merge_request
.
project
=
project
merge_request
.
target_new_branch
=
!
master_branch_exists?
merge_request
.
target_new_branch
=
!
master_branch_exists?
merge_request
.
description
=
description
merge_request
.
description
=
description
end
end
...
@@ -80,7 +83,7 @@ module QA
...
@@ -80,7 +83,7 @@ module QA
push
.
branch_name
=
'master'
push
.
branch_name
=
'master'
push
.
commit_message
=
commit_message
push
.
commit_message
=
commit_message
push
.
file_content
=
commit_message
push
.
file_content
=
commit_message
push
.
project
=
@
project
push
.
project
=
project
push
.
new_branch
=
!
master_branch_exists?
push
.
new_branch
=
!
master_branch_exists?
end
end
end
end
...
@@ -98,7 +101,7 @@ module QA
...
@@ -98,7 +101,7 @@ module QA
end
end
def
master_branch_exists?
def
master_branch_exists?
@
project
.
repository_branches
.
map
{
|
item
|
item
[
:name
]
}.
include?
(
"master"
)
project
.
repository_branches
.
map
{
|
item
|
item
[
:name
]
}.
include?
(
"master"
)
end
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