diff --git a/services/web/client/source/class/osparc/component/filter/NodeTypeFilter.js b/services/web/client/source/class/osparc/component/filter/NodeTypeFilter.js index 6547d58662e..76e34125dfc 100644 --- a/services/web/client/source/class/osparc/component/filter/NodeTypeFilter.js +++ b/services/web/client/source/class/osparc/component/filter/NodeTypeFilter.js @@ -39,8 +39,6 @@ qx.Class.define("osparc.component.filter.NodeTypeFilter", { */ __buildMenu: function() { osparc.utils.Services.getTypes().forEach(serviceType => this._addOption(osparc.utils.Utils.capitalize(serviceType))); - this._addSeparator(); - osparc.utils.Services.getCategories().forEach(serviceCategory => this._addOption(osparc.utils.Utils.capitalize(serviceCategory))); } } }); diff --git a/services/web/client/source/class/osparc/component/filter/group/ServiceFilterGroup.js b/services/web/client/source/class/osparc/component/filter/group/ServiceFilterGroup.js index 7d618cd2539..4e9088077de 100644 --- a/services/web/client/source/class/osparc/component/filter/group/ServiceFilterGroup.js +++ b/services/web/client/source/class/osparc/component/filter/group/ServiceFilterGroup.js @@ -27,7 +27,7 @@ qx.Class.define("osparc.component.filter.group.ServiceFilterGroup", { */ construct: function(filterGroupId) { this.base(arguments); - this._setLayout(new qx.ui.layout.HBox()); + this._setLayout(new qx.ui.layout.HBox(5)); this.__filterGroupId = filterGroupId; const textFilter = this.__textFilter = new osparc.component.filter.TextFilter("text", filterGroupId); osparc.utils.Utils.setIdToWidget(textFilter, "serviceFiltersTextFld"); diff --git a/services/web/client/source/class/osparc/component/filter/group/StudyFilterGroup.js b/services/web/client/source/class/osparc/component/filter/group/StudyFilterGroup.js index 033cd093db7..d21a9a1403a 100644 --- a/services/web/client/source/class/osparc/component/filter/group/StudyFilterGroup.js +++ b/services/web/client/source/class/osparc/component/filter/group/StudyFilterGroup.js @@ -18,7 +18,7 @@ qx.Class.define("osparc.component.filter.group.StudyFilterGroup", { */ construct: function(filterGroupId) { this.base(arguments); - this._setLayout(new qx.ui.layout.HBox()); + this._setLayout(new qx.ui.layout.HBox(5)); this.__textFilter = new osparc.component.filter.TextFilter("text", filterGroupId); this.__textFilter.getChildControl("textfield").setFont("text-14"); diff --git a/services/web/client/source/class/osparc/component/node/BaseNodeView.js b/services/web/client/source/class/osparc/component/node/BaseNodeView.js index e0b89a30e03..740766339fa 100644 --- a/services/web/client/source/class/osparc/component/node/BaseNodeView.js +++ b/services/web/client/source/class/osparc/component/node/BaseNodeView.js @@ -110,6 +110,7 @@ qx.Class.define("osparc.component.node.BaseNodeView", { collapsedMinWidth: collapsedWidth, collapsedWidth: collapsedWidth }); + sidePanel.getLayout().resetSeparator(); const sideHeader = new qx.ui.toolbar.ToolBar(); const titlePart = new qx.ui.toolbar.Part(); diff --git a/services/web/client/source/class/osparc/component/service/ServiceJumbo.js b/services/web/client/source/class/osparc/component/service/ServiceJumbo.js index 0f34f4b7d45..40deac7db0e 100644 --- a/services/web/client/source/class/osparc/component/service/ServiceJumbo.js +++ b/services/web/client/source/class/osparc/component/service/ServiceJumbo.js @@ -63,9 +63,8 @@ qx.Class.define("osparc.component.service.ServiceJumbo", { } } if (data.tags && data.tags.length) { - const category = this.getServiceModel().getCategory ? this.getServiceModel().getCategory() : ""; const type = this.getServiceModel().getType() || ""; - if (!data.tags.includes(osparc.utils.Utils.capitalize(category.trim())) && !data.tags.includes(osparc.utils.Utils.capitalize(type.trim()))) { + if (!data.tags.includes(osparc.utils.Utils.capitalize(type.trim()))) { return true; } } diff --git a/services/web/client/source/class/osparc/component/service/manager/ActivityManager.js b/services/web/client/source/class/osparc/component/service/manager/ActivityManager.js index 7e97008a273..aa31dcace63 100644 --- a/services/web/client/source/class/osparc/component/service/manager/ActivityManager.js +++ b/services/web/client/source/class/osparc/component/service/manager/ActivityManager.js @@ -48,7 +48,7 @@ qx.Class.define("osparc.component.service.manager.ActivityManager", { const filtersPart = new qx.ui.toolbar.Part(); toolbar.add(filtersPart); - const filtersContainer = new qx.ui.container.Composite(new qx.ui.layout.HBox()); + const filtersContainer = new qx.ui.container.Composite(new qx.ui.layout.HBox(5)); const nameFilter = new osparc.component.filter.TextFilter("name", "activityMonitor"); const studyFilter = this.__studyFilter = new osparc.component.filter.StudyFilter("study", "activityMonitor"); filtersContainer.add(nameFilter); diff --git a/services/web/client/source/class/osparc/component/widget/Thumbnail.js b/services/web/client/source/class/osparc/component/widget/Thumbnail.js index d36fc310a97..fa18d9cbaeb 100644 --- a/services/web/client/source/class/osparc/component/widget/Thumbnail.js +++ b/services/web/client/source/class/osparc/component/widget/Thumbnail.js @@ -72,11 +72,11 @@ qx.Class.define("osparc.component.widget.Thumbnail", { } [ - "changeSource", + "appear", "loaded" ].forEach(eventName => { image.addListener(eventName, e => { - this.__calculateMaxHeight(); + this.recheckSize(); }, this); }); }, @@ -102,14 +102,20 @@ qx.Class.define("osparc.component.widget.Thumbnail", { return control || this.base(arguments, id); }, - __calculateMaxHeight: function() { + recheckSize: function() { const image = this.getChildControl("image"); const source = image.getSource(); if (source) { - const width = qx.io.ImageLoader.getWidth(source); - const height = qx.io.ImageLoader.getHeight(source); - if (width && height) { - const aspectRatio = width/height; + const srcWidth = qx.io.ImageLoader.getWidth(source); + const srcHeight = qx.io.ImageLoader.getHeight(source); + if (srcWidth && srcHeight) { + const aspectRatio = srcWidth/srcHeight; + if (this.getBounds() && this.getBounds().width < image.getMaxWidth()) { + image.setMaxWidth(this.getBounds().width); + } + if (this.getBounds() && this.getBounds().height < image.getMaxHeight()) { + image.setMaxHeight(this.getBounds().height); + } const maxWidth = image.getMaxWidth(); const maxHeight = image.getMaxHeight(); diff --git a/services/web/client/source/class/osparc/component/workbench/NodeUI.js b/services/web/client/source/class/osparc/component/workbench/NodeUI.js index 812858d34ae..71307adfaa7 100644 --- a/services/web/client/source/class/osparc/component/workbench/NodeUI.js +++ b/services/web/client/source/class/osparc/component/workbench/NodeUI.js @@ -140,15 +140,11 @@ qx.Class.define("osparc.component.workbench.NodeUI", { control = new qx.ui.container.Composite(new qx.ui.layout.Flow(3, 3)).set({ margin: [3, 4] }); - const category = this.getNode().isContainer() ? null : osparc.utils.Services.getCategory(this.getNode().getMetaData().category); const nodeType = this.getNode().isContainer() ? "container" : this.getNode().getMetaData().type; const type = osparc.utils.Services.getType(nodeType); if (type) { control.add(new osparc.ui.basic.Chip(type.label, type.icon + "12")); } - if (category) { - control.add(new osparc.ui.basic.Chip(category.label, category.icon + "12")); - } this.add(control, { row: 1, column: 0 diff --git a/services/web/client/source/class/osparc/component/workbench/WorkbenchUI.js b/services/web/client/source/class/osparc/component/workbench/WorkbenchUI.js index 0681a673460..2501f888f00 100644 --- a/services/web/client/source/class/osparc/component/workbench/WorkbenchUI.js +++ b/services/web/client/source/class/osparc/component/workbench/WorkbenchUI.js @@ -139,7 +139,7 @@ qx.Class.define("osparc.component.workbench.WorkbenchUI", { TOP_OFFSET: osparc.navigation.NavigationBar.HEIGHT + 46, - ZoomValues: [0.25, 0.4, 0.5, 0.6, 0.8, 1, 1.25, 1.5, 2, 3] + ZOOM_VALUES: [0.25, 0.4, 0.5, 0.6, 0.8, 1, 1.25, 1.5, 2, 3] }, events: { @@ -156,7 +156,7 @@ qx.Class.define("osparc.component.workbench.WorkbenchUI", { }, scale: { - check: "osparc.component.workbench.WorkbenchUI.ZoomValues", + check: "osparc.component.workbench.WorkbenchUI.ZOOM_VALUES", init: 1, apply: "__applyScale", event: "changeScale", @@ -178,8 +178,7 @@ qx.Class.define("osparc.component.workbench.WorkbenchUI", { __svgWidgetDrop: null, __tempEdgeNodeId: null, __tempEdgeRepr: null, - __pointerPosX: null, - __pointerPosY: null, + __pointerPos: null, __selectedItemId: null, __currentModel: null, __startHint: null, @@ -201,16 +200,19 @@ qx.Class.define("osparc.component.workbench.WorkbenchUI", { return zoomToolbar; }, - __getZoomBtn: function(icon) { + __getZoomBtn: function(icon, tooltip) { const btn = new qx.ui.toolbar.Button(null, icon+"/18").set({ width: ZOOM_BUTTON_SIZE, height: ZOOM_BUTTON_SIZE }); + if (tooltip) { + btn.setToolTipText(tooltip); + } return btn; }, __getZoomInButton: function() { - const btn = this.__getZoomBtn("@MaterialIcons/zoom_in"); + const btn = this.__getZoomBtn("@MaterialIcons/zoom_in", this.tr("Zoom In")); btn.addListener("execute", () => { this.__zoom(true); }, this); @@ -218,7 +220,7 @@ qx.Class.define("osparc.component.workbench.WorkbenchUI", { }, __getZoomOutButton: function() { - const btn = this.__getZoomBtn("@MaterialIcons/zoom_out"); + const btn = this.__getZoomBtn("@MaterialIcons/zoom_out", this.tr("Zoom Out")); btn.addListener("execute", () => { this.__zoom(false); }, this); @@ -226,7 +228,7 @@ qx.Class.define("osparc.component.workbench.WorkbenchUI", { }, __getZoomResetButton: function() { - const btn = this.__getZoomBtn("@MaterialIcons/find_replace"); + const btn = this.__getZoomBtn("@MaterialIcons/find_replace", this.tr("Reset Zoom")); btn.addListener("execute", () => { this.setScale(1); }, this); @@ -234,7 +236,7 @@ qx.Class.define("osparc.component.workbench.WorkbenchUI", { }, __getZoomAllButton: function() { - const btn = this.__getZoomBtn("@MaterialIcons/zoom_out_map"); + const btn = this.__getZoomBtn("@MaterialIcons/zoom_out_map", this.tr("Zoom All")); btn.addListener("execute", () => { this.__zoomAll(); }, this); @@ -596,12 +598,8 @@ qx.Class.define("osparc.component.workbench.WorkbenchUI", { let dragNodeId = data.nodeId; if (this.__tempEdgeNodeId === dragNodeId) { - const winPos = this.__unscaleCoordinates(this.__pointerPosX, this.__pointerPosY); - const srvPos = { - x: this.__pointerPosX, - y: this.__pointerPosY - }; - const srvCat = this.__createServiceCatalog(winPos, srvPos); + const winPos = this.__unscaleCoordinates(this.__pointerPos.x, this.__pointerPos.y); + const srvCat = this.__createServiceCatalog(winPos, this.__pointerPos); if (this.__tempEdgeIsInput === true) { srvCat.setContext(dragNodeId, this.getNodeUI(dragNodeId).getInputPort()); } else { @@ -770,8 +768,10 @@ qx.Class.define("osparc.component.workbench.WorkbenchUI", { const scrollX = this.__workbenchLayoutScroll.getScrollX(); const scrollY = this.__workbenchLayoutScroll.getScrollY(); const scaledScroll = this.__scaleCoordinates(scrollX, scrollY); - this.__pointerPosX = scaledPos.x + scaledScroll.x; - this.__pointerPosY = scaledPos.y + scaledScroll.y; + this.__pointerPos = { + x: scaledPos.x + scaledScroll.x, + y: scaledPos.y + scaledScroll.y + }; let portPos = nodeUI.getEdgePoint(port); if (portPos[0] === null) { @@ -783,15 +783,15 @@ qx.Class.define("osparc.component.workbench.WorkbenchUI", { let x2; let y2; if (port.isInput) { - x1 = this.__pointerPosX; - y1 = this.__pointerPosY; + x1 = this.__pointerPos.x; + y1 = this.__pointerPos.y; x2 = portPos[0]; y2 = portPos[1]; } else { x1 = portPos[0]; y1 = portPos[1]; - x2 = this.__pointerPosX; - y2 = this.__pointerPosY; + x2 = this.__pointerPos.x; + y2 = this.__pointerPos.y; } if (this.__tempEdgeRepr === null) { @@ -807,8 +807,7 @@ qx.Class.define("osparc.component.workbench.WorkbenchUI", { } this.__tempEdgeRepr = null; this.__tempEdgeNodeId = null; - this.__pointerPosX = null; - this.__pointerPosY = null; + this.__pointerPos = null; }, __getEdgePoints: function(node1, port1, node2, port2) { @@ -1001,13 +1000,14 @@ qx.Class.define("osparc.component.workbench.WorkbenchUI", { }; }, - __mouseWheel: function(e) { - this.__zoom(e.getWheelDelta() < 0); + this.__pointerPos = this.__pointerEventToWorkbenchPos(e, false); + const zoomIn = e.getWheelDelta() < 0; + this.__zoom(zoomIn); }, __zoom: function(zoomIn = true) { - const zoomValues = this.self().ZoomValues; + const zoomValues = this.self().ZOOM_VALUES; const nextItem = () => { const i = zoomValues.indexOf(this.getScale()); if (i+1 { this.resetSelectedNodes(); + this.__selectedItemChanged(null); }, this); - this.__workbenchLayout.addListener("dbltap", e => { + this.__workbenchLayout.addListener("dbltap", pointerEvent => { if (this.getStudy().isReadOnly()) { return; } - const winPos = this.__pointerEventToWorkbenchPos(e, false); - const scaledPos = this.__pointerEventToWorkbenchPos(e, true); + const winPos = this.__pointerEventToWorkbenchPos(pointerEvent, false); + const scaledPos = this.__pointerEventToWorkbenchPos(pointerEvent, true); const srvCat = this.__createServiceCatalog(winPos, scaledPos); srvCat.open(); }, this); this.__workbenchLayout.addListener("resize", () => this.__updateHint(), this); - - this.__workbenchLayout.addListener("tap", e => { - this.__selectedItemChanged(null); - }, this); }, __allowDrag: function(pointerEvent) { @@ -1177,27 +1174,27 @@ qx.Class.define("osparc.component.workbench.WorkbenchUI", { return files.length === 1; }, - __dragEnter: function(e) { - this.__dragging(e, true); + __dragEnter: function(pointerEvent) { + this.__dragging(pointerEvent, true); }, - __dragOver: function(e) { - this.__dragging(e, true); + __dragOver: function(pointerEvent) { + this.__dragging(pointerEvent, true); }, - __dragLeave: function(e) { - this.__dragging(e, false); + __dragLeave: function(pointerEvent) { + this.__dragging(pointerEvent, false); }, - __drop: function(e) { - this.__dragging(e, false); + __drop: function(pointerEvent) { + this.__dragging(pointerEvent, false); - if (this.__allowDropFile(e)) { + if (this.__allowDropFile(pointerEvent)) { const pos = { - x: e.offsetX, - y: e.offsetY + x: pointerEvent.offsetX, + y: pointerEvent.offsetY }; - const fileList = e.dataTransfer.files; + const fileList = pointerEvent.dataTransfer.files; if (fileList.length) { const data = { service: qx.data.marshal.Json.createModel(osparc.utils.Services.getFilePicker()) diff --git a/services/web/client/source/class/osparc/dashboard/ServiceBrowserListItem.js b/services/web/client/source/class/osparc/dashboard/ServiceBrowserListItem.js index 27e2f7fb39e..d18fe367fbe 100644 --- a/services/web/client/source/class/osparc/dashboard/ServiceBrowserListItem.js +++ b/services/web/client/source/class/osparc/dashboard/ServiceBrowserListItem.js @@ -261,10 +261,9 @@ qx.Class.define("osparc.dashboard.ServiceBrowserListItem", { return true; } } - if (data.tags && data.tags.length && this.getCategory()) { - const category = this.getCategory() || ""; + if (data.tags && data.tags.length) { const type = this.getType() || ""; - if (!data.tags.includes(osparc.utils.Utils.capitalize(category.trim())) && !data.tags.includes(osparc.utils.Utils.capitalize(type.trim()))) { + if (!data.tags.includes(osparc.utils.Utils.capitalize(type.trim()))) { return true; } } diff --git a/services/web/client/source/class/osparc/dashboard/StudyBrowserButtonBase.js b/services/web/client/source/class/osparc/dashboard/StudyBrowserButtonBase.js index a9eb1c8206f..46031115f36 100644 --- a/services/web/client/source/class/osparc/dashboard/StudyBrowserButtonBase.js +++ b/services/web/client/source/class/osparc/dashboard/StudyBrowserButtonBase.js @@ -39,7 +39,7 @@ qx.Class.define("osparc.dashboard.StudyBrowserButtonBase", { this._setLayout(new qx.ui.layout.Canvas()); - const mainLayout = this._mainLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox(6)).set({ + const mainLayout = this._mainLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox(this.self().V_SPACING)).set({ maxWidth: this.self().ITEM_WIDTH - 2*this.self().PADDING, maxHeight: this.self().ITEM_HEIGHT - 2*this.self().PADDING }); @@ -58,6 +58,7 @@ qx.Class.define("osparc.dashboard.StudyBrowserButtonBase", { ITEM_WIDTH: 190, ITEM_HEIGHT: 220, PADDING: 10, + V_SPACING: 6, SPACING: 12, POS: { TITLE: 0, @@ -128,11 +129,11 @@ qx.Class.define("osparc.dashboard.StudyBrowserButtonBase", { } case "icon": { const maxWidth = this.self().ITEM_WIDTH - 2*this.self().PADDING; - const image = new osparc.component.widget.Thumbnail(null, maxWidth, 124); - control = image.getChildControl("image").set({ + control = new osparc.component.widget.Thumbnail(null, maxWidth, 124); + control.getChildControl("image").set({ anonymous: true }); - this._mainLayout.addAt(image, this.self().POS.THUMBNAIL, { + this._mainLayout.addAt(control, this.self().POS.THUMBNAIL, { flex: 1 }); break; @@ -159,10 +160,28 @@ qx.Class.define("osparc.dashboard.StudyBrowserButtonBase", { }, _applyIcon: function(value, old) { - let icon = this.getChildControl("icon"); - icon.set({ + const iconLayout = this.getChildControl("icon"); + const image = iconLayout.getChildControl("image"); + image.set({ source: value }); + + [ + "appear", + "loaded" + ].forEach(eventName => { + image.addListener(eventName, () => { + let maxHeight = this.self().ITEM_HEIGHT - 2*this.self().PADDING; + // eslint-disable-next-line no-underscore-dangle + this._mainLayout._getChildren().forEach(child => { + if (child.getSubcontrolId() !== "icon") { + maxHeight -= (child.getBounds().height + 6); + } + }); + iconLayout.setMaxHeight(maxHeight); + iconLayout.recheckSize(); + }, this); + }); }, /** diff --git a/services/web/client/source/class/osparc/desktop/ControlsBar.js b/services/web/client/source/class/osparc/desktop/ControlsBar.js index 8f1d743f711..a7b71292733 100644 --- a/services/web/client/source/class/osparc/desktop/ControlsBar.js +++ b/services/web/client/source/class/osparc/desktop/ControlsBar.js @@ -42,7 +42,6 @@ qx.Class.define("osparc.desktop.ControlsBar", { }, events: { - "showSweeper": "qx.event.type.Event", "showWorkbench": "qx.event.type.Event", "showSettings": "qx.event.type.Event", "groupSelection": "qx.event.type.Event", @@ -95,21 +94,6 @@ qx.Class.define("osparc.desktop.ControlsBar", { if (osparc.data.Permissions.getInstance().canDo("study.node.grouping")) { this.add(groupCtrls); } - - const moreCtrls = new qx.ui.toolbar.Part(); - osparc.data.model.Sweeper.isSweeperEnabled() - .then(isSweeperEnabled => { - if (isSweeperEnabled) { - const sweeperButton = this.__createShowSweeperButton(); - moreCtrls.add(sweeperButton); - } - }); - this.add(moreCtrls); - }, - - __createShowSweeperButton: function() { - const parametersButton = this.__createButton(this.tr("Sweeper"), "paw", "showSweeperButton", "showSweeper"); - return parametersButton; }, __createWorkbenchButton: function() { diff --git a/services/web/client/source/class/osparc/desktop/SlideShowToolbar.js b/services/web/client/source/class/osparc/desktop/SlideShowToolbar.js index fb95e24471a..a6563b194b3 100644 --- a/services/web/client/source/class/osparc/desktop/SlideShowToolbar.js +++ b/services/web/client/source/class/osparc/desktop/SlideShowToolbar.js @@ -47,7 +47,7 @@ qx.Class.define("osparc.desktop.SlideShowToolbar", { }, // overriden - _populateGuidedNodesLayout: function() { + _populateNodesNavigationLayout: function() { const study = this.getStudy(); if (study) { const slideShow = study.getUi().getSlideshow(); diff --git a/services/web/client/source/class/osparc/desktop/Toolbar.js b/services/web/client/source/class/osparc/desktop/Toolbar.js index 4a9ae991841..58e98867a2c 100644 --- a/services/web/client/source/class/osparc/desktop/Toolbar.js +++ b/services/web/client/source/class/osparc/desktop/Toolbar.js @@ -92,11 +92,11 @@ qx.Class.define("osparc.desktop.Toolbar", { __applyStudy: function(study) { if (study) { study.getUi().addListener("changeCurrentNodeId", () => { - this._populateGuidedNodesLayout(); + this._populateNodesNavigationLayout(); }); this._startStopBtns.setVisibility(study.isReadOnly() ? "excluded" : "visible"); - this._populateGuidedNodesLayout(); + this._populateNodesNavigationLayout(); } }, @@ -104,7 +104,7 @@ qx.Class.define("osparc.desktop.Toolbar", { throw new Error("Abstract method called!"); }, - _populateGuidedNodesLayout: function() { + _populateNodesNavigationLayout: function() { throw new Error("Abstract method called!"); } } diff --git a/services/web/client/source/class/osparc/desktop/WorkbenchToolbar.js b/services/web/client/source/class/osparc/desktop/WorkbenchToolbar.js index 54c261ffcd7..337b001ec79 100644 --- a/services/web/client/source/class/osparc/desktop/WorkbenchToolbar.js +++ b/services/web/client/source/class/osparc/desktop/WorkbenchToolbar.js @@ -24,15 +24,51 @@ qx.Class.define("osparc.desktop.WorkbenchToolbar", { this.__attachEventHandlers(); }, + events: { + "showSweeper": "qx.event.type.Event" + }, + members: { + _createChildControlImpl: function(id) { + let control; + switch (id) { + case "sweeper-btn": { + control = new qx.ui.form.Button(this.tr("Sweeper"), "@FontAwesome5Solid/paw/14").set({ + toolTipText: this.tr("Sweeper"), + icon: "@FontAwesome5Solid/paw/14", + ...osparc.navigation.NavigationBar.BUTTON_OPTIONS, + allowGrowX: false + }); + control.addListener("execute", e => { + this.fireDataEvent("showSweeper"); + }, this); + this._add(control); + break; + } + } + return control || this.base(arguments, id); + }, + // overriden _buildLayout: function() { this.getChildControl("breadcrumb-navigation"); + + this._add(new qx.ui.core.Spacer(20)); + + const sweeperBtn = this.getChildControl("sweeper-btn"); + sweeperBtn.exclude(); + osparc.data.model.Sweeper.isSweeperEnabled() + .then(isSweeperEnabled => { + if (isSweeperEnabled) { + sweeperBtn.show(); + } + }); + this._startStopBtns = this.getChildControl("start-stop-btns"); }, // overriden - _populateGuidedNodesLayout: function() { + _populateNodesNavigationLayout: function() { const study = this.getStudy(); if (study) { const nodeIds = study.getWorkbench().getPathIds(study.getUi().getCurrentNodeId()); diff --git a/services/web/client/source/class/osparc/desktop/WorkbenchView.js b/services/web/client/source/class/osparc/desktop/WorkbenchView.js index ffd24418fc7..2e6dc771e0f 100644 --- a/services/web/client/source/class/osparc/desktop/WorkbenchView.js +++ b/services/web/client/source/class/osparc/desktop/WorkbenchView.js @@ -281,7 +281,6 @@ qx.Class.define("osparc.desktop.WorkbenchView", { }, this); const controlsBar = this.__mainPanel.getControls(); - controlsBar.addListener("showSweeper", this.__showSweeper, this); controlsBar.addListener("showWorkbench", this.__showWorkbenchUI, this); controlsBar.addListener("showSettings", this.__showSettings, this); controlsBar.addListener("groupSelection", this.__groupSelection, this); @@ -439,6 +438,7 @@ qx.Class.define("osparc.desktop.WorkbenchView", { this.nodeSelected(nodeId); }, this); }); + workbenchToolbar.addListener("showSweeper", this.__showSweeper, this); nodesTree.addListener("changeSelectedNode", e => { const node = workbenchUI.getNodeUI(e.getData()); diff --git a/services/web/client/source/class/osparc/utils/Services.js b/services/web/client/source/class/osparc/utils/Services.js index 96f96e33f27..da5bda24914 100644 --- a/services/web/client/source/class/osparc/utils/Services.js +++ b/services/web/client/source/class/osparc/utils/Services.js @@ -32,34 +32,6 @@ qx.Class.define("osparc.utils.Services", { type: "static", statics: { - - CATEGORIES: { - postpro: { - label: "Postpro", - icon: "@FontAwesome5Solid/chart-bar/" - }, - notebook: { - label: "Notebook", - icon: "@FontAwesome5Solid/file-code/" - }, - solver: { - label: "Solver", - icon: "@FontAwesome5Solid/calculator/" - }, - simulator: { - label: "Simulator", - icon: "@FontAwesome5Solid/brain/" - }, - modeling: { - label: "Modeling", - icon: "@FontAwesome5Solid/cube/" - }, - data: { - label: "Data", - icon: "@FontAwesome5Solid/file/" - } - }, - TYPES: { computational: { label: "Computational", @@ -81,14 +53,6 @@ qx.Class.define("osparc.utils.Services", { return Object.keys(this.TYPES); }, - getCategories: function() { - return Object.keys(this.CATEGORIES); - }, - - getCategory: function(category) { - return this.CATEGORIES[category.trim().toLowerCase()]; - }, - getType: function(type) { return this.TYPES[type.trim().toLowerCase()]; }, @@ -229,184 +193,13 @@ qx.Class.define("osparc.utils.Services", { }, __addExtraInfo: function(services) { - const categories = this.__getCategories(); Object.values(services).forEach(serviceWVersion => { Object.values(serviceWVersion).forEach(service => { - if (Object.prototype.hasOwnProperty.call(categories, service["key"])) { - service["category"] = categories[service["key"]]["category"]; - } else { - service["category"] = "Unknown"; - } if (osparc.data.model.Node.isComputational(service)) { osparc.component.metadata.Quality.attachQualityToObject(service); } }); }); - }, - - __getCategories: function() { - return { - "simcore/services/frontend/file-picker": { - "category": "Data" - }, - "simcore/services/dynamic/mattward-viewer": { - "category": "Solver" - }, - "simcore/services/dynamic/bornstein-viewer": { - "category": "Solver" - }, - "simcore/services/dynamic/cc-0d-viewer": { - "category": "PostPro" - }, - "simcore/services/dynamic/cc-1d-viewer": { - "category": "PostPro" - }, - "simcore/services/dynamic/cc-2d-viewer": { - "category": "PostPro" - }, - "simcore/services/dynamic/raw-graphs": { - "category": "PostPro" - }, - "simcore/services/dynamic/3d-viewer": { - "category": "PostPro" - }, - "simcore/services/dynamic/3d-viewer-gpu": { - "category": "PostPro" - }, - "simcore/services/dynamic/jupyter-r-notebook": { - "category": "Notebook" - }, - "simcore/services/dynamic/jupyter-base-notebook": { - "category": "Notebook" - }, - "simcore/services/dynamic/jupyter-scipy-notebook": { - "category": "Notebook" - }, - "simcore/services/comp/rabbit-ss-0d-cardiac-model": { - "category": "Solver" - }, - "simcore/services/comp/rabbit-ss-1d-cardiac-model": { - "category": "Solver" - }, - "simcore/services/comp/rabbit-ss-2d-cardiac-model": { - "category": "Solver" - }, - "simcore/services/comp/human-gb-0d-cardiac-model": { - "category": "Solver" - }, - "simcore/services/comp/human-gb-1d-cardiac-model": { - "category": "Solver" - }, - "simcore/services/comp/human-gb-2d-cardiac-model": { - "category": "Solver" - }, - "simcore/services/comp/human-ord-0d-cardiac-model": { - "category": "Solver" - }, - "simcore/services/comp/human-ord-1d-cardiac-model": { - "category": "Solver" - }, - "simcore/services/comp/human-ord-2d-cardiac-model": { - "category": "Solver" - }, - "simcore/services/comp/osparc-opencor": { - "category": "Solver" - }, - - "simcore/services/comp/itis/sleeper": { - "category": "Solver" - }, - "simcore/services/comp/itis/isolve-emlf": { - "category": "Solver" - }, - "simcore/services/comp/itis/neuron-isolve": { - "category": "Solver" - }, - "simcore/services/comp/ucdavis-singlecell-cardiac-model": { - "category": "Solver" - }, - "simcore/services/comp/ucdavis-1d-cardiac-model": { - "category": "Solver" - }, - "simcore/services/comp/ucdavis-2d-cardiac-model": { - "category": "Solver" - }, - "simcore/services/comp/kember-cardiac-model": { - "category": "Solver" - }, - "simcore/services/demodec/computational/itis/Solver-LF": { - "category": "Solver" - }, - "simcore/services/demodec/container/itis/s4l/Simulator/LF": { - "category": "Simulator" - }, - "simcore/services/demodec/dynamic/itis/s4l/MaterialDB": { - "category": "Solver" - }, - "simcore/services/demodec/dynamic/itis/s4l/Modeler": { - "category": "Modeling" - }, - "simcore/services/demodec/dynamic/itis/s4l/Simulator/LF/Boundary": { - "category": "Simulator" - }, - "simcore/services/demodec/dynamic/itis/s4l/Simulator/LF/Grid": { - "category": "Simulator" - }, - "simcore/services/demodec/dynamic/itis/s4l/Simulator/LF/Materials": { - "category": "Simulator" - }, - "simcore/services/demodec/dynamic/itis/s4l/Simulator/LF/Sensors": { - "category": "Simulator" - }, - "simcore/services/demodec/dynamic/itis/s4l/Simulator/LF/Setup": { - "category": "Simulator" - }, - "simcore/services/demodec/dynamic/itis/s4l/Simulator/LF/SolverSettings": { - "category": "Simulator" - }, - "simcore/services/demodec/dynamic/itis/s4l/Simulator/LF/Voxel": { - "category": "Simulator" - }, - "simcore/services/demodec/dynamic/itis/s4l/Simulator/Neuron/NetworkConnection": { - "category": "Simulator" - }, - "simcore/services/demodec/dynamic/itis/s4l/Simulator/Neuron/Neurons": { - "category": "Simulator" - }, - "simcore/services/demodec/dynamic/itis/s4l/Simulator/Neuron/PointProcesses": { - "category": "Simulator" - }, - "simcore/services/demodec/dynamic/itis/s4l/Simulator/Neuron/Sensors": { - "category": "Simulator" - }, - "simcore/services/demodec/dynamic/itis/s4l/Simulator/Neuron/Setup": { - "category": "Simulator" - }, - "simcore/services/demodec/dynamic/itis/s4l/Simulator/Neuron/SolverSettings": { - "category": "Simulator" - }, - "simcore/services/demodec/dynamic/itis/s4l/Simulator/Neuron/Sources": { - "category": "Simulator" - }, - "simcore/services/demodec/dynamic/itis/s4l/StimulationSelectivity": { - "category": "PostPro" - }, - "simcore/services/demodec/dynamic/itis/s4l/neuroman": { - "category": "Modeling" - }, - "simcore/services/dynamic/kember-viewer": { - "category": "PostPro" - }, - "simcore/services/dynamic/modeler/webserver": { - "category": "Modeling" - }, - "simcore/services/dynamic/modeler/webserverwithrat": { - "category": "Modeling" - }, - "simcore/services/frontend/multi-plot": { - "category": "PostPro" - } - }; } } }); diff --git a/tests/e2e/portal/2D_Plot.js b/tests/e2e/portal/2D_Plot.js index c53dff2a7b4..88f72fecc78 100644 --- a/tests/e2e/portal/2D_Plot.js +++ b/tests/e2e/portal/2D_Plot.js @@ -18,46 +18,57 @@ const screenshotPrefix = "2DPlot_"; async function runTutorial () { const tutorial = new tutorialBase.TutorialBase(anonURL, screenshotPrefix, null, null, null, enableDemoMode); - tutorial.startScreenshooter(); - const page = await tutorial.beforeScript(); - const studyData = await tutorial.openStudyLink(); - const studyId = studyData["data"]["uuid"]; - console.log("Study ID:", studyId); + try { + tutorial.startScreenshooter(); + const page = await tutorial.beforeScript(); + const studyData = await tutorial.openStudyLink(); + const studyId = studyData["data"]["uuid"]; + console.log("Study ID:", studyId); - const workbenchData = utils.extractWorkbenchData(studyData["data"]); - await tutorial.waitForServices(workbenchData["studyId"], [workbenchData["nodeIds"][1]]); + const workbenchData = utils.extractWorkbenchData(studyData["data"]); + await tutorial.waitForServices(workbenchData["studyId"], [workbenchData["nodeIds"][1]]); - // Some time for starting the service - await tutorial.waitFor(5000); - await utils.takeScreenshot(page, screenshotPrefix + 'service_started'); + // Some time for starting the service + await tutorial.waitFor(5000); + await utils.takeScreenshot(page, screenshotPrefix + 'service_started'); - // await tutorial.openNode(1); - auto.openNode(page, 1); + // await tutorial.openNode(1); + auto.openNode(page, 1); - await tutorial.waitFor(2000); - await utils.takeScreenshot(page, screenshotPrefix + 'iFrame0'); + await tutorial.waitFor(2000); + await utils.takeScreenshot(page, screenshotPrefix + 'iFrame0'); - const iframeHandles = await page.$$("iframe"); - // expected two iframes = loading + raw-graph - const frame = await iframeHandles[1].contentFrame(); + const iframeHandles = await page.$$("iframe"); + // expected two iframes = loading + raw-graph + const frame = await iframeHandles[1].contentFrame(); - // inside the iFrame, click on "oSPARC inputs" - const oSPARCInputsSelector = '#load-data > div > div:nth-child(2) > div.col-lg-2 > ul > li:nth-child(5)'; - await frame.waitForSelector(oSPARCInputsSelector); - await frame.click(oSPARCInputsSelector); - await tutorial.waitFor(2000); - await utils.takeScreenshot(page, screenshotPrefix + 'iFrame1'); + // inside the iFrame, click on "oSPARC inputs" + const oSPARCInputsSelector = '#load-data > div > div:nth-child(2) > div.col-lg-2 > ul > li:nth-child(5)'; + await frame.waitForSelector(oSPARCInputsSelector); + await frame.click(oSPARCInputsSelector); + await tutorial.waitFor(2000); + await utils.takeScreenshot(page, screenshotPrefix + 'iFrame1'); - // after click on "oSPARC inputs", click on the input coming from the File Picker - const oSPARCInputSelector = '#load-data > div > div:nth-child(2) > div.col-lg-10 > div:nth-child(8) > div'; - await frame.waitForSelector(oSPARCInputSelector); - await frame.click(oSPARCInputSelector); - await tutorial.waitFor(2000); - await utils.takeScreenshot(page, screenshotPrefix + 'iFrame2'); + // after click on "oSPARC inputs", click on the input coming from the File Picker + const oSPARCInputSelector = '#load-data > div > div:nth-child(2) > div.col-lg-10 > div:nth-child(8) > div'; + await frame.waitForSelector(oSPARCInputSelector); + await frame.click(oSPARCInputSelector); + await tutorial.waitFor(2000); + await utils.takeScreenshot(page, screenshotPrefix + 'iFrame2'); + } + catch(err) { + tutorial.setTutorialFailed(true); + console.log('Tutorial error: ' + err); + } + finally { + await tutorial.logOut(); + tutorial.stopScreenshooter(); + await tutorial.close(); + } - await tutorial.logOut(); - tutorial.stopScreenshooter(); - await tutorial.close(); + if (tutorial.getTutorialFailed()) { + throw "Tutorial Failed"; + } } runTutorial() diff --git a/tests/e2e/portal/3D_Anatomical.js b/tests/e2e/portal/3D_Anatomical.js index ede95ae8562..864811f97dd 100644 --- a/tests/e2e/portal/3D_Anatomical.js +++ b/tests/e2e/portal/3D_Anatomical.js @@ -17,28 +17,39 @@ const screenshotPrefix = "3DAnatomical_"; async function runTutorial () { const tutorial = new tutorialBase.TutorialBase(anonURL, screenshotPrefix, null, null, null, enableDemoMode); - tutorial.startScreenshooter(); - const page = await tutorial.beforeScript(); - const studyData = await tutorial.openStudyLink(); - const studyId = studyData["data"]["uuid"]; - console.log("Study ID:", studyId); - - const workbenchData = utils.extractWorkbenchData(studyData["data"]); - await tutorial.waitForServices(workbenchData["studyId"], [workbenchData["nodeIds"][1]]); - - // Some time for starting the service - await tutorial.waitFor(10000); - await utils.takeScreenshot(page, screenshotPrefix + 'service_started'); - - await tutorial.openNodeFiles(1); - const outFiles = [ - "data.zip" - ]; - await tutorial.checkResults(outFiles.length); - - await tutorial.logOut(); - tutorial.stopScreenshooter(); - await tutorial.close(); + try { + tutorial.startScreenshooter(); + const page = await tutorial.beforeScript(); + const studyData = await tutorial.openStudyLink(); + const studyId = studyData["data"]["uuid"]; + console.log("Study ID:", studyId); + + const workbenchData = utils.extractWorkbenchData(studyData["data"]); + await tutorial.waitForServices(workbenchData["studyId"], [workbenchData["nodeIds"][1]]); + + // Some time for starting the service + await tutorial.waitFor(10000); + await utils.takeScreenshot(page, screenshotPrefix + 'service_started'); + + await tutorial.openNodeFiles(1); + const outFiles = [ + "data.zip" + ]; + await tutorial.checkResults(outFiles.length); + } + catch(err) { + tutorial.setTutorialFailed(true); + console.log('Tutorial error: ' + err); + } + finally { + await tutorial.logOut(); + tutorial.stopScreenshooter(); + await tutorial.close(); + } + + if (tutorial.getTutorialFailed()) { + throw "Tutorial Failed"; + } } runTutorial() diff --git a/tests/e2e/portal/3D_EM.js b/tests/e2e/portal/3D_EM.js index c809bee2639..4201ff6fef7 100644 --- a/tests/e2e/portal/3D_EM.js +++ b/tests/e2e/portal/3D_EM.js @@ -17,28 +17,39 @@ const screenshotPrefix = "3DEM_"; async function runTutorial () { const tutorial = new tutorialBase.TutorialBase(anonURL, screenshotPrefix, null, null, null, enableDemoMode); - tutorial.startScreenshooter(); - const page = await tutorial.beforeScript(); - const studyData = await tutorial.openStudyLink(); - const studyId = studyData["data"]["uuid"]; - console.log("Study ID:", studyId); - - const workbenchData = utils.extractWorkbenchData(studyData["data"]); - await tutorial.waitForServices(workbenchData["studyId"], [workbenchData["nodeIds"][2]]); - - // Some time for starting the service - await tutorial.waitFor(10000); - await utils.takeScreenshot(page, screenshotPrefix + 'service_started'); - - await tutorial.openNodeFiles(2); - const outFiles = [ - "data.zip" - ]; - await tutorial.checkResults(outFiles.length); - - await tutorial.logOut(); - tutorial.stopScreenshooter(); - await tutorial.close(); + try { + tutorial.startScreenshooter(); + const page = await tutorial.beforeScript(); + const studyData = await tutorial.openStudyLink(); + const studyId = studyData["data"]["uuid"]; + console.log("Study ID:", studyId); + + const workbenchData = utils.extractWorkbenchData(studyData["data"]); + await tutorial.waitForServices(workbenchData["studyId"], [workbenchData["nodeIds"][2]]); + + // Some time for starting the service + await tutorial.waitFor(10000); + await utils.takeScreenshot(page, screenshotPrefix + 'service_started'); + + await tutorial.openNodeFiles(2); + const outFiles = [ + "data.zip" + ]; + await tutorial.checkResults(outFiles.length); + } + catch(err) { + tutorial.setTutorialFailed(true); + console.log('Tutorial error: ' + err); + } + finally { + await tutorial.logOut(); + tutorial.stopScreenshooter(); + await tutorial.close(); + } + + if (tutorial.getTutorialFailed()) { + throw "Tutorial Failed"; + } } runTutorial() diff --git a/tests/e2e/portal/Bornstein.js b/tests/e2e/portal/Bornstein.js index 827d61b7c6f..b72d09a1e21 100644 --- a/tests/e2e/portal/Bornstein.js +++ b/tests/e2e/portal/Bornstein.js @@ -17,32 +17,43 @@ const screenshotPrefix = "Bornstein_"; async function runTutorial () { const tutorial = new tutorialBase.TutorialBase(anonURL, screenshotPrefix, null, null, null, enableDemoMode); - tutorial.startScreenshooter(); - const page = await tutorial.beforeScript(); - const studyData = await tutorial.openStudyLink(); - const studyId = studyData["data"]["uuid"]; - console.log("Study ID:", studyId); - - const workbenchData = utils.extractWorkbenchData(studyData["data"]); - await tutorial.waitForServices(workbenchData["studyId"], [workbenchData["nodeIds"][0]]); - - // Some time for starting the service - await tutorial.waitFor(60000); - await utils.takeScreenshot(page, screenshotPrefix + 'service_started'); - - // This study opens in fullscreen mode - await tutorial.restoreIFrame(); - - await tutorial.openNodeFiles(0); - const outFiles = [ - "output.csv", - "traces.pkl" - ]; - await tutorial.checkResults(outFiles.length); - - await tutorial.logOut(); - tutorial.stopScreenshooter(); - await tutorial.close(); + try { + tutorial.startScreenshooter(); + const page = await tutorial.beforeScript(); + const studyData = await tutorial.openStudyLink(); + const studyId = studyData["data"]["uuid"]; + console.log("Study ID:", studyId); + + const workbenchData = utils.extractWorkbenchData(studyData["data"]); + await tutorial.waitForServices(workbenchData["studyId"], [workbenchData["nodeIds"][0]]); + + // Some time for starting the service + await tutorial.waitFor(60000); + await utils.takeScreenshot(page, screenshotPrefix + 'service_started'); + + // This study opens in fullscreen mode + await tutorial.restoreIFrame(); + + await tutorial.openNodeFiles(0); + const outFiles = [ + "output.csv", + "traces.pkl" + ]; + await tutorial.checkResults(outFiles.length); + } + catch(err) { + tutorial.setTutorialFailed(true); + console.log('Tutorial error: ' + err); + } + finally { + await tutorial.logOut(); + tutorial.stopScreenshooter(); + await tutorial.close(); + } + + if (tutorial.getTutorialFailed()) { + throw "Tutorial Failed"; + } } runTutorial() diff --git a/tests/e2e/portal/CC_Human.js b/tests/e2e/portal/CC_Human.js index 7ae1e67f7d6..35f17578375 100644 --- a/tests/e2e/portal/CC_Human.js +++ b/tests/e2e/portal/CC_Human.js @@ -17,48 +17,59 @@ const screenshotPrefix = "CCHuman_"; async function runTutorial () { const tutorial = new tutorialBase.TutorialBase(anonURL, screenshotPrefix, null, null, null, enableDemoMode); - tutorial.startScreenshooter(); - const page = await tutorial.beforeScript(); - const studyData = await tutorial.openStudyLink(); - const studyId = studyData["data"]["uuid"]; - console.log("Study ID:", studyId); + try { + tutorial.startScreenshooter(); + const page = await tutorial.beforeScript(); + const studyData = await tutorial.openStudyLink(); + const studyId = studyData["data"]["uuid"]; + console.log("Study ID:", studyId); - // Some time for loading the workbench - await tutorial.waitFor(10000); - await utils.takeScreenshot(page, screenshotPrefix + 'workbench_loaded'); + // Some time for loading the workbench + await tutorial.waitFor(10000); + await utils.takeScreenshot(page, screenshotPrefix + 'workbench_loaded'); - await tutorial.runPipeline(studyId, 1800000); - await utils.takeScreenshot(page, screenshotPrefix + 'after_1-2-3_run'); + await tutorial.runPipeline(studyId, 1800000); + await utils.takeScreenshot(page, screenshotPrefix + 'after_1-2-3_run'); - await tutorial.openNodeFiles(1); - const outFiles0 = [ - "vm_1Hz.txt", - "logs.zip", - "allresult_1Hz.txt" - ]; - await tutorial.checkResults(outFiles0.length); + await tutorial.openNodeFiles(1); + const outFiles0 = [ + "vm_1Hz.txt", + "logs.zip", + "allresult_1Hz.txt" + ]; + await tutorial.checkResults(outFiles0.length); - await tutorial.openNodeFiles(2); - const outFiles1 = [ - "model_INPUT.from1D", - "y_1D.txt", - "logs.zip", - "ECGs.txt" - ]; - await tutorial.checkResults(outFiles1.length); + await tutorial.openNodeFiles(2); + const outFiles1 = [ + "model_INPUT.from1D", + "y_1D.txt", + "logs.zip", + "ECGs.txt" + ]; + await tutorial.checkResults(outFiles1.length); - await tutorial.openNodeFiles(3); - const outFiles2 = [ - "aps.zip", - "logs.zip" - ]; - await tutorial.checkResults(outFiles2.length); + await tutorial.openNodeFiles(3); + const outFiles2 = [ + "aps.zip", + "logs.zip" + ]; + await tutorial.checkResults(outFiles2.length); - // await tutorial.openNodeRetrieveAndRestart(4); + // await tutorial.openNodeRetrieveAndRestart(4); + } + catch(err) { + tutorial.setTutorialFailed(true); + console.log('Tutorial error: ' + err); + } + finally { + await tutorial.logOut(); + tutorial.stopScreenshooter(); + await tutorial.close(); + } - await tutorial.logOut(); - tutorial.stopScreenshooter(); - await tutorial.close(); + if (tutorial.getTutorialFailed()) { + throw "Tutorial Failed"; + } } runTutorial() diff --git a/tests/e2e/portal/CC_Rabbit.js b/tests/e2e/portal/CC_Rabbit.js index 7a30ee2c910..2548caf37b3 100644 --- a/tests/e2e/portal/CC_Rabbit.js +++ b/tests/e2e/portal/CC_Rabbit.js @@ -17,49 +17,60 @@ const screenshotPrefix = "CCRabbit_"; async function runTutorial () { const tutorial = new tutorialBase.TutorialBase(anonURL, screenshotPrefix, null, null, null, enableDemoMode); - tutorial.startScreenshooter(); - const page = await tutorial.beforeScript(); - const studyData = await tutorial.openStudyLink(); - const studyId = studyData["data"]["uuid"]; - console.log("Study ID:", studyId); + try { + tutorial.startScreenshooter(); + const page = await tutorial.beforeScript(); + const studyData = await tutorial.openStudyLink(); + const studyId = studyData["data"]["uuid"]; + console.log("Study ID:", studyId); - // Some time for loading the workbench - await tutorial.waitFor(10000); - await utils.takeScreenshot(page, screenshotPrefix + 'workbench_loaded'); + // Some time for loading the workbench + await tutorial.waitFor(10000); + await utils.takeScreenshot(page, screenshotPrefix + 'workbench_loaded'); - await tutorial.runPipeline(studyId, 1500000); - await utils.takeScreenshot(page, screenshotPrefix + 'after_1-2-3_run'); + await tutorial.runPipeline(studyId, 1500000); + await utils.takeScreenshot(page, screenshotPrefix + 'after_1-2-3_run'); - await tutorial.openNodeFiles(1); - const outFiles0 = [ - "logs.zip", - "allresult_1Hz.txt", - "vm_1Hz.txt" - ]; - await tutorial.checkResults(outFiles0.length); + await tutorial.openNodeFiles(1); + const outFiles0 = [ + "logs.zip", + "allresult_1Hz.txt", + "vm_1Hz.txt" + ]; + await tutorial.checkResults(outFiles0.length); - await tutorial.openNodeFiles(2); - const outFiles1 = [ - "model_INPUT.from1D", - "logs.zip", - "cai_1D.txt", - "ap_1D.txt", - "ECGs.txt" - ]; - await tutorial.checkResults(outFiles1.length); + await tutorial.openNodeFiles(2); + const outFiles1 = [ + "model_INPUT.from1D", + "logs.zip", + "cai_1D.txt", + "ap_1D.txt", + "ECGs.txt" + ]; + await tutorial.checkResults(outFiles1.length); - await tutorial.openNodeFiles(3); - const outFiles2 = [ - "aps.zip", - "logs.zip" - ]; - await tutorial.checkResults(outFiles2.length); + await tutorial.openNodeFiles(3); + const outFiles2 = [ + "aps.zip", + "logs.zip" + ]; + await tutorial.checkResults(outFiles2.length); - // await tutorial.openNodeRetrieveAndRestart(4); + // await tutorial.openNodeRetrieveAndRestart(4); + } + catch(err) { + tutorial.setTutorialFailed(true); + console.log('Tutorial error: ' + err); + } + finally { + await tutorial.logOut(); + tutorial.stopScreenshooter(); + await tutorial.close(); + } - await tutorial.logOut(); - tutorial.stopScreenshooter(); - await tutorial.close(); + if (tutorial.getTutorialFailed()) { + throw "Tutorial Failed"; + } } runTutorial() diff --git a/tests/e2e/portal/Kember.js b/tests/e2e/portal/Kember.js index 33ffa9e5f73..c9c1bc68ec1 100644 --- a/tests/e2e/portal/Kember.js +++ b/tests/e2e/portal/Kember.js @@ -18,64 +18,75 @@ const screenshotPrefix = "Kember_"; async function runTutorial () { const tutorial = new tutorialBase.TutorialBase(anonURL, screenshotPrefix, null, null, null, enableDemoMode); - tutorial.startScreenshooter(); - const page = await tutorial.beforeScript(); - const studyData = await tutorial.openStudyLink(); - const studyId = studyData["data"]["uuid"]; - console.log("Study ID:", studyId); - - // Some time for loading the workbench - await tutorial.waitFor(10000); - await utils.takeScreenshot(page, screenshotPrefix + 'workbench_loaded'); - - await tutorial.runPipeline(studyId, 120000); - await utils.takeScreenshot(page, screenshotPrefix + 'pipeline_run'); - - await tutorial.openNodeFiles(0); - const outFiles = [ - "logs.zip", - "outputController.dat" - ]; - await tutorial.checkResults(outFiles.length); - - - // open kember viewer - auto.openNode(page, 1); - - await tutorial.waitFor(2000); - await utils.takeScreenshot(page, screenshotPrefix + 'iFrame0'); - const iframeHandles = await page.$$("iframe"); - // expected just one iframe = kember-notebook - const frame = await iframeHandles[0].contentFrame(); - - // restart kernel: click restart and accept - const restartSelector = "#run_int > button:nth-child(3)"; - await frame.waitForSelector(restartSelector); - await frame.click(restartSelector); - await tutorial.waitFor(2000); - await utils.takeScreenshot(page, screenshotPrefix + 'restart_pressed'); - const acceptSelector = "body > div.modal.fade.in > div > div > div.modal-footer > button.btn.btn-default.btn-sm.btn-danger"; - await frame.waitForSelector(acceptSelector); - await frame.click(acceptSelector); - await tutorial.waitFor(2000); - await utils.takeScreenshot(page, screenshotPrefix + 'restart_accept'); - - await tutorial.waitFor(20000); - await utils.takeScreenshot(page, screenshotPrefix + 'notebook_run'); - - // check output - await tutorial.openNodeFiles(1); - const outFiles2 = [ - "Hear_Rate.csv", - "notebooks.zip", - "Parasympathetic_Cell_Activity.csv", - "Table_Data.csv" - ]; - await tutorial.checkResults(outFiles2.length); - - await tutorial.logOut(); - tutorial.stopScreenshooter(); - await tutorial.close(); + try { + tutorial.startScreenshooter(); + const page = await tutorial.beforeScript(); + const studyData = await tutorial.openStudyLink(); + const studyId = studyData["data"]["uuid"]; + console.log("Study ID:", studyId); + + // Some time for loading the workbench + await tutorial.waitFor(10000); + await utils.takeScreenshot(page, screenshotPrefix + 'workbench_loaded'); + + await tutorial.runPipeline(studyId, 120000); + await utils.takeScreenshot(page, screenshotPrefix + 'pipeline_run'); + + await tutorial.openNodeFiles(0); + const outFiles = [ + "logs.zip", + "outputController.dat" + ]; + await tutorial.checkResults(outFiles.length); + + + // open kember viewer + auto.openNode(page, 1); + + await tutorial.waitFor(2000); + await utils.takeScreenshot(page, screenshotPrefix + 'iFrame0'); + const iframeHandles = await page.$$("iframe"); + // expected just one iframe = kember-notebook + const frame = await iframeHandles[0].contentFrame(); + + // restart kernel: click restart and accept + const restartSelector = "#run_int > button:nth-child(3)"; + await frame.waitForSelector(restartSelector); + await frame.click(restartSelector); + await tutorial.waitFor(2000); + await utils.takeScreenshot(page, screenshotPrefix + 'restart_pressed'); + const acceptSelector = "body > div.modal.fade.in > div > div > div.modal-footer > button.btn.btn-default.btn-sm.btn-danger"; + await frame.waitForSelector(acceptSelector); + await frame.click(acceptSelector); + await tutorial.waitFor(2000); + await utils.takeScreenshot(page, screenshotPrefix + 'restart_accept'); + + await tutorial.waitFor(20000); + await utils.takeScreenshot(page, screenshotPrefix + 'notebook_run'); + + // check output + await tutorial.openNodeFiles(1); + const outFiles2 = [ + "Hear_Rate.csv", + "notebooks.zip", + "Parasympathetic_Cell_Activity.csv", + "Table_Data.csv" + ]; + await tutorial.checkResults(outFiles2.length); + } + catch(err) { + tutorial.setTutorialFailed(true); + console.log('Tutorial error: ' + err); + } + finally { + await tutorial.logOut(); + tutorial.stopScreenshooter(); + await tutorial.close(); + } + + if (tutorial.getTutorialFailed()) { + throw "Tutorial Failed"; + } } runTutorial() diff --git a/tests/e2e/portal/Mattward.js b/tests/e2e/portal/Mattward.js index d833d849ad5..6f68185ec82 100644 --- a/tests/e2e/portal/Mattward.js +++ b/tests/e2e/portal/Mattward.js @@ -17,37 +17,48 @@ const screenshotPrefix = "Mattward_"; async function runTutorial () { const tutorial = new tutorialBase.TutorialBase(anonURL, screenshotPrefix, null, null, null, enableDemoMode); - tutorial.startScreenshooter(); - const page = await tutorial.beforeScript(); - const studyData = await tutorial.openStudyLink(); - const studyId = studyData["data"]["uuid"]; - console.log("Study ID:", studyId); - - const workbenchData = utils.extractWorkbenchData(studyData["data"]); - await tutorial.waitForServices(workbenchData["studyId"], [workbenchData["nodeIds"][0]]); - - // Some time for starting the service - await tutorial.waitFor(20000); - await utils.takeScreenshot(page, screenshotPrefix + 'service_started'); - - // This study opens in fullscreen mode - await tutorial.restoreIFrame(); - - await tutorial.openNodeFiles(0); - const outFiles = [ - "CAP_plot.csv", - "CV_plot.csv", - "Lpred_plot.csv", - "V_pred_plot.csv", - "input.csv", - "t_plot.csv", - "tst_plot.csv" - ]; - await tutorial.checkResults(outFiles.length); - - await tutorial.logOut(); - tutorial.stopScreenshooter(); - await tutorial.close(); + try { + tutorial.startScreenshooter(); + const page = await tutorial.beforeScript(); + const studyData = await tutorial.openStudyLink(); + const studyId = studyData["data"]["uuid"]; + console.log("Study ID:", studyId); + + const workbenchData = utils.extractWorkbenchData(studyData["data"]); + await tutorial.waitForServices(workbenchData["studyId"], [workbenchData["nodeIds"][0]]); + + // Some time for starting the service + await tutorial.waitFor(20000); + await utils.takeScreenshot(page, screenshotPrefix + 'service_started'); + + // This study opens in fullscreen mode + await tutorial.restoreIFrame(); + + await tutorial.openNodeFiles(0); + const outFiles = [ + "CAP_plot.csv", + "CV_plot.csv", + "Lpred_plot.csv", + "V_pred_plot.csv", + "input.csv", + "t_plot.csv", + "tst_plot.csv" + ]; + await tutorial.checkResults(outFiles.length); + } + catch(err) { + tutorial.setTutorialFailed(true); + console.log('Tutorial error: ' + err); + } + finally { + await tutorial.logOut(); + tutorial.stopScreenshooter(); + await tutorial.close(); + } + + if (tutorial.getTutorialFailed()) { + throw "Tutorial Failed"; + } } runTutorial() diff --git a/tests/e2e/portal/opencor.js b/tests/e2e/portal/opencor.js index dd0bf5b8d01..c378d003d43 100644 --- a/tests/e2e/portal/opencor.js +++ b/tests/e2e/portal/opencor.js @@ -17,30 +17,41 @@ const screenshotPrefix = "Opencor_"; async function runTutorial () { const tutorial = new tutorialBase.TutorialBase(anonURL, screenshotPrefix, null, null, null, enableDemoMode); - tutorial.startScreenshooter(); - const page = await tutorial.beforeScript(); - const studyData = await tutorial.openStudyLink(); - const studyId = studyData["data"]["uuid"]; - console.log("Study ID:", studyId); - - // Some time for loading the workbench - await tutorial.waitFor(10000); - await utils.takeScreenshot(page, screenshotPrefix + 'workbench_loaded'); - - await tutorial.runPipeline(studyId, 30000); - await utils.takeScreenshot(page, screenshotPrefix + 'pipeline_run'); - - await tutorial.openNodeFiles(0); - const outFiles = [ - "results.json", - "logs.zip", - "membrane-potential.csv" - ]; - await tutorial.checkResults(outFiles.length); - - await tutorial.logOut(); - tutorial.stopScreenshooter(); - await tutorial.close(); + try { + tutorial.startScreenshooter(); + const page = await tutorial.beforeScript(); + const studyData = await tutorial.openStudyLink(); + const studyId = studyData["data"]["uuid"]; + console.log("Study ID:", studyId); + + // Some time for loading the workbench + await tutorial.waitFor(10000); + await utils.takeScreenshot(page, screenshotPrefix + 'workbench_loaded'); + + await tutorial.runPipeline(studyId, 30000); + await utils.takeScreenshot(page, screenshotPrefix + 'pipeline_run'); + + await tutorial.openNodeFiles(0); + const outFiles = [ + "results.json", + "logs.zip", + "membrane-potential.csv" + ]; + await tutorial.checkResults(outFiles.length); + } + catch(err) { + tutorial.setTutorialFailed(true); + console.log('Tutorial error: ' + err); + } + finally { + await tutorial.logOut(); + tutorial.stopScreenshooter(); + await tutorial.close(); + } + + if (tutorial.getTutorialFailed()) { + throw "Tutorial Failed"; + } } runTutorial() diff --git a/tests/e2e/tutorials/tutorialBase.js b/tests/e2e/tutorials/tutorialBase.js index b6a52d5c09c..c29ef46b90a 100644 --- a/tests/e2e/tutorials/tutorialBase.js +++ b/tests/e2e/tutorials/tutorialBase.js @@ -220,8 +220,9 @@ class TutorialBase { return; } } - console.log("Timeout reached waiting for services", ((new Date().getTime()) - start) / 1000); - return; + const errorMsg = "Timeout reached waiting for services"; + console.log(errorMsg, ((new Date().getTime()) - start) / 1000); + throw new Error(errorMsg); } async waitForStudyRun(studyId, timeout = 60000) {