-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Cypress integration tests (#354)
- Loading branch information
1 parent
7c39cbb
commit 43e6a6e
Showing
20 changed files
with
1,552 additions
and
2 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
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
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 @@ | ||
*.mp4 |
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,11 @@ | ||
master: | ||
docker-compose -f docker-compose.ci.master.yml up --exit-code-from cypress | ||
|
||
local: | ||
docker build -f ../backend/Dockerfile -t retrospected/backend:local ../backend | ||
docker build -f ../frontend/Dockerfile -t retrospected/frontend:local ../frontend | ||
docker-compose down | ||
docker-compose up -d | ||
yarn | ||
yarn test | ||
docker-compose down |
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,3 @@ | ||
{ | ||
"baseUrl": "http://localhost:1800" | ||
} |
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": "[email protected]", | ||
"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,30 @@ | ||
describe('Home Page', () => { | ||
it('Should load correctly', () => { | ||
cy.visit('/') | ||
|
||
cy.get('div.marketing-content') | ||
.should('contain', 'Real-time Retrospectives') | ||
}); | ||
|
||
it('Should login and write a post', () => { | ||
cy.get('.MuiButton-root').click(); | ||
cy.get('.MuiTabs-flexContainer > [tabindex="-1"]').click(); | ||
cy.get('.MuiInput-input').focus().type('Zelensky'); | ||
cy.get('.MuiDialogContent-root .MuiButton-root').click(); | ||
|
||
// Home page should display the user name | ||
cy.get('#content').should('contain', 'Welcome, Zelensky'); | ||
|
||
// And then allow creating a new session | ||
cy.get('button').contains('Create a new session').click(); | ||
|
||
// And write a post | ||
cy.get('input[placeholder*="What went well"]').focus().type('Slava Ukraini!{enter}'); | ||
|
||
// Reload the page | ||
cy.reload(); | ||
|
||
// The post should still be there | ||
cy.get('#content').should('contain', 'Slava Ukraini!'); | ||
}); | ||
}); |
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,22 @@ | ||
/// <reference types="cypress" /> | ||
// *********************************************************** | ||
// This example plugins/index.js can be used to load plugins | ||
// | ||
// You can change the location of this file or turn off loading | ||
// the plugins file with the 'pluginsFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/plugins-guide | ||
// *********************************************************** | ||
|
||
// This function is called when a project is opened or re-opened (e.g. due to | ||
// the project's config changing) | ||
|
||
/** | ||
* @type {Cypress.PluginConfig} | ||
*/ | ||
// eslint-disable-next-line no-unused-vars | ||
module.exports = (on, config) => { | ||
// `on` is used to hook into various events Cypress emits | ||
// `config` is the resolved Cypress 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,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) => { ... }) |
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/index.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') |
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,67 @@ | ||
version: '3' | ||
services: | ||
cypress: | ||
image: "cypress/included:4.4.0" | ||
ipc: host | ||
depends_on: | ||
- frontend | ||
environment: | ||
- CYPRESS_baseUrl=http://frontend | ||
working_dir: /e2e | ||
volumes: | ||
- ./:/e2e | ||
|
||
postgres: | ||
image: postgres:11.6 | ||
hostname: postgres | ||
environment: | ||
POSTGRES_PASSWORD: some-password | ||
POSTGRES_USER: postgres | ||
POSTGRES_DB: retroboard | ||
volumes: | ||
- database:/var/lib/postgresql/data | ||
restart: unless-stopped | ||
logging: | ||
driver: 'json-file' | ||
options: | ||
max-size: '50m' | ||
|
||
backend: | ||
image: retrospected/backend:alpha | ||
depends_on: | ||
- redis | ||
environment: | ||
SELF_HOSTED_ADMIN: '[email protected]' | ||
DB_PASSWORD: some-password | ||
SESSION_SECRET: im-a-secret | ||
|
||
restart: unless-stopped | ||
logging: | ||
driver: 'json-file' | ||
options: | ||
max-size: '50m' | ||
|
||
frontend: | ||
image: retrospected/frontend:alpha | ||
depends_on: | ||
- backend | ||
restart: unless-stopped | ||
logging: | ||
driver: 'json-file' | ||
options: | ||
max-size: '50m' | ||
|
||
redis: | ||
image: redis:latest | ||
depends_on: | ||
- postgres | ||
restart: unless-stopped | ||
logging: | ||
driver: 'json-file' | ||
options: | ||
max-size: '50m' | ||
|
||
|
||
volumes: | ||
database: | ||
pgadmin: |
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,67 @@ | ||
version: '3' | ||
services: | ||
cypress: | ||
image: "cypress/included:4.4.0" | ||
ipc: host | ||
depends_on: | ||
- frontend | ||
environment: | ||
- CYPRESS_baseUrl=http://frontend | ||
working_dir: /e2e | ||
volumes: | ||
- ./:/e2e | ||
|
||
postgres: | ||
image: postgres:11.6 | ||
hostname: postgres | ||
environment: | ||
POSTGRES_PASSWORD: some-password | ||
POSTGRES_USER: postgres | ||
POSTGRES_DB: retroboard | ||
volumes: | ||
- database:/var/lib/postgresql/data | ||
restart: unless-stopped | ||
logging: | ||
driver: 'json-file' | ||
options: | ||
max-size: '50m' | ||
|
||
backend: | ||
image: retrospected/backend:canary | ||
depends_on: | ||
- redis | ||
environment: | ||
SELF_HOSTED_ADMIN: '[email protected]' | ||
DB_PASSWORD: some-password | ||
SESSION_SECRET: im-a-secret | ||
|
||
restart: unless-stopped | ||
logging: | ||
driver: 'json-file' | ||
options: | ||
max-size: '50m' | ||
|
||
frontend: | ||
image: retrospected/frontend:canary | ||
depends_on: | ||
- backend | ||
restart: unless-stopped | ||
logging: | ||
driver: 'json-file' | ||
options: | ||
max-size: '50m' | ||
|
||
redis: | ||
image: redis:latest | ||
depends_on: | ||
- postgres | ||
restart: unless-stopped | ||
logging: | ||
driver: 'json-file' | ||
options: | ||
max-size: '50m' | ||
|
||
|
||
volumes: | ||
database: | ||
pgadmin: |
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,67 @@ | ||
version: '3' | ||
services: | ||
cypress: | ||
image: "cypress/included:4.4.0" | ||
ipc: host | ||
depends_on: | ||
- frontend | ||
environment: | ||
- CYPRESS_baseUrl=http://frontend | ||
working_dir: /e2e | ||
volumes: | ||
- ./:/e2e | ||
|
||
postgres: | ||
image: postgres:11.6 | ||
hostname: postgres | ||
environment: | ||
POSTGRES_PASSWORD: some-password | ||
POSTGRES_USER: postgres | ||
POSTGRES_DB: retroboard | ||
volumes: | ||
- database:/var/lib/postgresql/data | ||
restart: unless-stopped | ||
logging: | ||
driver: 'json-file' | ||
options: | ||
max-size: '50m' | ||
|
||
backend: | ||
image: retrospected/backend:latest | ||
depends_on: | ||
- redis | ||
environment: | ||
SELF_HOSTED_ADMIN: '[email protected]' | ||
DB_PASSWORD: some-password | ||
SESSION_SECRET: im-a-secret | ||
|
||
restart: unless-stopped | ||
logging: | ||
driver: 'json-file' | ||
options: | ||
max-size: '50m' | ||
|
||
frontend: | ||
image: retrospected/frontend:latest | ||
depends_on: | ||
- backend | ||
restart: unless-stopped | ||
logging: | ||
driver: 'json-file' | ||
options: | ||
max-size: '50m' | ||
|
||
redis: | ||
image: redis:latest | ||
depends_on: | ||
- postgres | ||
restart: unless-stopped | ||
logging: | ||
driver: 'json-file' | ||
options: | ||
max-size: '50m' | ||
|
||
|
||
volumes: | ||
database: | ||
pgadmin: |
Oops, something went wrong.