You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added test scenarios for the license export feature
---------
Signed-off-by: Rajan Ravi <[email protected]>
Co-authored-by: Rajan Ravi <[email protected]>
@@ -36,38 +36,115 @@ Scenario: User Downloads license information for CycloneDX SBOM from SBOM Explor
36
36
Scenario: Verify the files on downloaded CycloneDX SBOM license ZIP
37
37
Given User has Downloaded the License information for CycloneDX SBOM
38
38
When User extracts the Downloaded license ZIP file
39
-
Then Extracted files should contain two CSVs, one for Package License combination and another one for License reference
39
+
Then Extracted files should contain two CSVs, one for Package license information and another one for License reference
40
40
41
41
Scenario: Verify the headers on CycloneDX SBOM package License CSV file
42
42
Given User extracted the CycloneDX SBOM license compressed file
43
-
When User Opens the package license combination file
44
-
Then The file should have the following headers - name, namespace, group, version, package reference, license, license name and alternate package reference
43
+
When User Opens the package license information file
44
+
Then The file should have the following headers - name, namespace, group, version, package reference, license id, license name, license expression and alternate package reference
45
45
46
46
Scenario: Verify the headers on CycloneDX SBOM License reference CSV file
47
47
Given User extracted the CycloneDX SBOM license compressed file
48
48
When User Opens the license reference file
49
49
Then The file should have the following headers - licenseId, name, extracted text and comment
50
50
51
-
Scenario: Verify the license information for a package on the CycloneDX SBOM with single license
52
-
Given User is on package license combination file
53
-
When User selects a package with Single license information
54
-
Then name column should contain the value of component.name field from SBOM json
55
-
And namespace column should be empty
56
-
And group column should contain the value of component.group field from SBOM json
57
-
And version column should contain the value of component.version field from SBOM json
58
-
And package reference column should contain the value of components.purl from SBOM json
59
-
And license column should contain the value of components.license.id field from SBOM json
60
-
And license name column should contain the value of components.license.name field from SBOM json
61
-
And alternate package reference column should be empty
62
-
63
-
Scenario: Verify the license information for a package on the CycloneDX SBOM with multiple licenses
64
-
Given User is on package license combination file
65
-
When User selects a package with multiple license information
66
-
Then Package should have Rows equivalent to number of licenses
67
-
And All the package rows should be loaded with identical values for the columns name, namespace, group, version, package
68
-
And License column should be loaded with the unique licenses of the package from SBOM json
69
-
70
51
Scenario: Verify the contents on CycloneDX SBOM license reference CSV file
71
52
Given User is on license reference file
72
-
When User selects a license from the list of licenses
73
53
Then The License reference CSV should be empty
54
+
55
+
Scenario: Verify the license information for a package on the CycloneDX SBOM with single license id
56
+
Given User is on SBOM license information file
57
+
When User selects a package with Single license id
58
+
Then "name" column should match "metadata.component.name" from SBOM
59
+
And "group" column should match "metadata.component.group" from SBOM
60
+
And "version" column should match "metadata.component.version" from SBOM
61
+
And "package reference" column should match "components.purl" from SBOM
62
+
And "license id" column should match "components.license.id" from SBOM
63
+
And The columns "namespace", "license name", "license expression", "alternate package reference" should be empty
64
+
65
+
Scenario: Verify the license information for a package on the CycloneDX SBOM with single license id with alternate package reference
66
+
Given User is on SBOM license information file
67
+
When User selects a package with Single license id with cpe information
68
+
Then "name" column should match "metadata.component.name" from SBOM
69
+
And "group" column should match "metadata.component.group" from SBOM
70
+
And "version" column should match metadata.component.version from SBOM
71
+
And "package reference" column should match "components.purl" from SBOM
72
+
And "license id" column should match "components.license.id" from SBOM
73
+
And "alternate package reference" column should match "components.cpe" from SBOM
74
+
And The columns "namespace", "license name", "license expression" should be empty
75
+
76
+
Scenario: Verify the license information for a package on the CycloneDX SBOM with single license name
77
+
Given User is on SBOM license information file
78
+
When User selects a package with Single license name
79
+
Then "name" column should match "metadata.component.name" from SBOM
80
+
And "group" column should match "metadata.component.group" from SBOM
81
+
And "version" column should match metadata.component.version from SBOM
82
+
And "package reference" column should match "components.purl" from SBOM
83
+
And "license name" column should match "components.license.name" from SBOM
84
+
And The columns "namespace", "license id", "license expression", "alternate package reference" should be empty
85
+
86
+
Scenario: Verify the license information for a package on the CycloneDX SBOM with single license name with alternate package reference
87
+
Given User is on SBOM license information file
88
+
When User selects a package with Single license id with cpe information
89
+
Then "name" column should match "metadata.component.name" from SBOM
90
+
And "group" column should match "metadata.component.group" from SBOM
91
+
And "version" column should match metadata.component.version from SBOM
92
+
And "package reference" column should match "components.purl" from SBOM
93
+
And "license name" column should match "components.license.name" from SBOM
94
+
And "alternate package reference" column should match "components.cpe" from SBOM
95
+
And The columns "namespace", "license id", "license expression" should be empty
96
+
97
+
Scenario: Verify the license information for a package on the CycloneDX SBOM with single license expression
98
+
Given User is on SBOM license information file
99
+
When User selects a package with Single license name
100
+
Then "name" column should match "metadata.component.name" from SBOM
101
+
And "group" column should match "metadata.component.group" from SBOM
102
+
And "version" column should match metadata.component.version from SBOM
103
+
And "package reference" column should match "components.purl" from SBOM
104
+
And "license expression" column should match "components.license.name" from SBOM
105
+
And The columns "namespace", "license id", "license name", "alternate package reference" should be empty
106
+
107
+
Scenario: Verify the license information for a package on the CycloneDX SBOM with single license expression with alternate package reference
108
+
Given User is on SBOM license information file
109
+
When User selects a package with Single license name
110
+
Then "name" column should match "metadata.component.name" from SBOM
111
+
And "group" column should match "metadata.component.group" from SBOM
112
+
And "version" column should match metadata.component.version from SBOM
113
+
And "package reference" column should match "components.purl" from SBOM
114
+
And "license expression" column should match "components.license.name" from SBOM
115
+
And "alternate package reference" column should match "components.cpe" from SBOM
116
+
And The columns "namespace", "license id", "license name" should be empty
117
+
118
+
Scenario: Verify the license information for a package on the CycloneDX SBOM with multiple license ids
119
+
Given User is on SBOM license information file
120
+
When User selects a package with multiple license sections
121
+
Then The report should have multiple rows for the same package corresponding to each license section
122
+
And Values on columns "name", "group", "version", "package reference" should be same for all the rows from SBOM
123
+
And "license id" for each row should match the value from the components.license.id field of the corresponding license section
124
+
And The columns "namespace", "license name", "license expression", "alternate package reference" should be empty
125
+
126
+
Scenario: Verify the license information for a package on the CycloneDX SBOM with multiple license names
127
+
Given User is on SBOM license information file
128
+
When User selects a package with multiple license sections
129
+
Then The report should have multiple rows for the same package corresponding to each license section
130
+
And Values on columns "name", "group", "version", "package reference", "alternate package reference" should be same for all the rows from SBOM
131
+
And "license id" for each row should match the value from the components.license.id field of the corresponding license section
132
+
And The columns "namespace", "license name", "license expression" should be empty
133
+
134
+
Scenario: Verify the license information for a package on the CycloneDX SBOM with license id and license name
135
+
Given User is on SBOM license information file
136
+
When User selects a package with multiple license sections
137
+
Then The report should have multiple rows for the same package corresponding to each license section
138
+
And Values on columns "name", "group", "version", "package reference" should be same for all the rows from SBOM
139
+
And Column "license id" should match "components.license.id" on one row and on the same row license.name column should be empty
140
+
And Column "license name" should match the "components.license.name" on another row and on the same row license.id column should be empty
141
+
And The columns "namespace","license expression", "alternate package reference" should be empty
142
+
143
+
Scenario: Verify CycloneDX SBOM level license information on license export
144
+
Given User is on SBOM license information file
145
+
Then "name" column should match "metadata.component.name" from SBOM
146
+
And "group" column should match "metadata.component.group" from SBOM
147
+
And "version" column should match "metadata.component.version" from SBOM
148
+
And "package reference" column should match "metadata.component.purl" from SBOM
149
+
And "license id" column should match "metadata.component.licenses.license.id" from SBOM
150
+
And The columns "namespace", "license name", "license expression", "alternate package reference" should be empty
Copy file name to clipboardExpand all lines: tests/features/licenseexport_spdx.feature
+37-22Lines changed: 37 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -36,41 +36,56 @@ Scenario: User Downloads license information for SPDX SBOM from SBOM Explorer pa
36
36
Scenario: Verify the files on downloaded SPDX SBOM license ZIP
37
37
Given User has Downloaded the License information for SPDX SBOM
38
38
When User extracts the Downloaded license ZIP file
39
-
Then Extracted files should contain two CSVs, one for Package License combination and another one for License reference
39
+
Then Extracted files should contain two CSVs, one for Package license information and another one for License reference
40
40
41
41
Scenario: Verify the headers on SPDX SBOM package License CSV file
42
42
Given User extracted the SPDX SBOM license compressed file
43
-
When User Opens the package license combination file
44
-
Then The file should have the following headers - name, namespace, group, version, package reference, license, license name and alternate package reference
43
+
When User Opens the package license information file
44
+
Then The file should have the following headers - name, namespace, group, version, package reference, license id, license name, license expression and alternate package reference
45
45
46
46
Scenario: Verify the headers on SPDX SBOM License reference CSV file
47
47
Given User extracted the SPDX SBOM license compressed file
48
48
When User Opens the license reference file
49
49
Then The file should have the following headers - licenseId, name, extracted text and comment
50
50
51
51
Scenario: Verify the license information for a package with single license
52
-
Given User is on package license combination file
52
+
Given User is on SBOM license information file
53
53
When User selects a package with Single license information
54
-
Then name column should contain the value of name field from SBOM json
55
-
And namespace column should contain the value of documentNamespace field from SBOM json
56
-
And group column should be empty
57
-
And version column should be empty
58
-
And package reference column should contain the value of packages.externalRefs.referenceLocator field for purl referenceType from SBOM json
59
-
And license column should contain the value of packages.licenseDeclared field from SBOM json
60
-
And license name column should be populated in reference to license reference CSV file
61
-
And alternate package reference column should contain the arrays of values of packages.externalRefs.referenceLocator field for referenceType other than purl
54
+
Then "name" column should match "name" from SBOM
55
+
And "namespace" column should match "documentNamespace" from SBOM
56
+
And "package reference" column should match "packages.externalRefs.referenceLocator" of "packages.externalRefs.referenceType" type purl from SBOM
57
+
And "license expression" column should match "packages.licenseDeclared" from SBOM
58
+
And The columns "group", "version", "license id", "license name", "alternate package reference" should be empty
62
59
63
-
Scenario: Verify the license information for a package with multiple licenses
64
-
Given User is on package license combination file
65
-
When User selects a package with multiple license information
66
-
Then Package should have Rows equivalent to number of licenses
67
-
And All the package rows should be loaded with identical values for the columns name, namespace, group, version, package
68
-
And License column should be loaded with the unique licenses of the package from SBOM json
60
+
Scenario: Verify the license information for a package with single license with alternate package reference referenceLocator
61
+
Given User is on SBOM license information file
62
+
When User selects a package with Single license information
63
+
Then "name" column should match "name" from SBOM
64
+
And "namespace" column should match "documentNamespace" from SBOM
65
+
And "package reference" column should match "packages.externalRefs.referenceLocator" of "packages.externalRefs.referenceType" purl from SBOM
66
+
And "license expression" column should match "packages.licenseDeclared" from SBOM
67
+
And "alternate package reference" column should match "packages.externalRefs.referenceLocator" of "packages.externalRefs.referenceType" type cpe from SBOM json
68
+
And The columns "group", "version", "license id", "license name" should be empty
69
+
70
+
Scenario: Verify the license information for a package with multiple licenses with alternate package reference referenceLocator
71
+
Given User is on SBOM license information file
72
+
When User selects a package with Single license information
73
+
Then "name" column should match "name" from SBOM
74
+
And "namespace" column should match "documentNamespace" from SBOM
75
+
And "package reference" column should match "packages.externalRefs.referenceLocator" of "packages.externalRefs.referenceType" purl from SBOM
76
+
And "license expression" column should match the whole value of "packages.licenseDeclared" from SBOM in a single row
77
+
And "alternate package reference" column should match "packages.externalRefs.referenceLocator" of "packages.externalRefs.referenceType" type cpe from SBOM json
78
+
And The columns "group", "version", "license id", "license name" should be empty
79
+
80
+
Scenario: Verify SPDX SBOM level license information on license export
81
+
Given User is on SBOM license information file
82
+
Then "name" column should match "name" from SBOM
83
+
And "namespace" column should match "documentNamespace" from SBOM
84
+
And "license expression" column should match the whole value from "packages.licenseDeclared" in a single row of the SBOM information under packages section
85
+
And "alternate package reference" column should contain the value of "packages.externalRefs.referenceLocator" field for cpe "packages.externalRefs.referenceType" from SBOM json
86
+
And The columns "group", "version", "package reference", "license id", "license name" should be empty
69
87
70
88
Scenario: Verify the contents on SPDX SBOM license reference CSV file
71
89
Given User is on license reference file
72
90
When User selects a license from the list of licenses
73
-
Then The unique values of licenceDeclared field from SPDX SBOM file should be listed
74
-
And licenseId column should be loaded with unique license id
75
-
And license column should be loaded with the name of the license
76
-
And extracted text and comment columns should be loaded in reference to the template file
91
+
Then Values hasExtractedLicensingInfos section of the SPDX SBOM json should be listed under the Reference CSV file
0 commit comments