{ "stats": { "suites": 1, "tests": 1, "passes": 0, "pending": 0, "failures": 1, "start": "2024-12-11T03:23:37.454Z", "end": "2024-12-11T03:26:28.819Z", "duration": 171365, "testsRegistered": 1, "passPercent": 0, "pendingPercent": 0, "other": 0, "hasOther": false, "skipped": 0, "hasSkipped": false }, "results": [ { "uuid": "5a5d6ba0-3c24-47bf-ac87-cba3cba064c8", "title": "", "fullFile": "cypress/component/MapContent.cy.js", "file": "cypress/component/MapContent.cy.js", "beforeHooks": [], "afterHooks": [], "tests": [], "suites": [ { "uuid": "0477b816-c699-4575-b264-7703ede0c6ac", "title": "MapContent", "fullFile": "", "file": "", "beforeHooks": [], "afterHooks": [], "tests": [ { "title": "Workflow testing", "fullTitle": "MapContent Workflow testing", "timedOut": null, "duration": 171020, "state": "failed", "speed": null, "pass": false, "fail": true, "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 props: {\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 if (err.message.includes('Source \"markers\" already exists.'))\n return false\n if (err.message.includes(\"Cannot read properties of undefined (reading 'onResize')\"))\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 //Wait for curie response\n cy.wait('@curieResponse', {timeout: 20000});\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('@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 //There is some issue with capture function with Cypress causing the screenshot to be taken incorrectly,\n //the following attempt to workaround it.\n function is_high_resolution_screen() {\n // retina display has a devicePixelRatio of 2\n return window.devicePixelRatio > 1;\n }\n let snapshot = 'minimap_lr'\n if (is_high_resolution_screen()) {\n snapshot = 'minimap_hr'\n }\n cy.get('html').invoke('css', 'width', '1200px');\n cy.wait(1000);\n cy.get('[style=\"height: 100%;\"] > [style=\"height: 100%; width: 100%; position: relative;\"] > [style=\"height: 100%; width: 100%;\"] > :nth-child(2) > :nth-child(2) > #maplibre-minimap > .maplibregl-canvas-container > .maplibregl-canvas').compareSnapshot(snapshot).then(comparisonResults => {\n expect(comparisonResults.percentage).to.be.below(0.1)\n });\n cy.get('html').invoke('css', 'width', 'initial');\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 //Open the sidebar\n cy.get('.side-bar > .open-tab').should('exist').click();\n //Type in 76 generic\n cy.get(':nth-child(1) > .el-card__header > .header > .el-input > .el-input__wrapper').should('exist').type('76 generic');\n //Search\n cy.get(':nth-child(1) > .el-card__header > .header > .el-button > span').should('exist').click();\n //Check number of dataset card, it should be 1\n cy.get('.dataset-card-container').filter(':visible').should('have.length', 1);\n //Wait for the mouse dataset request\n cy.wait('@mouseDataset', {timeout: 20000});\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').filter(':visible').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').filter(':visible').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').filter(':visible').contains('Plots (1)').click();\n cy.get('.box-card :nth-child(1) > .details .el-button').filter(':visible').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').filter(':visible').contains('Simulations (1)').click();\n cy.get('.box-card :nth-child(1) > .details .el-button').filter(':visible').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": { "message": "Error: The following error originated from your application code, not from Cypress. It was caused by an unhandled promise rejection.\n\n > Cannot access https://mapcore-demo.org/current/flatmap/v3/knowledge/query/\n\nWhen Cypress detects uncaught errors originating from your application it will automatically fail the current test.\n\nThis behavior is configurable, and you can choose to turn this off by listening to the `uncaught:exception` event.\n\nhttps://on.cypress.io/uncaught-exception-from-application", "estack": "Error: The following error originated from your application code, not from Cypress. It was caused by an unhandled promise rejection.\n\n > Cannot access https://mapcore-demo.org/current/flatmap/v3/knowledge/query/\n\nWhen Cypress detects uncaught errors originating from your application it will automatically fail the current test.\n\nThis behavior is configurable, and you can choose to turn this off by listening to the `uncaught:exception` event.\n\nhttps://on.cypress.io/uncaught-exception-from-application\n at mQt.queryKnowledge (http://localhost:8081/__cypress/src/node_modules/.vite/deps/@abi-software_flatmapvuer.js?v=d2599837:33853:15)\n at async PGt.queryLabels (http://localhost:8081/__cypress/src/node_modules/.vite/deps/@abi-software_flatmapvuer.js?v=d2599837:103776:19)\n at async PGt.zM (http://localhost:8081/__cypress/src/node_modules/.vite/deps/@abi-software_flatmapvuer.js?v=d2599837:103862:15)\n at async PGt.setupUserInteractions_ (http://localhost:8081/__cypress/src/node_modules/.vite/deps/@abi-software_flatmapvuer.js?v=d2599837:102812:5)", "diff": null }, "uuid": "e129a714-760a-4cb1-8e9f-e7c5d6f7f388", "parentUUID": "0477b816-c699-4575-b264-7703ede0c6ac", "isHook": false, "skipped": false } ], "suites": [], "passes": [], "failures": [ "e129a714-760a-4cb1-8e9f-e7c5d6f7f388" ], "pending": [], "skipped": [], "duration": 171020, "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" } } }