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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
9f7fe677
Commit
9f7fe677
authored
Dec 29, 2017
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce Factory::Resource::DeployKey
parent
f851f13f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
16 deletions
+35
-16
qa/qa.rb
qa/qa.rb
+1
-0
qa/qa/factory/resource/deploy_key.rb
qa/qa/factory/resource/deploy_key.rb
+31
-0
qa/qa/specs/features/project/add_deploy_key_spec.rb
qa/qa/specs/features/project/add_deploy_key_spec.rb
+3
-16
No files found.
qa/qa.rb
View file @
9f7fe677
...
...
@@ -24,6 +24,7 @@ module QA
autoload
:Sandbox
,
'qa/factory/resource/sandbox'
autoload
:Group
,
'qa/factory/resource/group'
autoload
:Project
,
'qa/factory/resource/project'
autoload
:DeployKey
,
'qa/factory/resource/deploy_key'
end
module
Repository
...
...
qa/qa/factory/resource/deploy_key.rb
0 → 100644
View file @
9f7fe677
module
QA
module
Factory
module
Resource
class
DeployKey
<
Factory
::
Base
attr_accessor
:title
,
:key
dependency
Factory
::
Resource
::
Project
,
as: :project
do
|
project
|
project
.
name
=
'project-to-deploy'
project
.
description
=
'project for adding deploy key test'
end
def
fabricate!
project
.
visit!
Page
::
Menu
::
Side
.
act
do
click_repository_setting
end
Page
::
Project
::
Settings
::
Repository
.
perform
do
|
setting
|
setting
.
expand_deploy_keys
do
|
page
|
page
.
fill_key_title
(
title
)
page
.
fill_key_value
(
key
)
page
.
add_key
end
end
end
end
end
end
end
qa/qa/specs/features/project/add_deploy_key_spec.rb
View file @
9f7fe677
...
...
@@ -4,13 +4,9 @@ module QA
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
Factory
::
Resource
::
Project
.
fabricate!
do
|
scenario
|
scenario
.
name
=
'project-to-deploy'
scenario
.
description
=
'project for adding deploy key test'
end
Page
::
Menu
::
Side
.
act
do
click_repository_setting
Factory
::
Resource
::
DeployKey
.
fabricate!
do
|
deploy_key
|
deploy_key
.
title
=
deploy_key_title
deploy_key
.
key
=
deploy_key_value
end
end
...
...
@@ -18,15 +14,6 @@ module QA
given
(
:deploy_key_value
)
{
Runtime
::
User
.
ssh_key
}
scenario
'user adds a deploy key'
do
Page
::
Project
::
Settings
::
Repository
.
perform
do
|
setting
|
setting
.
expand_deploy_keys
do
|
page
|
page
.
fill_key_title
(
deploy_key_title
)
page
.
fill_key_value
(
deploy_key_value
)
page
.
add_key
end
end
Page
::
Project
::
Settings
::
Repository
.
perform
do
|
setting
|
setting
.
expand_deploy_keys
do
|
page
|
expect
(
page
).
to
have_key_title
(
deploy_key_title
)
...
...
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