@@ -8,20 +8,22 @@ import { runAccessibilityTests } from "../utils/accessibility";
8
8
9
9
let page : Page ;
10
10
11
- test . describe . serial ( "Link Scaffolded Templates to Catalog Items " , ( ) => {
11
+ test . describe . serial ( "Test Scaffolder Backend Module Annotator Actions " , ( ) => {
12
12
test . skip ( ( ) => process . env . JOB_NAME . includes ( "osd-gcp" ) ) ; // skipping due to RHIDP-5704 on OSD Env
13
13
let uiHelper : UIhelper ;
14
14
let common : Common ;
15
15
let catalogImport : CatalogImport ;
16
16
17
17
const template =
18
- "https://github.com/janus-qe/01- scaffolder-template/blob/main /01-scaffolder-template.yaml" ;
18
+ "https://github.com/backstage/community-plugins/blob/main/workspaces/scaffolder-backend-module-annotator/plugins/ scaffolder-backend-module-annotator/examples/templates /01-scaffolder-template.yaml" ;
19
19
20
20
const reactAppDetails = {
21
21
owner : "janus-qe/maintainers" ,
22
22
componentName : `test-scaffoldedfromlink-${ Date . now ( ) } ` ,
23
23
componentPartialName : `test-scaffoldedfromlink-` ,
24
24
description : "react app using template" ,
25
+ label : "some-label" ,
26
+ annotation : "some-annoation" ,
25
27
repo : `test-scaffolded-${ Date . now ( ) } ` ,
26
28
repoOwner : Buffer . from (
27
29
process . env . GITHUB_ORG || "amFudXMtcWU=" ,
@@ -66,6 +68,11 @@ test.describe.serial("Link Scaffolded Templates to Catalog Items", () => {
66
68
reactAppDetails . description ,
67
69
) ;
68
70
await uiHelper . fillTextInputByLabel ( "Owner" , reactAppDetails . owner ) ;
71
+ await uiHelper . fillTextInputByLabel ( "Label" , reactAppDetails . label ) ;
72
+ await uiHelper . fillTextInputByLabel (
73
+ "Annotation" ,
74
+ reactAppDetails . annotation ,
75
+ ) ;
69
76
await uiHelper . clickButton ( "Next" ) ;
70
77
71
78
await uiHelper . fillTextInputByLabel ( "Owner" , reactAppDetails . repoOwner ) ;
@@ -82,6 +89,12 @@ test.describe.serial("Link Scaffolded Templates to Catalog Items", () => {
82
89
await uiHelper . verifyRowInTableByUniqueText ( "Description" , [
83
90
reactAppDetails . description ,
84
91
] ) ;
92
+ await uiHelper . verifyRowInTableByUniqueText ( "Label" , [
93
+ reactAppDetails . label ,
94
+ ] ) ;
95
+ await uiHelper . verifyRowInTableByUniqueText ( "Annotation" , [
96
+ reactAppDetails . annotation ,
97
+ ] ) ;
85
98
await uiHelper . verifyRowInTableByUniqueText ( "Repository Location" , [
86
99
`github.com?owner=${ reactAppDetails . repoOwner } &repo=${ reactAppDetails . repo } ` ,
87
100
] ) ;
@@ -152,6 +165,60 @@ test.describe.serial("Link Scaffolded Templates to Catalog Items", () => {
152
165
await uiHelper . verifyText ( "Provide some simple information" ) ;
153
166
} ) ;
154
167
168
+ test ( "Verify Registered Template has templated label in entity Raw Yaml" , async ( ) => {
169
+ await uiHelper . openSidebar ( "Catalog" ) ;
170
+ await uiHelper . selectMuiBox ( "Kind" , "Template" ) ;
171
+
172
+ await uiHelper . searchInputPlaceholder ( "Create React App Template\n" ) ;
173
+ await uiHelper . verifyRowInTableByUniqueText ( "Create React App Template" , [
174
+ "website" ,
175
+ ] ) ;
176
+ await uiHelper . clickLink ( "Create React App Template" ) ;
177
+
178
+ await catalogImport . inspectEntityAndVerifyYaml (
179
+ `labels:\n custom: some-label\n` ,
180
+ ) ;
181
+
182
+ await uiHelper . clickLink ( "Launch Template" ) ;
183
+ await uiHelper . verifyText ( "Provide some simple information" ) ;
184
+ } ) ;
185
+
186
+ test ( "Verify Registered Template has templated annotation in entity Raw Yaml" , async ( ) => {
187
+ await uiHelper . openSidebar ( "Catalog" ) ;
188
+ await uiHelper . selectMuiBox ( "Kind" , "Template" ) ;
189
+
190
+ await uiHelper . searchInputPlaceholder ( "Create React App Template\n" ) ;
191
+ await uiHelper . verifyRowInTableByUniqueText ( "Create React App Template" , [
192
+ "website" ,
193
+ ] ) ;
194
+ await uiHelper . clickLink ( "Create React App Template" ) ;
195
+
196
+ await catalogImport . inspectEntityAndVerifyYaml (
197
+ `custom.io/annotation: backstage.io/some-annotation` ,
198
+ ) ;
199
+
200
+ await uiHelper . clickLink ( "Launch Template" ) ;
201
+ await uiHelper . verifyText ( "Provide some simple information" ) ;
202
+ } ) ;
203
+
204
+ test ( "Verify Registered Template has templated version in entity Raw Yaml" , async ( ) => {
205
+ await uiHelper . openSidebar ( "Catalog" ) ;
206
+ await uiHelper . selectMuiBox ( "Kind" , "Template" ) ;
207
+
208
+ await uiHelper . searchInputPlaceholder ( "Create React App Template\n" ) ;
209
+ await uiHelper . verifyRowInTableByUniqueText ( "Create React App Template" , [
210
+ "website" ,
211
+ ] ) ;
212
+ await uiHelper . clickLink ( "Create React App Template" ) ;
213
+
214
+ await catalogImport . inspectEntityAndVerifyYaml (
215
+ `backstage.io/template-version: 0.0.1` ,
216
+ ) ;
217
+
218
+ await uiHelper . clickLink ( "Launch Template" ) ;
219
+ await uiHelper . verifyText ( "Provide some simple information" ) ;
220
+ } ) ;
221
+
155
222
test . afterAll ( async ( ) => {
156
223
await APIHelper . githubRequest (
157
224
"DELETE" ,
0 commit comments