-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
18,830 additions
and
892 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
/node_modules | ||
/lib | ||
/lib | ||
/cypress/server-test/node_modules | ||
/cypress/videos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
src | ||
cypress | ||
cypress.config.ts | ||
tsconfig.json | ||
tslint.json | ||
.prettierrc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { defineConfig } from "cypress"; | ||
|
||
export default defineConfig({ | ||
e2e: { | ||
setupNodeEvents(on, config) { | ||
// implement node event listeners here | ||
}, | ||
}, | ||
retries: 2 | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
beforeEach(() => { | ||
cy.visit('http://localhost:3000') | ||
cy.wait(500) | ||
}) | ||
|
||
describe('server is started', () => { | ||
it('homepage title is present', () => { | ||
cy.get('h1').should('contain', 'Vuetify') | ||
}) | ||
|
||
it('create dialog', () => { | ||
cy.get('button#create-dialog').click() | ||
cy.get('div.v-overlay--active').should('exist') | ||
cy.get('div.v-card-title').should('contain', 'My dialog') | ||
cy.get('div.v-card-text').should('contain', 'Hello world!') | ||
cy.get('div.v-card-actions').find('button').should('have.length', 2) | ||
}) | ||
|
||
it('success dialog', () => { | ||
cy.get('button#success-dialog').click() | ||
cy.get('div.v-overlay--active').should('exist') | ||
cy.get('div.v-card-title').should('contain', 'My success dialog') | ||
cy.get('div.v-card-title').find('i').should('have.class', 'mdi-check-circle') | ||
cy.get('div.v-card-title').find('i').should('have.class', 'text-success') | ||
cy.get('div.v-card-text').should('contain', 'Hello world!') | ||
cy.get('div.v-card-actions').find('button').should('have.length', 1) | ||
cy.get('div.v-card-actions').find('button').should('have.class', 'text-success') | ||
}) | ||
|
||
it('confirm dialog', () => { | ||
|
||
// Stub console.log to check if confirm dialog is true, because of click on confirm button | ||
cy.window() | ||
.its('console') | ||
.then((console) => { | ||
cy.stub(console, 'log').callsFake((msg) => { | ||
expect(typeof msg).to.equal('boolean') | ||
expect(msg).to.equal(true) | ||
}) | ||
}) | ||
cy.get('button#confirm-dialog').click() | ||
cy.get('div.v-overlay--active').should('exist') | ||
cy.get('div.v-card-title').should('contain', 'My confirm dialog') | ||
cy.get('div.v-card-title').find('i').should('have.class', 'mdi-alert') | ||
cy.get('div.v-card-title').find('i').should('have.class', 'text-warning') | ||
cy.get('div.v-card-text').should('contain', 'Hello world!') | ||
cy.get('div.v-card-actions').find('button').should('have.length', 2) | ||
cy.get('div.v-card-actions').find('button').should('have.class', 'text-warning') | ||
cy.get('div.v-card-actions').find('button').should('have.class', 'text-grey') | ||
cy.get('div.v-card-actions').find('button').should('contain', 'Cancel button') | ||
cy.get('div.v-card-actions').find('button').should('contain', 'Confirm button') | ||
//click on confirm button | ||
cy.get('div.v-card-actions').find('button').eq(1).click() | ||
}) | ||
|
||
it('create SFC dialog', () => { | ||
cy.get('button#sfc-create-dialog').click() | ||
cy.get('div.v-overlay--active').should('exist') | ||
cy.get('div.v-card-title').should('contain', 'My SFC dialog') | ||
cy.get('div.v-card-text').should('contain', 'Hello world!') | ||
cy.get('div.v-card-actions').find('button').should('have.length', 2) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
beforeEach(() => { | ||
cy.visit('http://localhost:3000') | ||
cy.wait(500) | ||
}) | ||
|
||
it('create notification', () => { | ||
cy.get('button#create-notification').click() | ||
cy.get('div.v-snackbar--active').should('exist') | ||
cy.get('div.v-snackbar__wrapper').should('exist') | ||
cy.get('div.v-snackbar__content').should('contain', 'Hello world!') | ||
cy.get('div.v-snackbar__wrapper').should('have.class', 'bg-info') | ||
}) | ||
|
||
it('error notification', () => { | ||
cy.get('button#error-notification').click() | ||
cy.get('div.v-snackbar--active').should('exist') | ||
cy.get('div.v-snackbar__wrapper').should('exist') | ||
cy.get('div.v-snackbar__content').should('contain', 'Hello error!') | ||
cy.get('div.v-snackbar__wrapper').should('have.class', 'bg-error') | ||
}) | ||
|
||
it('create sfc notification', () => { | ||
cy.get('button#sfc-create-notification').click() | ||
cy.get('div.v-snackbar--active').should('exist') | ||
cy.get('div.v-snackbar__wrapper').should('exist') | ||
cy.get('div.v-snackbar__content').should('contain', 'My SFC notification!') | ||
cy.get('div.v-snackbar__wrapper').should('have.class', 'bg-success') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/// <reference types="cypress" /> | ||
// *********************************************** | ||
// This example commands.ts 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) => { ... }) | ||
// | ||
// declare global { | ||
// namespace Cypress { | ||
// interface Chainable { | ||
// login(email: string, password: string): Chainable<void> | ||
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element> | ||
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element> | ||
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element> | ||
// } | ||
// } | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// *********************************************************** | ||
// This example support/e2e.ts 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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
> 1% | ||
last 2 versions | ||
not dead | ||
not ie 11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[*.{js,jsx,ts,tsx,vue}] | ||
indent_style = space | ||
indent_size = 2 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
node: true, | ||
}, | ||
extends: [ | ||
'plugin:vue/vue3-essential', | ||
'eslint:recommended', | ||
'@vue/eslint-config-typescript', | ||
], | ||
rules: { | ||
'vue/multi-word-component-names': 'off', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.DS_Store | ||
node_modules | ||
/dist | ||
|
||
|
||
# local env files | ||
.env.local | ||
.env.*.local | ||
|
||
# Log files | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
|
||
# Editor directories and files | ||
.idea | ||
.vscode | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# default | ||
|
||
## Project setup | ||
|
||
``` | ||
# yarn | ||
yarn | ||
# npm | ||
npm install | ||
# pnpm | ||
pnpm install | ||
``` | ||
|
||
### Compiles and hot-reloads for development | ||
|
||
``` | ||
# yarn | ||
yarn dev | ||
# npm | ||
npm run dev | ||
# pnpm | ||
pnpm dev | ||
``` | ||
|
||
### Compiles and minifies for production | ||
|
||
``` | ||
# yarn | ||
yarn build | ||
# npm | ||
npm run build | ||
# pnpm | ||
pnpm build | ||
``` | ||
|
||
### Customize configuration | ||
|
||
See [Configuration Reference](https://vitejs.dev/config/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//check if node_modules folder exists, and if not run npm install | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const { exec } = require('child_process'); | ||
|
||
const nodeModulesExists = fs.existsSync(path.join(__dirname, '/node_modules')); | ||
|
||
if (!nodeModulesExists) { | ||
console.log('node_modules folder does not exist for cypress/server-test, npm install in progress...'); | ||
exec('npm install', {}, (err, stdout, stderr) => { | ||
if (err) { | ||
console.log(err); | ||
return; | ||
} | ||
console.log(stdout); | ||
console.log(stderr); | ||
}); | ||
} |
Oops, something went wrong.