diff --git a/package.json b/package.json index e19be12..6673de9 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "lint": "eslint --ext .js,.vue .", "format": "prettier --ignore-path .prettierignore --write app server", "test": "yarn node --experimental-vm-modules $(yarn bin jest)", + "test:e2e": "yarn workspace tests test", "clean": "yarn workspace server clean" }, "devDependencies": { diff --git a/tests/cypress.config.js b/tests/cypress.config.js index fc2ce34..3a0330e 100644 --- a/tests/cypress.config.js +++ b/tests/cypress.config.js @@ -1,9 +1,12 @@ const { defineConfig } = require('cypress') +const process = require('process') + +const getConfig = (key, defaultValue) => { + return process.env[key] || defaultValue +} module.exports = defineConfig({ e2e: { - setupNodeEvents(on, config) { - // implement node event listeners here - }, + baseUrl: getConfig('BASE_URL', 'http://localhost:5173'), }, }) diff --git a/tests/cypress/e2e/helloworld.cy.js b/tests/cypress/e2e/helloworld.cy.js index ebccf98..b772b68 100644 --- a/tests/cypress/e2e/helloworld.cy.js +++ b/tests/cypress/e2e/helloworld.cy.js @@ -1,7 +1,7 @@ /// describe('example helloworld app', () => { beforeEach(() => { - cy.visit('http://localhost:5173') + cy.visit('/') }) it('open login page', () => { diff --git a/tests/package.json b/tests/package.json index d5f5141..af8e1fa 100644 --- a/tests/package.json +++ b/tests/package.json @@ -1,9 +1,12 @@ { - "name": "e2e", + "name": "tests", "version": "1.0.0", "private": true, "main": "index.js", "license": "MIT", + "scripts": { + "test": "cypress run" + }, "dependencies": { "cypress": "^13.2.0" }