diff --git a/client/cypress.config.js b/client/cypress.config.js new file mode 100644 index 00000000..6874dca6 --- /dev/null +++ b/client/cypress.config.js @@ -0,0 +1,10 @@ +const { defineConfig } = require("cypress"); + +module.exports = defineConfig({ + component: { + devServer: { + framework: "nuxt", + bundler: "webpack", + }, + }, +}); diff --git a/client/cypress/support/commands.js b/client/cypress/support/commands.js new file mode 100644 index 00000000..66ea16ef --- /dev/null +++ b/client/cypress/support/commands.js @@ -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) => { ... }) \ No newline at end of file diff --git a/client/cypress/support/component-index.html b/client/cypress/support/component-index.html new file mode 100644 index 00000000..a19e8295 --- /dev/null +++ b/client/cypress/support/component-index.html @@ -0,0 +1,13 @@ + + + + + + + + Components App + + +
+ + \ No newline at end of file diff --git a/client/cypress/support/component.js b/client/cypress/support/component.js new file mode 100644 index 00000000..e0b83383 --- /dev/null +++ b/client/cypress/support/component.js @@ -0,0 +1,28 @@ +// *********************************************************** +// This example support/component.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 '../../assets/app.css' +import './tailwind.compiled.css' +// Import commands.js using ES2015 syntax: +import './commands' + +// Alternatively you can use CommonJS syntax: +// require('./commands') + +import { mount } from 'cypress/vue2' + +Cypress.Commands.add('mount', mount) + +// Example use: +// cy.mount(MyComponent) \ No newline at end of file diff --git a/client/nuxt.config.js b/client/nuxt.config.js index b5659086..7dde5572 100644 --- a/client/nuxt.config.js +++ b/client/nuxt.config.js @@ -153,4 +153,6 @@ module.exports = { * See: [Issue tracker](https://github.com/nuxt-community/tailwindcss-module/issues/480) */ devServerHandlers: [], + + ignore: ["**/*.test.*", "**/*.cy.*"] }