Skip to content

Commit f4020de

Browse files
committed
add cypress and visit tests
1 parent a609fee commit f4020de

File tree

8 files changed

+1600
-40
lines changed

8 files changed

+1600
-40
lines changed

cypress.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

cypress/fixtures/example.json

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

cypress/integration/test_visit.js

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
describe('Visit Tests', function() {
2+
it('Visits the Explorer', function() {
3+
cy.visit('http://localhost:8000/explorer')
4+
})
5+
it('Visits the Grants Page', function() {
6+
cy.visit('http://localhost:8000/grants')
7+
})
8+
it('Visits the Landing Page', function() {
9+
cy.visit('http://localhost:8000/')
10+
})
11+
it('Visits the Kudos Page', function() {
12+
cy.visit('http://localhost:8000/kudos')
13+
})
14+
it('Visits the Kudos Marketplace', function() {
15+
cy.visit('http://localhost:8000/kudos/marketplace')
16+
})
17+
/*
18+
it('Visits the Kudos Sender', function() {
19+
cy.visit('http://localhost:8000/kudos/send')
20+
cy.url().should('contain', 'github.com')
21+
})
22+
*/
23+
it('Visits the Labs Page', function() {
24+
cy.visit('http://localhost:8000/explorer')
25+
})
26+
it('Visits the About Page', function() {
27+
cy.visit('http://localhost:8000/about')
28+
})
29+
it('Visits the Mission Page', function() {
30+
cy.visit('http://localhost:8000/mission')
31+
})
32+
/*
33+
it('Visits the Results Page', function() {
34+
cy.visit('http://localhost:8000/results')
35+
})
36+
*/
37+
it('Visits the Activity Page', function() {
38+
cy.visit('http://localhost:8000/activity')
39+
})
40+
it('Visits the Help Page', function() {
41+
cy.visit('http://localhost:8000/help')
42+
})
43+
it('Visits the Terms of Service Page', function() {
44+
cy.visit('http://localhost:8000/legal/terms')
45+
})
46+
it('Visits the Privacy Page', function() {
47+
cy.visit('http://localhost:8000/legal/privacy')
48+
})
49+
})

cypress/plugins/index.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// ***********************************************************
2+
// This example plugins/index.js can be used to load plugins
3+
//
4+
// You can change the location of this file or turn off loading
5+
// the plugins file with the 'pluginsFile' configuration option.
6+
//
7+
// You can read more here:
8+
// https://on.cypress.io/plugins-guide
9+
// ***********************************************************
10+
11+
// This function is called when a project is opened or re-opened (e.g. due to
12+
// the project's config changing)
13+
14+
module.exports = (on, config) => {
15+
// `on` is used to hook into various events Cypress emits
16+
// `config` is the resolved Cypress config
17+
}

cypress/support/commands.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// ***********************************************
2+
// This example commands.js shows you how to
3+
// create various custom commands and overwrite
4+
// existing commands.
5+
//
6+
// For more comprehensive examples of custom
7+
// commands please read more here:
8+
// https://on.cypress.io/custom-commands
9+
// ***********************************************
10+
//
11+
//
12+
// -- This is a parent command --
13+
// Cypress.Commands.add("login", (email, password) => { ... })
14+
//
15+
//
16+
// -- This is a child command --
17+
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
18+
//
19+
//
20+
// -- This is a dual command --
21+
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
22+
//
23+
//
24+
// -- This is will overwrite an existing command --
25+
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })

cypress/support/index.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// ***********************************************************
2+
// This example support/index.js is processed and
3+
// loaded automatically before your test files.
4+
//
5+
// This is a great place to put global configuration and
6+
// behavior that modifies Cypress.
7+
//
8+
// You can change the location of this file or turn off
9+
// automatically serving support files with the
10+
// 'supportFile' configuration option.
11+
//
12+
// You can read more here:
13+
// https://on.cypress.io/configuration
14+
// ***********************************************************
15+
16+
// Import commands.js using ES2015 syntax:
17+
import './commands'
18+
19+
// Alternatively you can use CommonJS syntax:
20+
// require('./commands')
21+
22+
Cypress.on('uncaught:exception', (err, runnable) => {
23+
// returning false here prevents Cypress from
24+
// failing the test
25+
return false
26+
})

0 commit comments

Comments
 (0)