@@ -16,20 +16,20 @@ describe('collection tests', () => {
1616 cy . login ( ) ;
1717 } ) ;
1818
19- it ( 'deletes an entire collection' , ( ) => {
19+ it ( 'delete an entire collection' , ( ) => {
2020 cy . galaxykit ( '-i collection upload test_namespace test_collection' ) ;
2121 cy . galaxykit ( 'task wait all' ) ;
2222
23- cy . visit ( `${ uiPrefix } repo/published /test_namespace/test_collection` ) ;
24-
23+ cy . visit ( `${ uiPrefix } repo/staging /test_namespace/test_collection` ) ;
24+ cy . wait ( 2000 ) ;
2525 cy . openHeaderKebab ( ) ;
2626 cy . get ( '[data-cy=delete-collection]' ) . click ( ) ;
2727 cy . get ( 'input[id=delete_confirm]' ) . click ( ) ;
2828 cy . get ( 'button' ) . contains ( 'Delete' ) . click ( ) ;
2929 cy . contains ( 'No collections yet' , { timeout : 10000 } ) ;
3030 } ) ;
3131
32- it ( 'deletes a collection version' , ( ) => {
32+ it ( 'delete a collection version' , ( ) => {
3333 cy . galaxykit ( '-i collection upload my_namespace my_collection' ) ;
3434 cy . galaxykit ( 'task wait all' ) ;
3535
@@ -38,9 +38,8 @@ describe('collection tests', () => {
3838 cy . intercept ( 'GET' , `${ apiPrefix } _ui/v1/namespaces/my_namespace/?*` ) . as (
3939 'reload' ,
4040 ) ;
41- cy . get (
42- `a[href*="${ uiPrefix } repo/published/my_namespace/my_collection"]` ,
43- ) . click ( ) ;
41+ cy . visit ( `${ uiPrefix } repo/staging/my_namespace/my_collection` ) ;
42+ cy . wait ( 3000 ) ;
4443 cy . openHeaderKebab ( ) ;
4544 cy . get ( '[data-cy=delete-collection-version]' ) . click ( ) ;
4645 cy . get ( 'input[id=delete_confirm]' ) . click ( ) ;
@@ -60,16 +59,16 @@ describe('collection tests', () => {
6059 const collection = `bar_${ rand } ` ;
6160 cy . galaxykit ( `-i collection upload ${ namespace } ${ collection } ` ) ;
6261 cy . galaxykit ( 'task wait all' ) ;
63- cy . visit ( `${ uiPrefix } repo/published /${ namespace } /${ collection } ` ) ;
64-
62+ cy . visit ( `${ uiPrefix } repo/staging /${ namespace } /${ collection } ` ) ;
63+ cy . wait ( 2000 ) ;
6564 cy . openHeaderKebab ( ) ;
6665 cy . get (
6766 '[data-cy="copy-collection-version-to-repository-dropdown"]' ,
6867 ) . click ( ) ;
6968
7069 cy . contains ( 'Select repositories' ) ;
7170 cy . get (
72- '[data-cy="ApproveModal-CheckboxRow-row-published "] .pf-c-table__check input' ,
71+ '[data-cy="ApproveModal-CheckboxRow-row-staging "] .pf-c-table__check input' ,
7372 ) . should ( 'be.disabled' ) ;
7473
7574 cy . get ( "[aria-label='name__icontains']" ) . type ( 'validate{enter}' ) ;
@@ -80,102 +79,145 @@ describe('collection tests', () => {
8079 cy . get ( '.pf-m-primary' ) . contains ( 'Select' ) . click ( ) ;
8180
8281 cy . get ( '[data-cy="AlertList"]' ) . contains (
83- `Started adding ${ namespace } .${ collection } v1.0.0 from "published " to repository "validated".` ,
82+ `Started adding ${ namespace } .${ collection } v1.0.0 from "staging " to repository "validated".` ,
8483 ) ;
8584 cy . galaxykit ( 'task wait all' ) ;
8685 cy . get ( '[data-cy="AlertList"]' ) . contains ( 'detail page' ) . click ( ) ;
8786 cy . contains ( 'Completed' ) ;
8887 } ) ;
8988
90- it ( 'deletes an collection from repository' , ( ) => {
89+ it ( 'delete a collection from repository' , ( ) => {
90+ const rand = Math . floor ( Math . random ( ) * 9999999 ) ;
91+ const namespace = `namespace_${ rand } ` ;
92+ const collection = `collection_${ rand } ` ;
93+ const repo = `repo_${ rand } ` ;
9194 cy . deleteNamespacesAndCollections ( ) ;
9295 cy . deleteRepositories ( ) ;
93- cy . galaxykit ( ' -i collection upload test_namespace test_repo_collection2' ) ;
94- cy . galaxykit ( ' repository create repo2 --pipeline approved' ) ;
95- cy . galaxykit ( ' distribution create repo2' ) ;
96+ cy . galaxykit ( ` -i collection upload ${ namespace } ${ collection } ` ) ;
97+ cy . galaxykit ( ` repository create ${ repo } --pipeline approved` ) ;
98+ cy . galaxykit ( ` distribution create ${ repo } ` ) ;
9699
97100 cy . galaxykit ( 'task wait all' ) ;
98- cy . galaxykit (
99- 'collection copy test_namespace test_repo_collection2 1.0.0 published repo2' ,
101+ cy . visit ( `${ uiPrefix } repo/staging/${ namespace } /${ collection } ` ) ;
102+ cy . wait ( 2000 ) ;
103+ cy . openHeaderKebab ( ) ;
104+ cy . get (
105+ '[data-cy="copy-collection-version-to-repository-dropdown"]' ,
106+ ) . click ( ) ;
107+ cy . get ( "[aria-label='name__icontains']" ) . type ( `${ repo } {enter}` ) ;
108+ cy . get (
109+ `[data-cy='ApproveModal-CheckboxRow-row-${ repo } '] .pf-c-table__check input` ,
110+ ) . check ( ) ;
111+
112+ cy . get ( '.pf-m-primary' ) . contains ( 'Select' ) . click ( ) ;
113+
114+ cy . get ( '[data-cy="AlertList"]' ) . contains (
115+ `Started adding ${ namespace } .${ collection } v1.0.0 from "staging" to repository "${ repo } ".` ,
100116 ) ;
117+ cy . galaxykit ( 'task wait all' ) ;
118+ cy . get ( '[data-cy="AlertList"]' ) . contains ( 'detail page' ) . click ( ) ;
119+ cy . contains ( 'Completed' ) ;
101120
102121 cy . visit ( `${ uiPrefix } collections?view_type=list` ) ;
103122 cy . contains ( 'Collections' ) ;
104- cy . contains ( '[data-cy="CollectionListItem"]' , 'published' ) ;
105- cy . contains ( '[data-cy="CollectionListItem"]' , 'repo2' ) ;
123+ cy . contains ( '[data-cy="CollectionListItem"]' , repo ) ;
106124
107125 cy . get ( '.collection-container [aria-label="Actions"]:first' ) . click ( {
108126 force : true ,
109127 } ) ;
110128 cy . contains ( 'Remove collection from repository' ) . click ( ) ;
111129 cy . get ( 'input[id=delete_confirm]' ) . click ( ) ;
112130 cy . get ( 'button' ) . contains ( 'Delete' ) . click ( ) ;
113- cy . contains (
114- 'Collection "test_repo_collection2" has been successfully deleted.' ,
115- {
116- timeout : 10000 ,
117- } ,
118- ) ;
119- cy . contains ( '[data-cy="CollectionListItem"]' , 'repo2' ) ;
120- cy . contains ( '[data-cy="CollectionListItem"]' , 'published' ) . should (
121- 'not.exist' ,
122- ) ;
123-
131+ cy . contains ( `Collection "${ collection } " has been successfully deleted.` , {
132+ timeout : 10000 ,
133+ } ) ;
134+ cy . contains ( 'Collections' ) ;
124135 cy . deleteAllCollections ( ) ;
125136 cy . deleteRepositories ( ) ;
126137 } ) ;
127138
128- it ( 'deletes an collection version from repository' , ( ) => {
139+ it ( 'delete a collection version from repository' , ( ) => {
140+ const rand = Math . floor ( Math . random ( ) * 9999999 ) ;
141+ const namespace = `namespace_${ rand } ` ;
142+ const collection = `collection_${ rand } ` ;
143+ const repo = `repo_${ rand } ` ;
129144 cy . deleteNamespacesAndCollections ( ) ;
130145 cy . deleteRepositories ( ) ;
131- cy . galaxykit ( ' repository create repo2 --pipeline approved' ) ;
132- cy . galaxykit ( ' distribution create repo2' ) ;
146+ cy . galaxykit ( ` repository create ${ repo } --pipeline approved` ) ;
147+ cy . galaxykit ( ` distribution create ${ repo } ` ) ;
133148
134- cy . galaxykit (
135- '-i collection upload test_namespace test_repo_collection_version2 1.0.0' ,
136- ) ;
149+ cy . galaxykit ( `-i collection upload ${ namespace } ${ collection } 1.0.0` ) ;
137150 cy . galaxykit ( 'task wait all' ) ;
138- cy . galaxykit (
139- 'collection copy test_namespace test_repo_collection_version2 1.0.0 published repo2' ,
140- ) ;
141151
142- cy . galaxykit (
143- '-i collection upload test_namespace test_repo_collection_version2 1.0.1' ,
152+ cy . visit ( `${ uiPrefix } repo/staging/${ namespace } /${ collection } ` ) ;
153+ cy . wait ( 3000 ) ;
154+ cy . openHeaderKebab ( ) ;
155+ cy . get (
156+ '[data-cy="copy-collection-version-to-repository-dropdown"]' ,
157+ ) . click ( ) ;
158+ cy . get ( "[aria-label='name__icontains']" ) . type ( `${ repo } {enter}` ) ;
159+ cy . get (
160+ `[data-cy='ApproveModal-CheckboxRow-row-${ repo } '] .pf-c-table__check input` ,
161+ ) . check ( ) ;
162+
163+ cy . get ( '.pf-m-primary' ) . contains ( 'Select' ) . click ( ) ;
164+
165+ cy . get ( '[data-cy="AlertList"]' ) . contains (
166+ `Started adding ${ namespace } .${ collection } v1.0.0 from "staging" to repository "${ repo } ".` ,
144167 ) ;
145168 cy . galaxykit ( 'task wait all' ) ;
146- cy . galaxykit (
147- 'collection copy test_namespace test_repo_collection_version2 1.0.1 published repo2' ,
169+ cy . get ( '[data-cy="AlertList"]' ) . contains ( 'detail page' ) . click ( ) ;
170+ cy . contains ( 'Completed' ) ;
171+
172+ cy . galaxykit ( `-i collection upload ${ namespace } ${ collection } 1.0.1` ) ;
173+ cy . galaxykit ( 'task wait all' ) ;
174+
175+ cy . visit ( `${ uiPrefix } repo/staging/${ namespace } /${ collection } ` ) ;
176+ cy . wait ( 3000 ) ;
177+ cy . openHeaderKebab ( ) ;
178+ cy . get (
179+ '[data-cy="copy-collection-version-to-repository-dropdown"]' ,
180+ ) . click ( ) ;
181+ cy . get ( "[aria-label='name__icontains']" ) . type ( `${ repo } {enter}` ) ;
182+ cy . get (
183+ `[data-cy='ApproveModal-CheckboxRow-row-${ repo } '] .pf-c-table__check input` ,
184+ ) . check ( ) ;
185+
186+ cy . get ( '.pf-m-primary' ) . contains ( 'Select' ) . click ( ) ;
187+
188+ cy . get ( '[data-cy="AlertList"]' ) . contains (
189+ `Started adding ${ namespace } .${ collection } v1.0.1 from "staging" to repository "${ repo } ".` ,
148190 ) ;
191+ cy . galaxykit ( 'task wait all' ) ;
192+ cy . get ( '[data-cy="AlertList"]' ) . contains ( 'detail page' ) . click ( ) ;
193+ cy . contains ( 'Completed' ) ;
149194
150195 cy . visit ( `${ uiPrefix } collections?view_type=list` ) ;
151196 cy . contains ( 'Collections' ) ;
152- cy . contains ( '[data-cy="CollectionListItem"]' , 'published' ) ;
153- cy . contains ( '[data-cy="CollectionListItem"]' , 'repo2' ) ;
154-
197+ cy . contains ( '[data-cy="CollectionListItem"]' , repo ) ;
155198 cy . visit (
156- `${ uiPrefix } repo/repo2/test_namespace/test_repo_collection_version2 /?version=1.0.0` ,
199+ `${ uiPrefix } repo/${ repo } / ${ namespace } / ${ collection } /?version=1.0.0` ,
157200 ) ;
158-
201+ cy . wait ( 3000 ) ;
159202 cy . openHeaderKebab ( ) ;
160203 cy . contains ( 'Remove version 1.0.0 from repository' ) . click ( ) ;
161204 cy . get ( 'input[id=delete_confirm]' ) . click ( ) ;
162205 cy . get ( 'button' ) . contains ( 'Delete' ) . click ( ) ;
163206 cy . contains (
164- ' Collection "test_repo_collection_version2 v1.0.0" has been successfully deleted.' ,
207+ ` Collection "${ collection } v1.0.0" has been successfully deleted.` ,
165208 {
166209 timeout : 10000 ,
167210 } ,
168211 ) ;
169212
170213 cy . visit (
171- `${ uiPrefix } repo/repo2/test_namespace/test_repo_collection_version2 /?version=1.0.0` ,
214+ `${ uiPrefix } repo/${ repo } / ${ namespace } / ${ collection } /?version=1.0.0` ,
172215 ) ;
173216 cy . contains ( `We couldn't find the page you're looking for!` ) ;
174-
175217 cy . visit (
176- `${ uiPrefix } repo/published/test_namespace/test_repo_collection_version2 /?version=1.0.0 ` ,
218+ `${ uiPrefix } repo/staging/ ${ namespace } / ${ collection } /?version=1.0.1 ` ,
177219 ) ;
178- cy . contains ( 'test_repo_collection_version2' ) ;
220+ cy . contains ( collection ) ;
179221 cy . contains ( `We couldn't find the page you're looking for!` ) . should (
180222 'not.exist' ,
181223 ) ;
0 commit comments