Skip to content

Commit

Permalink
filter studies by name before deleting them (#1629)
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz authored Jul 13, 2020
1 parent 9ec9d21 commit 0f26bc2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/e2e/tutorials/tutorialBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class TutorialBase {
await auto.toDashboard(this.__page);
await utils.takeScreenshot(this.__page, this.__templateName + "_dashboardDeleteFirstStudy_before");
this.__responsesQueue.addResponseListener("projects/");
await auto.dashboardDeleteFirstStudy(this.__page);
await auto.dashboardDeleteFirstStudy(this.__page, this.__templateName);
try {
await this.__responsesQueue.waitUntilResponse("projects/");
}
Expand Down
15 changes: 14 additions & 1 deletion tests/e2e/utils/auto.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ async function dashboardOpenFirstTemplate(page, templateName) {
await utils.waitAndClick(page, firstChildId);
}

async function __filterStudiesByText(page, studyName) {
console.log("Filtering by", studyName);

await utils.waitAndClick(page, '[osparc-test-id="studyFiltersTextFld"]')
await page.type('[osparc-test-id="studyFiltersTextFld"]', studyName)
await page.keyboard.press('Enter')
}

async function __filterTemplatesByText(page, templateName) {
console.log("Filtering by", templateName);

Expand Down Expand Up @@ -191,10 +199,15 @@ async function runStudy(page, waitFor = 0) {
await page.waitFor(waitFor);
}

async function dashboardDeleteFirstStudy(page) {
async function dashboardDeleteFirstStudy(page, studyName) {
console.log("Deleting first study")

await utils.waitAndClick(page, '[osparc-test-id="studiesTabBtn"]')

if (studyName) {
await __filterStudiesByText(page, studyName);
}

await utils.waitAndClick(page, '[osparc-test-id="userStudiesList"] > .qx-pb-listitem:nth-child(1) > [osparc-test-id="studyItemMenuButton"]')
await utils.waitAndClick(page, '[osparc-test-id="studyItemMenuDelete"]')
await utils.waitAndClick(page, '[osparc-test-id="confirmDeleteStudyBtn"]')
Expand Down

0 comments on commit 0f26bc2

Please sign in to comment.