Skip to content

Commit f6258c4

Browse files
odeimaizmatusdrobuliak66
authored andcommitted
e2e: Update TIP test (#4625)
1 parent 5a9d5c6 commit f6258c4

File tree

3 files changed

+18
-22
lines changed

3 files changed

+18
-22
lines changed

tests/e2e/tutorials/ti-plan.js

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async function runTutorial() {
2727
await tutorial.closeQuickStart();
2828

2929
// create New Plan
30-
const studyData = await tutorial.startNewPlan();
30+
const studyData = await tutorial.startClassicTIPlan();
3131
studyId = studyData["data"]["uuid"];
3232

3333
// check the app mode steps
@@ -40,8 +40,8 @@ async function runTutorial() {
4040
const workbenchData = utils.extractWorkbenchData(studyData["data"]);
4141
console.log(workbenchData);
4242
const esId = workbenchData["nodeIds"][0];
43-
const tiId = workbenchData["nodeIds"][2];
44-
const ppId = workbenchData["nodeIds"][3];
43+
const tiId = workbenchData["nodeIds"][1];
44+
const ppId = workbenchData["nodeIds"][2];
4545

4646
// wait for the three services, except the optimizer
4747
await tutorial.waitForServices(
@@ -71,17 +71,8 @@ async function runTutorial() {
7171
await tutorial.waitFor(5000, "Finish Electrode Selector SetUp");
7272
await tutorial.takeScreenshot("electrodeSelector_after");
7373

74-
// Run optimizer
74+
// ti-postpro
7575
await tutorial.waitAndClick("AppMode_NextBtn");
76-
await tutorial.waitFor(5000, "Running Optimizer");
77-
await tutorial.takeScreenshot("optimizer_before");
78-
// one permutation should take less than 180"
79-
await tutorial.waitForStudyDone(studyId, 480000);
80-
await tutorial.takeScreenshot("optimizer_after");
81-
await tutorial.waitAndClick("preparingInputsCloseBtn");
82-
await tutorial.waitFor(2000, "Optimizer Finished");
83-
84-
// Load Post Pro Analysis
8576
await tutorial.takeScreenshot("postpro_start");
8677
// wait for iframe to be ready, it might take a while in Voila
8778
const postProIframe = await tutorial.waitForVoilaIframe(tiId);
@@ -90,15 +81,20 @@ async function runTutorial() {
9081

9182
await tutorial.waitFor(5000, "Extra waiting to make sure, again, it renders");
9283

84+
// Click "Run optimization" button
85+
const buttonsRunOptimization = await utils.getButtonsWithText(postProIframe, "Run Optimization");
86+
await buttonsRunOptimization[0].click();
87+
await tutorial.waitFor(20000, "Run Optimization");
88+
await tutorial.takeScreenshot("postpro_run_optimization");
9389
// Click "Load Analysis" button
9490
const buttonsLoadAnalysis = await utils.getButtonsWithText(postProIframe, "Load Analysis");
9591
await buttonsLoadAnalysis[0].click();
96-
await tutorial.waitFor(10000, "Loading anaylsis");
92+
await tutorial.waitFor(20000, "Loading anaylsis");
9793
await tutorial.takeScreenshot("postpro_load_analysis");
9894
// Click on the first "Load" button
9995
const buttonsLoad = await utils.getButtonsWithText(postProIframe, "Load");
10096
await buttonsLoad[1].click();
101-
await tutorial.waitFor(30000, "Loading Fields");
97+
await tutorial.waitFor(20000, "Loading Fields");
10298
await tutorial.takeScreenshot("postpro_load_field");
10399
// Click on the "Add to Report" buttons
104100
const buttonsAddToReport = await utils.getButtonsWithText(postProIframe, "Add to Report");

tests/e2e/tutorials/tutorialBase.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,25 +225,25 @@ class TutorialBase {
225225
return resp;
226226
}
227227

228-
async startNewPlan() {
229-
await this.takeScreenshot("startNewPlan_before");
228+
async startClassicTIPlan() {
229+
await this.takeScreenshot("startClassicTIPlan_before");
230230
this.__responsesQueue.addResponseListener("projects?from_study=");
231231
this.__responsesQueue.addResponseListener(":open");
232232
let resp = null;
233233
try {
234234
await this.waitFor(2000);
235-
await auto.dashboardNewPlan(this.__page);
235+
await auto.dashboardNewTIPlan(this.__page);
236236
await this.__responsesQueue.waitUntilResponse("projects?from_study=");
237237
resp = await this.__responsesQueue.waitUntilResponse(":open");
238238
const studyId = resp["data"]["uuid"];
239239
console.log("Study ID:", studyId);
240240
}
241241
catch (err) {
242-
console.error(`New Plan could not be started:\n`, err);
242+
console.error(`Classic TI could not be started:\n`, err);
243243
throw (err);
244244
}
245245
await this.waitFor(2000);
246-
await this.takeScreenshot("startNewPlan_after");
246+
await this.takeScreenshot("startClassicTIPlan_after");
247247
return resp;
248248
}
249249

tests/e2e/utils/auto.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ async function __dashboardServicesBrowser(page) {
109109
await utils.waitAndClick(page, '[osparc-test-id="servicesTabBtn"]');
110110
}
111111

112-
async function dashboardNewPlan(page) {
112+
async function dashboardNewTIPlan(page) {
113113
console.log("Creating New Plan");
114114

115115
await dashboardStudiesBrowser(page);
@@ -405,7 +405,7 @@ module.exports = {
405405
dashboardAbout,
406406
dashboardStudiesBrowser,
407407
dashboardPreferences,
408-
dashboardNewPlan,
408+
dashboardNewTIPlan,
409409
dashboardStartSim4LifeLite,
410410
dashboardOpenFirstTemplate,
411411
dashboardOpenService,

0 commit comments

Comments
 (0)