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
56d4ffd2
Commit
56d4ffd2
authored
Nov 14, 2019
by
Aleksandr Soborov
Committed by
Ramya Authappan
Nov 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added E2E License Compliance settings tests
Also adjusted page object functions and data selectors as needed.
parent
b6c1b1db
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
10 deletions
+56
-10
ee/app/assets/javascripts/vue_shared/license_management/components/license_management_row.vue
.../license_management/components/license_management_row.vue
+1
-1
qa/qa/ee/page/project/settings/license_compliance.rb
qa/qa/ee/page/project/settings/license_compliance.rb
+19
-6
qa/qa/specs/features/ee/browser_ui/secure/license_compliance_spec.rb
.../features/ee/browser_ui/secure/license_compliance_spec.rb
+36
-3
No files found.
ee/app/assets/javascripts/vue_shared/license_management/components/license_management_row.vue
View file @
56d4ffd2
...
...
@@ -55,7 +55,7 @@ export default {
};
</
script
>
<
template
>
<div>
<div
data-qa-selector=
"license_compliance_row"
>
<issue-status-icon
:status=
"status"
class=
"float-left append-right-default"
/>
<span
class=
"js-license-name"
data-qa-selector=
"license_name_content"
>
{{
license
.
name
}}
</span>
<div
class=
"float-right"
>
...
...
qa/qa/ee/page/project/settings/license_compliance.rb
View file @
56d4ffd2
...
...
@@ -21,9 +21,26 @@ module QA::EE
end
view
'ee/app/assets/javascripts/vue_shared/license_management/components/license_management_row.vue'
do
element
:license_compliance_row
element
:license_name_content
end
view
'app/assets/javascripts/reports/components/issue_status_icon.vue'
do
element
:icon_status
,
':data-qa-selector="`status_${status}_icon`" '
# rubocop:disable QA/ElementWithPattern
end
def
has_approved_license?
(
name
)
within_element
(
:license_compliance_row
,
text:
name
)
do
has_element?
(
:status_success_icon
)
end
end
def
has_denied_license?
(
name
)
within_element
(
:license_compliance_row
,
text:
name
)
do
has_element?
(
:status_failed_icon
)
end
end
def
approve_license
(
license
)
click_element
:license_add_button
expand_select_list
...
...
@@ -31,9 +48,7 @@ module QA::EE
click_element
:approved_license_radio
click_element
:add_license_submit_button
within_element
:license_compliance_list
do
has_element?
(
:license_name_content
,
text:
license
)
end
has_approved_license?
license
end
def
deny_license
(
license
)
...
...
@@ -43,9 +58,7 @@ module QA::EE
click_element
:blacklisted_license_radio
click_element
:add_license_submit_button
within_element
:license_compliance_list
do
has_element?
(
:license_name_content
,
text:
license
)
end
has_denied_license?
license
end
end
end
...
...
qa/qa/specs/features/ee/browser_ui/secure/license_compliance_spec.rb
View file @
56d4ffd2
...
...
@@ -4,10 +4,43 @@ require 'pathname'
module
QA
context
'Secure'
,
:docker
do
describe
'License Compliance'
do
let
(
:approved_license_name
)
{
"MIT"
}
let
(
:denied_license_name
)
{
"WTFPL"
}
describe
'License Compliance settings page'
do
before
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
perform
(
&
:sign_in_using_credentials
)
@project
=
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
Runtime
::
Env
.
auto_devops_project_name
||
'project-with-secure'
project
.
description
=
'Project with Secure'
end
@project
.
visit!
Page
::
Project
::
Menu
.
perform
(
&
:go_to_ci_cd_settings
)
Page
::
Project
::
Settings
::
CICD
.
perform
(
&
:expand_license_compliance
)
end
it
'can approve a license in the settings page'
do
QA
::
EE
::
Page
::
Project
::
Settings
::
LicenseCompliance
.
perform
do
|
license_compliance
|
license_compliance
.
approve_license
approved_license_name
expect
(
license_compliance
).
to
have_approved_license
approved_license_name
end
end
it
'can deny a license in the settings page'
do
QA
::
EE
::
Page
::
Project
::
Settings
::
LicenseCompliance
.
perform
do
|
license_compliance
|
license_compliance
.
deny_license
denied_license_name
expect
(
license_compliance
).
to
have_denied_license
denied_license_name
end
end
end
describe
'License Compliance pipeline reports'
do
let
(
:number_of_licenses_in_fixture
)
{
2
}
let
(
:approved_license_name
)
{
"MIT"
}
let
(
:denied_license_name
)
{
"WTFPL"
}
after
do
Service
::
DockerRun
::
GitlabRunner
.
new
(
@executor
).
remove!
...
...
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