Skip to content

Commit 2227d69

Browse files
authored
Merge branch 'master' into fix-misc
2 parents 6431e6f + e42cc0b commit 2227d69

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tests/e2e/utils/auto.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,16 @@ async function dashboardDeleteFirstStudy(page, studyName) {
208208
await __filterStudiesByText(page, studyName);
209209
}
210210

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"]');
214221
}
215222

216223
async function openNode(page, pos) {

0 commit comments

Comments
 (0)