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
80bbb770
Commit
80bbb770
authored
Mar 11, 2020
by
Mark Lapierre
Committed by
Sanad Liaquat
Mar 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update E2E test to add SSH key via the API
parent
2a3770cd
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
45 additions
and
22 deletions
+45
-22
qa/qa/resource/ssh_key.rb
qa/qa/resource/ssh_key.rb
+31
-0
qa/qa/specs/features/browser_ui/3_create/repository/add_ssh_key_spec.rb
...atures/browser_ui/3_create/repository/add_ssh_key_spec.rb
+1
-1
qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_ssh_spec.rb
...owser_ui/3_create/repository/protocol_v2_push_ssh_spec.rb
+5
-13
qa/qa/specs/features/browser_ui/3_create/repository/use_ssh_key_spec.rb
...atures/browser_ui/3_create/repository/use_ssh_key_spec.rb
+1
-1
qa/qa/specs/features/ee/browser_ui/1_manage/instance/instance_audit_logs_spec.rb
.../browser_ui/1_manage/instance/instance_audit_logs_spec.rb
+1
-1
qa/qa/specs/features/ee/browser_ui/geo/ssh_push_spec.rb
qa/qa/specs/features/ee/browser_ui/geo/ssh_push_spec.rb
+2
-2
qa/qa/specs/features/ee/browser_ui/geo/ssh_push_to_secondary_spec.rb
.../features/ee/browser_ui/geo/ssh_push_to_secondary_spec.rb
+2
-2
qa/qa/specs/features/ee/browser_ui/geo/wiki_ssh_push_spec.rb
qa/qa/specs/features/ee/browser_ui/geo/wiki_ssh_push_spec.rb
+1
-1
qa/qa/specs/features/ee/browser_ui/geo/wiki_ssh_push_to_secondary_spec.rb
...ures/ee/browser_ui/geo/wiki_ssh_push_to_secondary_spec.rb
+1
-1
No files found.
qa/qa/resource/ssh_key.rb
View file @
80bbb770
...
...
@@ -7,6 +7,8 @@ module QA
attr_accessor
:title
attribute
:id
def_delegators
:key
,
:private_key
,
:public_key
,
:md5_fingerprint
def
key
...
...
@@ -21,6 +23,35 @@ module QA
profile_page
.
add_key
(
public_key
,
title
)
end
end
def
fabricate_via_api!
api_post
end
def
api_delete
QA
::
Runtime
::
Logger
.
debug
(
"Deleting SSH key with title '
#{
title
}
' and fingerprint '
#{
md5_fingerprint
}
'"
)
super
end
def
api_get_path
"/user/keys/
#{
id
}
"
end
def
api_post_path
'/user/keys'
end
def
api_post_body
{
title:
title
,
key:
public_key
}
end
def
api_delete_path
"/user/keys/
#{
id
}
"
end
end
end
end
qa/qa/specs/features/browser_ui/3_create/repository/add_ssh_key_spec.rb
View file @
80bbb770
...
...
@@ -8,7 +8,7 @@ module QA
it
'user adds and then removes an SSH key'
,
:smoke
do
Flow
::
Login
.
sign_in
key
=
Resource
::
SSHKey
.
fabricate!
do
|
resource
|
key
=
Resource
::
SSHKey
.
fabricate
_via_browser_ui
!
do
|
resource
|
resource
.
title
=
key_title
end
...
...
qa/qa/specs/features/browser_ui/3_create/repository/protocol_v2_push_ssh_spec.rb
View file @
80bbb770
...
...
@@ -11,29 +11,24 @@ module QA
let
(
:key_title
)
{
"key for ssh tests
#{
Time
.
now
.
to_f
}
"
}
let
(
:ssh_key
)
do
Resource
::
SSHKey
.
fabricate!
do
|
resource
|
Resource
::
SSHKey
.
fabricate
_via_api
!
do
|
resource
|
resource
.
title
=
key_title
end
end
around
do
|
example
|
# Create an SSH key to be used with Git
# Create an SSH key to be used with Git
, then remove it after the test
Flow
::
Login
.
sign_in
ssh_key
example
.
run
# Remove the SSH key
Flow
::
Login
.
sign_in
Page
::
Main
::
Menu
.
perform
(
&
:click_settings_link
)
Page
::
Profile
::
Menu
.
perform
(
&
:click_ssh_keys
)
Page
::
Profile
::
SSHKeys
.
perform
do
|
ssh_keys
|
ssh_keys
.
remove_key
(
key_title
)
end
ssh_key
.
remove_via_api!
Page
::
Main
::
Menu
.
perform
(
&
:sign_out_if_signed_in
)
end
it
'user pushes to the repository'
do
# Create a project to push to
project
=
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
'git-protocol-project'
end
...
...
@@ -68,11 +63,8 @@ module QA
project
.
visit!
project
.
wait_for_push_new_branch
# Check that the push worked
expect
(
page
).
to
have_content
(
file_name
)
expect
(
page
).
to
have_content
(
file_content
)
# And check that the correct Git protocol was used
expect
(
git_protocol_reported
).
to
eq
(
git_protocol
)
end
end
...
...
qa/qa/specs/features/browser_ui/3_create/repository/use_ssh_key_spec.rb
View file @
80bbb770
...
...
@@ -11,7 +11,7 @@ module QA
it
'user adds an ssh key and pushes code to the repository'
do
Flow
::
Login
.
sign_in
key
=
Resource
::
SSHKey
.
fabricate!
do
|
resource
|
key
=
Resource
::
SSHKey
.
fabricate
_via_api
!
do
|
resource
|
resource
.
title
=
key_title
end
...
...
qa/qa/specs/features/ee/browser_ui/1_manage/instance/instance_audit_logs_spec.rb
View file @
80bbb770
...
...
@@ -46,7 +46,7 @@ module QA
context
'Add SSH key'
do
before
do
sign_in
Resource
::
SSHKey
.
fabricate!
do
|
resource
|
Resource
::
SSHKey
.
fabricate
_via_browser_ui
!
do
|
resource
|
resource
.
title
=
"key for instance audit event logs test
#{
Time
.
now
.
to_f
}
"
end
end
...
...
qa/qa/specs/features/ee/browser_ui/geo/ssh_push_spec.rb
View file @
80bbb770
...
...
@@ -14,7 +14,7 @@ module QA
QA
::
Flow
::
Login
.
while_signed_in
(
address: :geo_primary
)
do
# Create a new SSH key for the user
key
=
Resource
::
SSHKey
.
fabricate!
do
|
resource
|
key
=
Resource
::
SSHKey
.
fabricate
_via_api
!
do
|
resource
|
resource
.
title
=
key_title
end
...
...
@@ -83,7 +83,7 @@ module QA
QA
::
Flow
::
Login
.
while_signed_in
(
address: :geo_primary
)
do
# Create a new SSH key for the user
key
=
Resource
::
SSHKey
.
fabricate!
do
|
resource
|
key
=
Resource
::
SSHKey
.
fabricate
_via_api
!
do
|
resource
|
resource
.
title
=
key_title
end
...
...
qa/qa/specs/features/ee/browser_ui/geo/ssh_push_to_secondary_spec.rb
View file @
80bbb770
...
...
@@ -15,7 +15,7 @@ module QA
QA
::
Flow
::
Login
.
while_signed_in
(
address: :geo_primary
)
do
# Create a new SSH key for the user
key
=
Resource
::
SSHKey
.
fabricate!
do
|
resource
|
key
=
Resource
::
SSHKey
.
fabricate
_via_api
!
do
|
resource
|
resource
.
title
=
key_title
end
...
...
@@ -105,7 +105,7 @@ module QA
QA
::
Flow
::
Login
.
while_signed_in
(
address: :geo_primary
)
do
# Create a new SSH key for the user
key
=
Resource
::
SSHKey
.
fabricate!
do
|
resource
|
key
=
Resource
::
SSHKey
.
fabricate
_via_api
!
do
|
resource
|
resource
.
title
=
key_title
end
...
...
qa/qa/specs/features/ee/browser_ui/geo/wiki_ssh_push_spec.rb
View file @
80bbb770
...
...
@@ -15,7 +15,7 @@ module QA
QA
::
Flow
::
Login
.
while_signed_in
(
address: :geo_primary
)
do
# Create a new SSH key
key
=
Resource
::
SSHKey
.
fabricate!
do
|
resource
|
key
=
Resource
::
SSHKey
.
fabricate
_via_api
!
do
|
resource
|
resource
.
title
=
key_title
end
...
...
qa/qa/specs/features/ee/browser_ui/geo/wiki_ssh_push_to_secondary_spec.rb
View file @
80bbb770
...
...
@@ -14,7 +14,7 @@ module QA
before
do
QA
::
Flow
::
Login
.
while_signed_in
(
address: :geo_primary
)
do
# Create a new SSH key
key
=
Resource
::
SSHKey
.
fabricate!
do
|
resource
|
key
=
Resource
::
SSHKey
.
fabricate
_via_api
!
do
|
resource
|
resource
.
title
=
key_title
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