From 132aed137f9a6f0e91dcd3eeccd7aa28bf186ff9 Mon Sep 17 00:00:00 2001 From: VoodooWonderBot Date: Thu, 20 Jun 2024 14:36:05 -0600 Subject: [PATCH 1/3] hello testing --- powerscore-entryboard/cypress.config.ts | 2 +- .../cypress/e2e/entryboard.cy.ts | 6 +++++ .../cypress/e2e/scorekeeper.cy.ts | 6 ----- powerscore-entryboard/package-lock.json | 22 +++++++++---------- powerscore-entryboard/package.json | 3 ++- 5 files changed, 20 insertions(+), 19 deletions(-) create mode 100644 powerscore-entryboard/cypress/e2e/entryboard.cy.ts delete mode 100644 powerscore-entryboard/cypress/e2e/scorekeeper.cy.ts diff --git a/powerscore-entryboard/cypress.config.ts b/powerscore-entryboard/cypress.config.ts index c8fac12..68b705e 100644 --- a/powerscore-entryboard/cypress.config.ts +++ b/powerscore-entryboard/cypress.config.ts @@ -3,7 +3,7 @@ import { defineConfig } from 'cypress' export default defineConfig({ e2e: { specPattern: 'cypress/e2e/**/*.{cy,spec}.{js,jsx,ts,tsx}', - baseUrl: 'http://localhost:4173' + baseUrl: 'http://localhost:5173' }, component: { specPattern: 'src/**/__tests__/*.{cy,spec}.{js,ts,jsx,tsx}', diff --git a/powerscore-entryboard/cypress/e2e/entryboard.cy.ts b/powerscore-entryboard/cypress/e2e/entryboard.cy.ts new file mode 100644 index 0000000..3e03585 --- /dev/null +++ b/powerscore-entryboard/cypress/e2e/entryboard.cy.ts @@ -0,0 +1,6 @@ +describe('Did it reach out', () => { + it('Attempts to connect to remote server', () => { + cy.visit('/') + cy.contains('h1', 'You did it!') + }) + }) \ No newline at end of file diff --git a/powerscore-entryboard/cypress/e2e/scorekeeper.cy.ts b/powerscore-entryboard/cypress/e2e/scorekeeper.cy.ts deleted file mode 100644 index f4f8cd9..0000000 --- a/powerscore-entryboard/cypress/e2e/scorekeeper.cy.ts +++ /dev/null @@ -1,6 +0,0 @@ -describe('Scorekeeper spec', () => { - it('visits the scorekeeper workspace', () => { - cy.visit('/#/scorekeeper') - }) -}) -// TODO: add more tests once stuff is working better diff --git a/powerscore-entryboard/package-lock.json b/powerscore-entryboard/package-lock.json index 86328f6..1a6f9ea 100644 --- a/powerscore-entryboard/package-lock.json +++ b/powerscore-entryboard/package-lock.json @@ -20,7 +20,7 @@ "@vue/eslint-config-typescript": "^13.0.0", "@vue/tsconfig": "^0.5.1", "autoprefixer": "^10.4.19", - "cypress": "^13.7.2", + "cypress": "^13.12.0", "eslint": "^8.57.0", "eslint-plugin-cypress": "^2.15.1", "eslint-plugin-vue": "^9.23.0", @@ -2424,12 +2424,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -2817,9 +2817,9 @@ "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/cypress": { - "version": "13.9.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.9.0.tgz", - "integrity": "sha512-atNjmYfHsvTuCaxTxLZr9xGoHz53LLui3266WWxXJHY7+N6OdwJdg/feEa3T+buez9dmUXHT1izCOklqG82uCQ==", + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.12.0.tgz", + "integrity": "sha512-udzS2JilmI9ApO/UuqurEwOvThclin5ntz7K0BtnHBs+tg2Bl9QShLISXpSEMDv/u8b6mqdoAdyKeZiSqKWL8g==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -3832,9 +3832,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" diff --git a/powerscore-entryboard/package.json b/powerscore-entryboard/package.json index 9573bba..6cdd410 100644 --- a/powerscore-entryboard/package.json +++ b/powerscore-entryboard/package.json @@ -4,6 +4,7 @@ "private": true, "type": "module", "scripts": { + "cy:open": "cypress open", "dev": "vite", "build": "run-p type-check \"build-only {@}\" --", "preview": "vite preview", @@ -29,7 +30,7 @@ "@vue/eslint-config-typescript": "^13.0.0", "@vue/tsconfig": "^0.5.1", "autoprefixer": "^10.4.19", - "cypress": "^13.7.2", + "cypress": "^13.12.0", "eslint": "^8.57.0", "eslint-plugin-cypress": "^2.15.1", "eslint-plugin-vue": "^9.23.0", From 194bf5749f0ff754dce141c63b986f845be870ac Mon Sep 17 00:00:00 2001 From: VoodooWonderBot Date: Fri, 21 Jun 2024 18:33:01 -0600 Subject: [PATCH 2/3] got it working --- powerscore-entryboard/cypress/e2e/entryboard.cy.ts | 6 ++++-- powerscore-entryboard/src/components/Entryboard.vue | 2 +- powerscore-entryboard/src/components/TeamInfo.vue | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/powerscore-entryboard/cypress/e2e/entryboard.cy.ts b/powerscore-entryboard/cypress/e2e/entryboard.cy.ts index 3e03585..d417e68 100644 --- a/powerscore-entryboard/cypress/e2e/entryboard.cy.ts +++ b/powerscore-entryboard/cypress/e2e/entryboard.cy.ts @@ -1,6 +1,8 @@ describe('Did it reach out', () => { - it('Attempts to connect to remote server', () => { + it('Grabs data from a remote server', () => { cy.visit('/') - cy.contains('h1', 'You did it!') + cy.intercept({ url: '/teams' }).as('request') + cy.wait('@request') + cy.get('.assignment').should('contain.text', 'Awesome Team') }) }) \ No newline at end of file diff --git a/powerscore-entryboard/src/components/Entryboard.vue b/powerscore-entryboard/src/components/Entryboard.vue index a105302..7da39e8 100644 --- a/powerscore-entryboard/src/components/Entryboard.vue +++ b/powerscore-entryboard/src/components/Entryboard.vue @@ -37,7 +37,7 @@ onMounted( () => { refreshTeams() setInterval( () => { refreshTeams() - }, 10000) + }, 3000) }) function getTeams() : Team[] { diff --git a/powerscore-entryboard/src/components/TeamInfo.vue b/powerscore-entryboard/src/components/TeamInfo.vue index e2b8ef5..043a0e2 100644 --- a/powerscore-entryboard/src/components/TeamInfo.vue +++ b/powerscore-entryboard/src/components/TeamInfo.vue @@ -24,7 +24,7 @@ onMounted( () => { setTeam() setInterval( () => { setTeam() - }, 10000) + }, 3000) }) From a98ec268284670317b1a2471b7031e0151414e0c Mon Sep 17 00:00:00 2001 From: VoodooWonderBot Date: Fri, 21 Jun 2024 18:40:46 -0600 Subject: [PATCH 3/3] udated readme --- powerscore-entryboard/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/powerscore-entryboard/README.md b/powerscore-entryboard/README.md index bc26bb8..9fdd6c5 100644 --- a/powerscore-entryboard/README.md +++ b/powerscore-entryboard/README.md @@ -15,3 +15,7 @@ You will need to run `npm install json-server` if you've never installed it # Editboard Reachable through /editboard, which really means /#/editboard the way this server is configured. Not hooked up to anything, it's pretty much a demo + +# Unit Testing + +In addition to the usual cypress startup, the JSON-server must be active \ No newline at end of file