{ "stats": { "suites": 1, "tests": 1, "passes": 1, "pending": 0, "failures": 0, "start": "2024-05-14T04:47:16.505Z", "end": "2024-05-14T04:48:53.850Z", "duration": 97345, "testsRegistered": 1, "passPercent": 100, "pendingPercent": 0, "other": 0, "hasOther": false, "skipped": 0, "hasSkipped": false }, "results": [ { "uuid": "7d06f1f2-bc19-4d87-b928-45c8dd7130b1", "title": "", "fullFile": "cypress/component/MapContent.cy.js", "file": "cypress/component/MapContent.cy.js", "beforeHooks": [], "afterHooks": [], "tests": [], "suites": [ { "uuid": "68f7dedd-d7fb-45cd-9865-e385625ca42c", "title": "MapContent", "fullFile": "", "file": "", "beforeHooks": [], "afterHooks": [], "tests": [ { "title": "Workflow testing", "fullTitle": "MapContent Workflow testing", "timedOut": null, "duration": 94442, "state": "passed", "speed": "slow", "pass": true, "fail": false, "pending": false, "context": null, "code": "//Intercept any initial response with preloaded fixture\n cy.get('@stub').then((stub) => {\n cy.intercept('/sparc-api/dataset_info/using_multiple_dois/*', {statusCode: 200, body: stub.noResponse});\n cy.intercept('/sparc-api/dataset_info/using_multiple_dois/?dois=*', {statusCode: 200, body: stub.resultResponse}).as(\"mouseDataset\");\n cy.intercept('/sparc-api/get-organ-curies', {statusCode: 200, body: stub.curiesResponse}).as(\"curieResponse\");\n cy.intercept('/sparc-api/get_featured_datasets_identifiers', {statusCode: 200, body: stub.featuredDatasetResponse}).as(\"featuredDatasetResponse\");\n const anatomy_dataset = {\n \"result\": [stub.datasetResult]\n };\n cy.intercept('/sparc-api/dataset_info/anatomy?identifier=130', {statusCode: 200, body: anatomy_dataset}).as(\"anatomyResponse\");\n })\n //cy.intercept('GET', 'https://mapcore-demo.org/current/flatmap/v2/**');\n cy.mount(MapContent, {\n propsData: {\n options: {\n sparcApi: \"https://mock-test/sparc-api/\",\n flatmapAPI: \"https://mapcore-demo.org/current/flatmap/v3/\",\n algoliaKey: Cypress.env('ALGOLIA_KEY'),\n algoliaId: Cypress.env('ALGOLIA_ID'),\n }\n },\n });\n Cypress.on('uncaught:exception', (err) => {\n // returning false here prevents Cypress from\n // failing the test\n if (err.message.includes(\"this.facets.at is not a function\"))\n return false\n if (err.message.includes(\"Cannot read properties of undefined (reading 'left')\"))\n return false\n if (err.message.includes(\"Failed to fetch\"))\n return false\n if (err.message.includes('Source \"mapbox-gl-draw-cold\" already exists.'))\n return false\n return true\n })\n Cypress.Commands.add('checkFlatmapProvenanceCard', (species) => {\n cy.get('#flatmap-select').click({force: true} );\n cy.get('.el-select-dropdown__wrap > .el-scrollbar__view').contains(species).click();\n cy.get('.multi-container > .el-loading-parent--relative > [name=\"el-loading-fade\"] > .el-loading-mask', {timeout: 30000}).should('not.exist');\n cy.get('.el-row > div[style=\"\"]').click()\n cy.get('.flatmap-context-card > .card-right > a').contains('here').should('have.attr', 'href').and('include', species.toLowerCase())\n })\n //Wait for the curie response before continuing\n // cy.wait('@categoryResponse');\n //Check if mapcontent is mounted correctly\n cy.get('.mapcontent').invoke('attr', 'style', 'height: 880px').should(\n 'have.attr', 'style', 'height: 880px');\n //Loading mask should exist at the beginning\n cy.get('.multi-container > .el-loading-parent--relative > [name=\"el-loading-fade\"] > .el-loading-mask', {timeout: 30000}).should('exist');\n cy.get('.header').should('be.visible');\n cy.get('.toolbar-title').should('exist');\n //Only three visible button on the toolbar at the start\n cy.get('.icon-group .map-icon:visible ').should('have.length', 3);\n //Sidebar should not be visbile\n cy.get('.el-drawer.rtl.my-drawer').should('not.be.visible');\n //Wait for curie response\n cy.wait('@curieResponse', {timeout: 20000});\n //Wait for curie response\n cy.wait('@featuredDatasetResponse', {timeout: 20000});\n //Wait for curie response\n cy.wait('@anatomyResponse', {timeout: 20000});\n cy.get('.multi-container > .el-loading-parent--relative > [name=\"el-loading-fade\"] > .el-loading-mask', {timeout: 30000}).should('not.exist');\n //Test the existence of the minimap\n cy.get('#maplibre-minimap > .maplibregl-canvas-container > .maplibregl-canvas', {timeout: 30000}).should('exist');\n cy.checkFlatmapProvenanceCard('Mouse')\n cy.checkFlatmapProvenanceCard('Rat')\n //Search for non existance feature, expect not-found text\n cy.get('.search-box.el-autocomplete > .el-input > .el-input__wrapper > .el-input__inner').should('exist').type(\"NON_EXISTANCE\");\n cy.get('.search-container > .map-icon > use').should('exist').click();\n cy.get('.not-found-text').should('exist');\n //Search for Vague nerve, expect not-found text to be gone\n cy.get('.search-box.el-autocomplete > .el-input > .el-input__wrapper > .el-input__inner').should('exist').clear();\n cy.get('.search-box.el-autocomplete > .el-input > .el-input__wrapper > .el-input__inner').should('exist').type(\"'Vagus Nerve'\");\n cy.get('.search-container > .map-icon > use').should('exist').click();\n cy.get('.not-found-text').should('not.exist');\n //Test searching with uberon id wich should display a pop up with anatomical name\n cy.get('.search-box.el-autocomplete > .el-input > .el-input__wrapper > .el-input__inner').should('exist').clear();\n cy.get('.search-box.el-autocomplete > .el-input > .el-input__wrapper > .el-input__inner').should('exist').type(\"UBERON:0018675\");\n cy.get('.search-container > .map-icon > use').should('exist').click();\n cy.get('.maplibregl-popup-content').should('exist').contains('pelvic splanchnic nerve');\n //Test searching with uberon id wich should display a pop up with anatomical name\n cy.get('[style=\"height: 100%;\"] > [style=\"height: 100%; width: 100%; position: relative;\"] > .settings-group > :nth-child(1)').should('exist').click();\n //Open a new flatmap\n cy.get('.open-map-popper > :nth-child(2) > .el-button:visible').should('exist').click();\n //Switch back to the original viewer\n cy.get('.pane-1 .toolbar > .toolbar-flex-container > .el-select > .el-select__wrapper').should('exist').click();\n cy.get('.pane-1 .toolbar > .toolbar-flex-container > .el-select .viewer_dropdown ul > li').should('have.length', 2);\n cy.get('.pane-1 .toolbar > .toolbar-flex-container > .el-select .viewer_dropdown ul > :nth-child(1)', {timeout: 30000}).click();\n //Check for two content containers\n cy.get('.contentvuer').should('be.visible').should('have.length', 2);\n //Wait for the mouse dataset request\n cy.wait('@mouseDataset', {timeout: 20000});\n //Open the sidebar\n cy.get('.open-tab').should('exist').click();\n //Type in 76 generic\n cy.get('.search-input > .el-input__wrapper > .el-input__inner').should('exist').type('76 generic');\n //Search\n cy.get('.header > .el-button').should('exist').click();\n //Check number of dataset card, it should be 1\n cy.get('.dataset-card').should('have.length', 1);\n //Check how many tags in the dataset\n cy.get('.box-card .container button').should('have.length', 6);\n //Intercept the request and stub it with preloaded fixture\n cy.get('@metadata').then((metadata) => {\n cy.intercept('/sparc-api/s3-resource/999/1/files/derivative/sub-54-8/scaffold/54-8_metadata.json?s3BucketName=pennsieve-prod-discover-publish-use1',\n {statusCode: 200, body: metadata});\n })\n //Intercept the request and stub it with preloaded fixture\n cy.get('@primitive').then((primitive) => {\n cy.intercept('/sparc-api/s3-resource/999/1/files/derivative/sub-54-8/scaffold/cube_2.json?s3BucketName=pennsieve-prod-discover-publish-use1',\n {statusCode: 200, body: primitive}).as(\"scaffoldResponse\");\n })\n //Check for scaffolds and open it, should have three items in select now\n cy.get('.box-card .container button').contains('Scaffolds (2)').click();\n cy.get('.gallery-strip').contains('54-8_metadata.json').should(\"exist\");\n cy.get('.box-card :nth-child(1) > .details .el-button').click();\n cy.get('.pane-1.contentvuer').should('have.length', 1);\n cy.get('.pane-1 .toolbar > .toolbar-flex-container > .el-select > .el-select__wrapper').should('exist').click();\n cy.get('.pane-1 .toolbar > .toolbar-flex-container > .el-select .viewer_dropdown ul > li').should('have.length', 3);\n //Check for plot and open it, should have four items in select now\n cy.get('.open-tab > .el-icon').click();\n cy.get('.box-card .container button').contains('Segmentations (1)').click();\n cy.get('.gallery-strip').contains('M54-8_03_20_20_Final.xml').should(\"exist\");\n cy.get('.box-card .container button').contains('Plots (1)').click();\n cy.get('.box-card :nth-child(1) > .details .el-button').click();\n cy.get('.gallery-strip').contains('RAGP_4subs_negdct.csv').should(\"exist\");\n cy.get('.pane-1 .toolbar > .toolbar-flex-container > .el-select > .el-select__wrapper').should('exist').click();\n cy.get('.pane-1 .toolbar > .toolbar-flex-container > .el-select .viewer_dropdown ul > li').should('have.length', 4);\n cy.get('@simulation_ui').then((simulation_ui) => {\n cy.intercept('/sparc-api//sim/dataset/999',\n {statusCode: 200, body: simulation_ui});\n })\n //Check for simulations and open it, should have five items in select now\n cy.get('.open-tab > .el-icon').click();\n cy.get('.box-card .container button').contains('Simulations (1)').click();\n cy.get('.box-card :nth-child(1) > .details .el-button').click();\n cy.get('.pane-1 .toolbar > .toolbar-flex-container > .el-select > .el-select__wrapper').should('exist').click();\n cy.get('.pane-1 .toolbar > .toolbar-flex-container > .el-select .viewer_dropdown ul > li').should('have.length', 5);\n //Close the sidebar\n cy.get('.open-tab > .el-icon').click();\n cy.get('.close-tab').should('exist').click();\n cy.get('.sidebar-container').should('not.be.visible');\n //Change from single panel to four panels and check for it\n cy.get('.icon-group > svg:visible:nth-child(2)').should('exist').click();\n cy.get('.icon-group.el-row .el-popover:visible').should('exist');\n cy.get('.icon-group.el-row .el-popover:visible .el-row').should('have.length', 8);\n cy.get('.icon-group.el-row .el-popover:visible .el-row').contains('Four panes').should('exist').click();\n cy.get('.content-container:visible').should('have.length', 4);", "err": {}, "uuid": "ac2dcbad-42de-4c10-841f-577ea1f363f8", "parentUUID": "68f7dedd-d7fb-45cd-9865-e385625ca42c", "isHook": false, "skipped": false } ], "suites": [], "passes": [ "ac2dcbad-42de-4c10-841f-577ea1f363f8" ], "failures": [], "pending": [], "skipped": [], "duration": 94442, "root": false, "rootEmpty": false, "_timeout": 2000 } ], "passes": [], "failures": [], "pending": [], "skipped": [], "duration": 0, "root": true, "rootEmpty": true, "_timeout": 2000 } ], "meta": { "mocha": { "version": "7.0.1" }, "mochawesome": { "options": { "quiet": false, "reportFilename": "mochawesome", "saveHtml": false, "saveJson": true, "consoleReporter": "spec", "useInlineDiffs": false, "code": true }, "version": "7.1.3" }, "marge": { "options": { "id": "default", "reportDir": "cypress/results/json", "overwrite": false, "html": false, "json": true }, "version": "6.2.0" } } }