File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -208,9 +208,16 @@ async function dashboardDeleteFirstStudy(page, studyName) {
208
208
await __filterStudiesByText ( page , studyName ) ;
209
209
}
210
210
211
- await utils . waitAndClick ( page , '[osparc-test-id="userStudiesList"] > .qx-pb-listitem:nth-child(1) > [osparc-test-id="studyItemMenuButton"]' )
212
- await utils . waitAndClick ( page , '[osparc-test-id="studyItemMenuDelete"]' )
213
- await utils . waitAndClick ( page , '[osparc-test-id="confirmDeleteStudyBtn"]' )
211
+ await page . waitForSelector ( '[osparc-test-id="userStudiesList"]' )
212
+ const children = await utils . getVisibleChildrenIDs ( page , '[osparc-test-id="userStudiesList"]' ) ;
213
+ if ( children . length === 0 ) {
214
+ console . log ( "Deleting first Study: no study found" ) ;
215
+ return ;
216
+ }
217
+ const firstChildId = '[osparc-test-id="' + children [ 0 ] + '"]' ;
218
+ await utils . waitAndClick ( page , firstChildId + ' > [osparc-test-id="studyItemMenuButton"]' ) ;
219
+ await utils . waitAndClick ( page , '[osparc-test-id="studyItemMenuDelete"]' ) ;
220
+ await utils . waitAndClick ( page , '[osparc-test-id="confirmDeleteStudyBtn"]' ) ;
214
221
}
215
222
216
223
async function openNode ( page , pos ) {
You can’t perform that action at this time.
0 commit comments