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
Léo-Paul Géneau
gitlab-ce
Commits
84cb5f13
Commit
84cb5f13
authored
Nov 14, 2018
by
Sanad Liaquat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Porting more changes from ee
parent
6c571a67
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
9 deletions
+48
-9
qa/qa/page/component/select2.rb
qa/qa/page/component/select2.rb
+6
-1
qa/qa/page/main/menu.rb
qa/qa/page/main/menu.rb
+6
-0
qa/qa/resource/api_fabricator.rb
qa/qa/resource/api_fabricator.rb
+19
-2
qa/qa/resource/base.rb
qa/qa/resource/base.rb
+1
-0
qa/qa/resource/sandbox.rb
qa/qa/resource/sandbox.rb
+1
-1
qa/qa/resource/user.rb
qa/qa/resource/user.rb
+12
-2
qa/qa/runtime/env.rb
qa/qa/runtime/env.rb
+3
-3
No files found.
qa/qa/page/component/select2.rb
View file @
84cb5f13
...
@@ -3,7 +3,12 @@ module QA
...
@@ -3,7 +3,12 @@ module QA
module
Component
module
Component
module
Select2
module
Select2
def
select_item
(
item_text
)
def
select_item
(
item_text
)
find
(
'ul.select2-result-sub > li'
,
text:
item_text
).
click
find
(
'.select2-result-label'
,
text:
item_text
).
click
end
def
search_and_select
(
item_text
)
find
(
'.select2-input'
).
set
(
item_text
)
select_item
(
item_text
)
end
end
end
end
end
end
...
...
qa/qa/page/main/menu.rb
View file @
84cb5f13
...
@@ -68,6 +68,12 @@ module QA
...
@@ -68,6 +68,12 @@ module QA
end
end
end
end
def
has_admin_area_link?
(
wait:
Capybara
.
default_max_wait_time
)
using_wait_time
(
wait
)
do
page
.
has_selector?
(
element_selector_css
(
:admin_area_link
))
end
end
private
private
def
within_top_menu
def
within_top_menu
...
...
qa/qa/resource/api_fabricator.rb
View file @
84cb5f13
# frozen_string_literal: true
# frozen_string_literal: true
require
'airborne'
require
'active_support/core_ext/object/deep_dup'
require
'active_support/core_ext/object/deep_dup'
require
'capybara/dsl'
require
'capybara/dsl'
module
QA
module
QA
module
Resource
module
Resource
module
ApiFabricator
module
ApiFabricator
include
Airborne
include
Capybara
::
DSL
include
Capybara
::
DSL
HTTP_STATUS_OK
=
200
HTTP_STATUS_OK
=
200
...
@@ -96,6 +94,25 @@ module QA
...
@@ -96,6 +94,25 @@ module QA
def
transform_api_resource
(
api_resource
)
def
transform_api_resource
(
api_resource
)
api_resource
api_resource
end
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
end
end
end
qa/qa/resource/base.rb
View file @
84cb5f13
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
require
'forwardable'
require
'forwardable'
require
'capybara/dsl'
require
'capybara/dsl'
require
'active_support/core_ext/array/extract_options'
module
QA
module
QA
module
Resource
module
Resource
...
...
qa/qa/resource/sandbox.rb
View file @
84cb5f13
...
@@ -7,7 +7,7 @@ module QA
...
@@ -7,7 +7,7 @@ module QA
# creating it if it doesn't yet exist.
# creating it if it doesn't yet exist.
#
#
class
Sandbox
<
Base
class
Sandbox
<
Base
attr_
reade
r
:path
attr_
accesso
r
:path
attribute
:id
attribute
:id
...
...
qa/qa/resource/user.rb
View file @
84cb5f13
...
@@ -6,7 +6,8 @@ module QA
...
@@ -6,7 +6,8 @@ module QA
module
Resource
module
Resource
class
User
<
Base
class
User
<
Base
attr_reader
:unique_id
attr_reader
:unique_id
attr_writer
:username
,
:password
attr_writer
:username
,
:password
,
:name
,
:email
attr_accessor
:provider
,
:extern_uid
def
initialize
def
initialize
@unique_id
=
SecureRandom
.
hex
(
8
)
@unique_id
=
SecureRandom
.
hex
(
8
)
...
@@ -73,7 +74,7 @@ module QA
...
@@ -73,7 +74,7 @@ module QA
username:
username
,
username:
username
,
name:
name
,
name:
name
,
skip_confirmation:
true
skip_confirmation:
true
}
}
.
merge
(
ldap_post_body
)
end
end
def
self
.
fabricate_or_use
(
username
,
password
)
def
self
.
fabricate_or_use
(
username
,
password
)
...
@@ -89,6 +90,15 @@ module QA
...
@@ -89,6 +90,15 @@ module QA
private
private
def
ldap_post_body
return
{}
unless
extern_uid
&&
provider
{
extern_uid:
extern_uid
,
provider:
provider
}
end
def
fetch_id
(
username
)
def
fetch_id
(
username
)
users
=
parse_body
(
api_get_from
(
"/users?username=
#{
username
}
"
))
users
=
parse_body
(
api_get_from
(
"/users?username=
#{
username
}
"
))
...
...
qa/qa/runtime/env.rb
View file @
84cb5f13
...
@@ -5,7 +5,7 @@ module QA
...
@@ -5,7 +5,7 @@ module QA
module
Env
module
Env
extend
self
extend
self
attr_writer
:personal_access_token
attr_writer
:personal_access_token
,
:ldap_username
,
:ldap_password
# The environment variables used to indicate if the environment under test
# The environment variables used to indicate if the environment under test
# supports the given feature
# supports the given feature
...
@@ -92,11 +92,11 @@ module QA
...
@@ -92,11 +92,11 @@ module QA
end
end
def
ldap_username
def
ldap_username
ENV
[
'GITLAB_LDAP_USERNAME'
]
@ldap_username
||=
ENV
[
'GITLAB_LDAP_USERNAME'
]
end
end
def
ldap_password
def
ldap_password
ENV
[
'GITLAB_LDAP_PASSWORD'
]
@ldap_password
||=
ENV
[
'GITLAB_LDAP_PASSWORD'
]
end
end
def
sandbox_name
def
sandbox_name
...
...
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