Adding Cypress

This commit is contained in:
Nigel Barink 2024-11-04 21:40:59 +01:00
parent 2b2d1bb6a2
commit 1a5a4f3ec9
Signed by: Nigel
GPG Key ID: 6893A31C2D84A9D2
7 changed files with 2215 additions and 1 deletions

12
cypress.config.js Normal file
View File

@ -0,0 +1,12 @@
const { defineConfig } = require("cypress");
module.exports = defineConfig({
e2e: {
specPattern: [
"tests/e2e/**/*.cy.{js,jsx}"
],
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
});

View File

@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}

View File

@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })

20
cypress/support/e2e.js Normal file
View File

@ -0,0 +1,20 @@
// ***********************************************************
// This example support/e2e.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import './commands'
// Alternatively you can use CommonJS syntax:
// require('./commands')

2143
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,8 @@
"version": "1.0.0",
"main": "server/js/App.js",
"scripts": {
"start": "webpack serve --config webpack.config.js"
"start": "webpack serve --config webpack.config.js",
"cy:open": "cypress open"
},
"author": "",
"license": "ISC",
@ -22,6 +23,9 @@
"@babel/core": "^7.26.0",
"@babel/preset-env": "^7.26.0",
"babel-loader": "^9.2.1",
"cypress": "^13.15.1",
"mocha": "^10.8.2",
"nodemon": "^3.1.7",
"vue-loader": "^17.4.2"
}
}

View File

@ -0,0 +1,5 @@
describe('My first test', () => {
it('Does not do much!', () => {
expect(true).to.equal(true);
})
})