From 3a32fc31c6fa1f56f062fff24196112d4ec964d9 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Tue, 22 Oct 2024 18:05:05 -0700 Subject: [PATCH] test --- package-lock.json | 126 +++++++++++++++++++++++++++++ package.json | 1 + src/components/modeler/Modeler.vue | 3 + tests/e2e/plugins/index.js | 5 ++ tests/e2e/support/index.js | 3 +- 5 files changed, 137 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 34f34014d..b4ae09fd5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -72,6 +72,7 @@ "circular-dependency-plugin": "^5.2.2", "copy-webpack-plugin": "^5.1.1", "cypress": "^13.5.1", + "cypress-terminal-report": "^7.0.4", "eslint": "^7.32.0", "eslint-plugin-cypress": "^2.15.1", "eslint-plugin-jest": "^27.2.3", @@ -11992,6 +11993,124 @@ "node": "^16.0.0 || ^18.0.0 || >=20.0.0" } }, + "node_modules/cypress-terminal-report": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cypress-terminal-report/-/cypress-terminal-report-7.0.4.tgz", + "integrity": "sha512-atP8It2IwcgzJ3YsQcwYFbnuCC/KSGPEUaorJsJi3E9JE93IdFf21LuwuApOfbEMmqVu6mPtlxmxqutBFZNxhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "compare-versions": "^6.1.1", + "fs-extra": "^10.1.0", + "process": "^0.11.10", + "superstruct": "0.14.2" + }, + "engines": { + "node": ">= 12" + }, + "peerDependencies": { + "cypress": ">=10.0.0" + } + }, + "node_modules/cypress-terminal-report/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/cypress-terminal-report/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/cypress-terminal-report/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/cypress-terminal-report/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/cypress-terminal-report/node_modules/compare-versions": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.1.tgz", + "integrity": "sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cypress-terminal-report/node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cypress-terminal-report/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cypress-terminal-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/cypress/node_modules/ansi-styles": { "version": "4.3.0", "dev": true, @@ -26546,6 +26665,13 @@ "node": ">=10" } }, + "node_modules/superstruct": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.14.2.tgz", + "integrity": "sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ==", + "dev": true, + "license": "MIT" + }, "node_modules/supports-color": { "version": "5.5.0", "license": "MIT", diff --git a/package.json b/package.json index 02aee9eb9..a78226210 100644 --- a/package.json +++ b/package.json @@ -101,6 +101,7 @@ "circular-dependency-plugin": "^5.2.2", "copy-webpack-plugin": "^5.1.1", "cypress": "^13.5.1", + "cypress-terminal-report": "^7.0.4", "eslint": "^7.32.0", "eslint-plugin-cypress": "^2.15.1", "eslint-plugin-jest": "^27.2.3", diff --git a/src/components/modeler/Modeler.vue b/src/components/modeler/Modeler.vue index 025bf6010..81a579dc2 100644 --- a/src/components/modeler/Modeler.vue +++ b/src/components/modeler/Modeler.vue @@ -2490,8 +2490,11 @@ export default { }, }, created() { + console.log('CREATED', typeof window.Cypress, runningInCypressTest()); if (runningInCypressTest()) { /* Add reference to store on window; this is used in testing to verify rendered nodes */ + console.log('Setting store to', store); + console.log('store.state.paper', store.state.paper); window.store = store; window.undoRedoStore = undoRedoStore; } diff --git a/tests/e2e/plugins/index.js b/tests/e2e/plugins/index.js index 410592758..63722f0f5 100644 --- a/tests/e2e/plugins/index.js +++ b/tests/e2e/plugins/index.js @@ -19,5 +19,10 @@ module.exports = (on, config) => { require('@cypress/code-coverage/task')(on, config); + require('cypress-terminal-report/src/installLogsPrinter')(on, { + // printLogsToConsole: 'always', + // collectTypes: ['cons:log'], + }); + return config; }; diff --git a/tests/e2e/support/index.js b/tests/e2e/support/index.js index 588ed070e..00f8639b3 100644 --- a/tests/e2e/support/index.js +++ b/tests/e2e/support/index.js @@ -35,4 +35,5 @@ beforeEach(() => { waitToRenderAllShapes(); }); -require('./printLogsToTerminal'); +// require('./printLogsToTerminal'); +require('cypress-terminal-report/src/installLogsCollector')();