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
77c9632e
Commit
77c9632e
authored
Nov 27, 2017
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turn push file into a scenario
parent
9db9f68f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
15 deletions
+48
-15
qa/qa.rb
qa/qa.rb
+4
-0
qa/qa/scenario/gitlab/repository/push.rb
qa/qa/scenario/gitlab/repository/push.rb
+40
-0
qa/qa/specs/features/repository/push_spec.rb
qa/qa/specs/features/repository/push_spec.rb
+4
-15
No files found.
qa/qa.rb
View file @
77c9632e
...
...
@@ -46,6 +46,10 @@ module QA
autoload
:Create
,
'qa/scenario/gitlab/project/create'
end
module
Repository
autoload
:Push
,
'qa/scenario/gitlab/repository/push'
end
module
Sandbox
autoload
:Prepare
,
'qa/scenario/gitlab/sandbox/prepare'
end
...
...
qa/qa/scenario/gitlab/repository/push.rb
0 → 100644
View file @
77c9632e
require
"pry-byebug"
module
QA
module
Scenario
module
Gitlab
module
Repository
class
Push
<
Scenario
::
Template
attr_writer
:file_name
,
:file_content
,
:commit_message
,
:branch_name
def
initialize
@file_name
=
'file.txt'
@file_content
=
'# This is test project'
@commit_message
=
"Add
#{
@file_name
}
"
@branch_name
=
'master'
end
def
perform
Git
::
Repository
.
perform
do
|
repository
|
repository
.
location
=
Page
::
Project
::
Show
.
act
do
choose_repository_clone_http
repository_location
end
repository
.
use_default_credentials
repository
.
clone
repository
.
configure_identity
(
'GitLab QA'
,
'root@gitlab.com'
)
repository
.
add_file
(
@file_name
,
@file_content
)
repository
.
commit
(
@commit_message
)
repository
.
push_changes
(
@branch_name
)
end
end
end
end
end
end
end
qa/qa/specs/features/repository/push_spec.rb
View file @
77c9632e
...
...
@@ -10,21 +10,10 @@ module QA
scenario
.
description
=
'project with repository'
end
Git
::
Repository
.
perform
do
|
repository
|
repository
.
location
=
Page
::
Project
::
Show
.
act
do
choose_repository_clone_http
repository_location
end
repository
.
use_default_credentials
repository
.
act
do
clone
configure_identity
(
'GitLab QA'
,
'root@gitlab.com'
)
add_file
(
'README.md'
,
'# This is test project'
)
commit
(
'Add README.md'
)
push_changes
end
Scenario
::
Gitlab
::
Repository
::
Push
.
perform
do
|
scenario
|
scenario
.
file_name
=
'README.md'
scenario
.
file_content
=
'# This is test project'
scenario
.
commit_message
=
'Add README.md'
end
Page
::
Project
::
Show
.
act
do
...
...
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