Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/end-to-end-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- uses: cypress-io/github-action@v2
with:
start: npm start --prefix web
wait-on: 'http://localhost:8080/status'
wait-on-timeout: 120
4 changes: 4 additions & 0 deletions web/cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"projectId": "m6njzj",
"baseUrl": "http://localhost:3000"
}
5 changes: 5 additions & 0 deletions web/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": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}
26 changes: 26 additions & 0 deletions web/cypress/integration/upload.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const openSettingsModal = () => {
cy.visit('/upload');
cy.findByRole('link', { name: /settings/i }).click();
}

const closeSettingsModal = () => {
cy.findByRole('button', {
name: /close/i
}).click()
}

describe('Upload', () => {
it('user can open settings', () => {
openSettingsModal();
cy.findByRole('heading', {
name: /card options/i,
});
});
it('user can close settings', () => {
openSettingsModal();
closeSettingsModal();
cy.findByRole('heading', {
name: /card options/i,
}).should('not.exist');
});
});
1 change: 1 addition & 0 deletions web/cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "@testing-library/cypress/add-commands"
20 changes: 20 additions & 0 deletions web/cypress/support/index.js
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')
Loading