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
553a65df
Commit
553a65df
authored
Nov 19, 2018
by
Sanad Liaquat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port ee changes
parent
84cb5f13
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
23 deletions
+30
-23
qa/qa.rb
qa/qa.rb
+1
-0
qa/qa/resource/api_fabricator.rb
qa/qa/resource/api_fabricator.rb
+1
-23
qa/qa/support/api.rb
qa/qa/support/api.rb
+28
-0
No files found.
qa/qa.rb
View file @
553a65df
...
...
@@ -329,6 +329,7 @@ module QA
module
Page
autoload
:Logging
,
'qa/support/page/logging'
end
autoload
:Api
,
'qa/support/api'
end
end
...
...
qa/qa/resource/api_fabricator.rb
View file @
553a65df
...
...
@@ -41,6 +41,7 @@ module QA
private
include
Support
::
Api
attr_writer
:api_resource
,
:api_response
def
resource_web_url
(
resource
)
...
...
@@ -82,10 +83,6 @@ module QA
end
end
def
parse_body
(
response
)
JSON
.
parse
(
response
.
body
,
symbolize_names:
true
)
end
def
process_api_response
(
parsed_response
)
self
.
api_response
=
parsed_response
self
.
api_resource
=
transform_api_resource
(
parsed_response
.
deep_dup
)
...
...
@@ -94,25 +91,6 @@ module QA
def
transform_api_resource
(
api_resource
)
api_resource
end
def
post
(
url
,
payload
)
RestClient
::
Request
.
execute
(
method: :post
,
url:
url
,
payload:
payload
,
verify_ssl:
false
)
rescue
RestClient
::
ExceptionWithResponse
=>
e
e
.
response
end
def
get
(
url
)
RestClient
::
Request
.
execute
(
method: :get
,
url:
url
,
verify_ssl:
false
)
rescue
RestClient
::
ExceptionWithResponse
=>
e
e
.
response
end
end
end
end
qa/qa/support/api.rb
0 → 100644
View file @
553a65df
module
QA
module
Support
module
Api
def
post
(
url
,
payload
)
RestClient
::
Request
.
execute
(
method: :post
,
url:
url
,
payload:
payload
,
verify_ssl:
false
)
rescue
RestClient
::
ExceptionWithResponse
=>
e
e
.
response
end
def
get
(
url
)
RestClient
::
Request
.
execute
(
method: :get
,
url:
url
,
verify_ssl:
false
)
rescue
RestClient
::
ExceptionWithResponse
=>
e
e
.
response
end
def
parse_body
(
response
)
JSON
.
parse
(
response
.
body
,
symbolize_names:
true
)
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