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
7377b97c
Commit
7377b97c
authored
Dec 22, 2017
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QA: Add a scenario for adding a deploy key
parent
4e0b6bf7
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
119 additions
and
0 deletions
+119
-0
qa/qa.rb
qa/qa.rb
+5
-0
qa/qa/page/project/settings/deploy_key.rb
qa/qa/page/project/settings/deploy_key.rb
+33
-0
qa/qa/page/project/settings/repository.rb
qa/qa/page/project/settings/repository.rb
+19
-0
qa/qa/page/project/show.rb
qa/qa/page/project/show.rb
+20
-0
qa/qa/runtime/user.rb
qa/qa/runtime/user.rb
+9
-0
qa/qa/specs/features/project/add_deploy_key_spec.rb
qa/qa/specs/features/project/add_deploy_key_spec.rb
+33
-0
No files found.
qa/qa.rb
View file @
7377b97c
...
@@ -86,6 +86,11 @@ module QA
...
@@ -86,6 +86,11 @@ module QA
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
Settings
autoload
:Repository
,
'qa/page/project/settings/repository'
autoload
:DeployKey
,
'qa/page/project/settings/deploy_key'
end
end
end
module
Admin
module
Admin
...
...
qa/qa/page/project/settings/deploy_key.rb
0 → 100644
View file @
7377b97c
module
QA
module
Page
module
Project
module
Settings
class
DeployKey
<
Repository
def
initialize
super
expand
(
'Deploy Keys'
)
end
def
fill_new_deploy_key_title
(
title
)
fill_in
'deploy_key_title'
,
with:
title
end
def
fill_new_deploy_key_key
(
key
)
fill_in
'deploy_key_key'
,
with:
key
end
def
add_key
click_on
'Add key'
end
def
has_key_title?
(
title
)
page
.
within
(
'.deploy-keys'
)
do
page
.
find
(
'.title'
,
text:
title
)
end
end
end
end
end
end
end
qa/qa/page/project/settings/repository.rb
0 → 100644
View file @
7377b97c
module
QA
module
Page
module
Project
module
Settings
class
Repository
<
Page
::
Base
def
expand
(
title
)
page
.
within
(
'#content-body'
)
do
find
(
:xpath
,
"//button[contains(text(), 'Expand')]"
+
"[../h4[contains(text(), '
#{
title
}
')]]"
).
click
end
end
end
end
end
end
end
qa/qa/page/project/show.rb
View file @
7377b97c
...
@@ -10,6 +10,12 @@ module QA
...
@@ -10,6 +10,12 @@ module QA
end
end
end
end
def
click_repository_setting
hover_setting
do
click_link
(
'Repository'
)
end
end
def
repository_location
def
repository_location
find
(
'#project_clone'
).
value
find
(
'#project_clone'
).
value
end
end
...
@@ -18,6 +24,20 @@ module QA
...
@@ -18,6 +24,20 @@ module QA
find
(
'.project-title'
).
text
find
(
'.project-title'
).
text
end
end
def
hover_setting
within_sidebar
do
find
(
'.nav-item-name'
,
text:
'Settings'
).
hover
yield
end
end
def
within_sidebar
page
.
within
(
'.sidebar-top-level-items'
)
do
yield
end
end
def
wait_for_push
def
wait_for_push
sleep
5
sleep
5
end
end
...
...
qa/qa/runtime/user.rb
View file @
7377b97c
...
@@ -10,6 +10,15 @@ module QA
...
@@ -10,6 +10,15 @@ module QA
def
password
def
password
ENV
[
'GITLAB_PASSWORD'
]
||
'5iveL!fe'
ENV
[
'GITLAB_PASSWORD'
]
||
'5iveL!fe'
end
end
def
ssh_key
'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFf6RYK3qu/RKF/3ndJmL5xgMLp3O9'
\
'6x8lTay+QGZ0+9FnnAXMdUqBq/ZU6d/gyMB4IaW3nHzM1w049++yAB6UPCzMB8Uo27K5'
\
'/jyZCtj7Vm9PFNjF/8am1kp46c/SeYicQgQaSBdzIW3UDEa1Ef68qroOlvpi9PYZ/tA7'
\
'M0YP0K5PXX+E36zaIRnJVMPT3f2k+GnrxtjafZrwFdpOP/Fol5BQLBgcsyiU+LM1SuaC'
\
'rzd8c9vyaTA1CxrkxaZh+buAi0PmdDtaDrHd42gqZkXCKavyvgM5o2CkQ5LJHCgzpXy0'
\
'5qNFzmThBSkb+XtoxbyagBiGbVZtSVow6Xa7qewz= dummy@gitlab.com'
end
end
end
end
end
end
end
qa/qa/specs/features/project/add_deploy_key_spec.rb
0 → 100644
View file @
7377b97c
module
QA
feature
'add deploy key'
,
:core
do
before
do
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
::
Project
::
Show
.
act
do
click_repository_setting
end
end
given
(
:deploy_key_title
)
{
'deploy key title'
}
given
(
:deploy_key_data
)
{
Runtime
::
User
.
ssh_key
}
scenario
'user adds a deploy key'
do
Page
::
Project
::
Settings
::
DeployKey
.
perform
do
|
deploy_key
|
deploy_key
.
fill_new_deploy_key_title
(
deploy_key_title
)
deploy_key
.
fill_new_deploy_key_key
(
deploy_key_data
)
deploy_key
.
add_key
end
Page
::
Project
::
Settings
::
DeployKey
.
perform
do
|
deploy_key
|
expect
(
deploy_key
).
to
have_key_title
(
deploy_key_title
)
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