Skip to content

Commit

Permalink
Cypress Dashboard Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rickychen174 committed Aug 25, 2022
1 parent b93b150 commit 207d09b
Show file tree
Hide file tree
Showing 8 changed files with 135 additions and 1 deletion.
9 changes: 9 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { defineConfig } = require("cypress");

module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
});
5 changes: 4 additions & 1 deletion cypress/cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
module.exports = {
projectId: "vfhufb"
projectId: "vfhufb",
e2e: {
baseUrl: 'http://localhost:3000'
}
}
13 changes: 13 additions & 0 deletions cypress/e2e/test.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const { assert } = require("chai")

describe('empty spec', () => {
it('passes', () => {
assert(true);
})

it('sometimes passes', () => {
var result = Math.floor(Math.random() * 3);
console.log(result);
assert(result == 0)
})
})
5 changes: 5 additions & 0 deletions cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "[email protected]",
"body": "Fixtures are a great way to mock data for responses to routes"
}
25 changes: 25 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -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 changes: 20 additions & 0 deletions cypress/support/e2e.js
Original file line number Diff line number Diff line change
@@ -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')
55 changes: 55 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
"private": true,
"dependencies": {
"auth0": "~2.37.0",
"chai": "~4.3.6",
"cypress": "~10.6.0",
"mongoose": "^6.2.3",
"validator": "^13.7.0"
},
"scripts": {
"cy:runSandbox": "cypress run --headed --browser chrome --config-file cypress/cypress.config.js --record --key 2ede467f-d100-4c79-8899-11181c39c6ee"
}
}

0 comments on commit 207d09b

Please sign in to comment.