Added cypress e2e tests

This commit is contained in:
Przemek Wiech 2020-02-14 23:46:46 +01:00
parent 543a910c2f
commit 358f6c6a7d
6 changed files with 937 additions and 37 deletions

4
.gitignore vendored
View File

@ -1,3 +1,7 @@
build
node_modules
src/react-app-env.d.ts
cypress/fixtures/example.json
cypress/plugins/index.js
cypress/support/commands.js
cypress/support/index.js

5
cypress.json Normal file
View File

@ -0,0 +1,5 @@
{
"viewportWidth": 1280,
"viewportHeight": 1024,
"baseUrl": "http://localhost:3000/#"
}

View File

@ -0,0 +1,13 @@
describe('Chart view', () => {
beforeEach(() => {
cy.visit('/view?handleCors=false&url=https%3A%2F%2Fraw.githubusercontent.com%2FPeWu%2Ftopola%2Fmaster%2Fdemo%2Fdata%2Ffamily.ged');
});
it('loads data from URL', () => {
cy.contains('Bonifacy');
});
it('Animates chart', () => {
cy.contains('Chike').should('not.exist');
cy.contains('Radobod').click({force: true});
cy.contains('Chike');
});
});

View File

@ -0,0 +1,12 @@
describe('Intro page', () => {
beforeEach(() => {
cy.visit('/');
});
it('displays intro text', () => {
cy.contains('Here are some examples');
});
it('displays menu', () => {
cy.contains('Load from URL');
cy.contains('Load from file');
});
});

939
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -43,6 +43,7 @@
"@types/react-dom": "*",
"@types/react-intl": "^2.3.15",
"@types/react-router-dom": "^4.3.1",
"cypress": "^4.0.1",
"gh-pages": "^2.0.1",
"prettier": "^1.15.3",
"react-scripts": "^3.0.1",