Update cypress

This commit is contained in:
Paulo Gustavo Veiga 2023-01-07 21:10:13 -08:00
parent 46d4a1c31a
commit 62ea491623
23 changed files with 28 additions and 38 deletions

View File

@ -7,7 +7,9 @@
"eslint:recommended",
"prettier",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended"
"plugin:@typescript-eslint/recommended",
"plugin:cypress/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {

View File

@ -1,4 +1,4 @@
context('Relationship Topics', () => {
describe('Relationship Topics', () => {
beforeEach(() => {
// Remove storage for autosave ...
cy.visit('/editor.html');

View File

@ -1,4 +1,4 @@
context('Render all sample maps', () => {
describe('Render all sample maps', () => {
[
'complex',
'emoji',

View File

@ -1,4 +1,4 @@
context('Edit Topic', () => {
describe('Edit Topic', () => {
beforeEach(() => {
// Remove storage for autosave ...
cy.visit('/editor.html');
@ -14,7 +14,6 @@ context('Edit Topic', () => {
cy.get('body').type('New Title Main Topic{enter}');
cy.get('[test-id=1] > text > tspan').should('have.text', 'New Title Main Topic');
cy.wait(200);
cy.matchImageSnapshot('changeMainTopicText');
});
@ -43,7 +42,6 @@ context('Edit Topic', () => {
cy.get('@bigger').eq(1).click();
cy.get('[test-id=1] > text').invoke('attr', 'font-size').should('eq', '20.2');
cy.wait(200);
cy.matchImageSnapshot('changeFontSizeHuge');
});
@ -53,7 +51,6 @@ context('Edit Topic', () => {
cy.get('[test-id=1] > text').invoke('attr', 'font-style').should('eq', 'italic');
cy.wait(200);
cy.matchImageSnapshot('changeFontItalic');
});
@ -63,7 +60,6 @@ context('Edit Topic', () => {
cy.get('[test-id=1] > text').invoke('attr', 'font-weight').should('eq', 'normal');
cy.wait(200);
cy.matchImageSnapshot('changeFontBold');
});
@ -74,7 +70,6 @@ context('Edit Topic', () => {
cy.get('[test-id=1] > text').invoke('attr', 'fill').should('eq', '#cc0000');
cy.wait(200);
cy.matchImageSnapshot('changeFontColor');
});
});

View File

@ -1,65 +1,61 @@
context('Node manager', () => {
before(() => {
describe('Node manager', () => {
beforeEach(() => {
cy.visit('/editor.html');
// Wait for load complate ...
cy.get('[aria-label="vortex-loading"]').should('not.exist');
// Select root node ...
cy.contains('Mind Mapping').click({ force: true });
});
it('shortcut add sibling node', () => {
cy.contains('Mind Mapping').click({ force: true });
cy.get('body').type('{enter}').type('Mind Mapping rocks!!').type('{enter}');
cy.get('[test-id=36] > text > tspan').should('exist');
cy.wait(200);
cy.matchImageSnapshot('editor-shortcut-edit');
});
it('shortcut add child node', () => {
cy.contains('Mind Mapping rocks!!').click({ force: true });
cy.get('body').type('{insert}').type('Child 1 mind Mapping rocks!!').type('{enter}');
cy.get('body').type('{enter}').type('Child 2 mind Mapping rocks!!').type('{enter}');
cy.get('[test-id=36] > text > tspan').should('exist');
cy.get('[test-id=37] > text > tspan').should('exist');
cy.wait(200);
cy.matchImageSnapshot('addChildNodeSortcut');
});
it('Delete topic', () => {
cy.get('[test-id=37]').click();
cy.get('body').type('{enter}').type('Mind Mapping rocks!!').type('{enter}');
cy.get('[test-id=36]').click();
cy.get('body').type('{del}');
cy.get('[test-id=37]').should('not.exist');
cy.wait(200);
cy.matchImageSnapshot('deleteTopicShortcut');
});
it('undo changes', () => {
cy.get('body').type('{enter}').type('Mind Mapping rocks!!').type('{enter}');
cy.get('[data-testid="UndoOutlinedIcon"]').click();
cy.get('[test-id=36] > text > tspan').should('exist');
cy.wait(200);
cy.matchImageSnapshot('undoChange');
});
it('redo changes', () => {
cy.get('body').type('{enter}').type('Mind Mapping rocks!!').type('{enter}');
cy.get('[data-testid="UndoOutlinedIcon"]').click();
cy.get('[test-id=36] > text > tspan').should('exist');
cy.get('[data-testid="RedoOutlinedIcon"]').click();
cy.get('[test-id=36] > text > tspan').should('exist');
cy.wait(200);
cy.matchImageSnapshot('redoChange');
});
it('Save changes', () => {
cy.contains('Mind Mapping rocks!!').click({ force: true });
cy.get('body').type('{ctrl}s');
cy.wait(200);
cy.matchImageSnapshot('saveChagesShortcut');
});
});

View File

@ -1,4 +1,4 @@
context('Change topic position', () => {
describe('Change topic position', () => {
beforeEach(() => {
// Remove storage for autosave ...
cy.visit('/editor.html');

View File

@ -1,4 +1,4 @@
context('Change Topic shape', () => {
describe('Change Topic shape', () => {
beforeEach(() => {
cy.visit('/editor.html');
cy.reload();
@ -16,7 +16,6 @@ context('Change Topic shape', () => {
.should('be.a', 'number')
.should('eq', 0);
cy.wait(200);
cy.matchImageSnapshot('changeToSquareShape');
});
@ -40,7 +39,6 @@ context('Change Topic shape', () => {
.should('be.a', 'number')
.should('be.lt', 5);
cy.wait(200);
cy.matchImageSnapshot('changeToRoundedRectangle');
});
@ -50,7 +48,6 @@ context('Change Topic shape', () => {
cy.get(`[aria-label="Topic Style"]`).first().trigger('mouseover');
cy.get(`[aria-label="Line shape"]`).first().click();
cy.wait(200);
cy.matchImageSnapshot('changeToLine');
});
@ -74,7 +71,6 @@ context('Change Topic shape', () => {
.should('be.a', 'number')
.should('be.lt', 15);
cy.wait(200);
cy.matchImageSnapshot('changeToEllipseShape');
});
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

View File

@ -6,6 +6,7 @@
"build": "webpack --config webpack.prod.js",
"playground": "webpack serve --config webpack.playground.js",
"cy:run": "cypress run",
"cy:open": "cypress open",
"lint": "eslint src --ext js,ts,tsx",
"test:integration": "start-server-and-test 'yarn playground' http-get://localhost:8081 'yarn cy:run'",
"test": "yarn test:unit && yarn test:integration",
@ -29,6 +30,7 @@
"cypress-image-snapshot": "^4.0.1",
"eslint": "^7.14.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-react": "^7.31.10",
"eslint-plugin-react-hooks": "^4.6.0",
"html-webpack-plugin": "^5.5.0",

View File

@ -1,4 +1,4 @@
context('Editor Page', () => {
describe('Editor Page', () => {
beforeEach(() => {
cy.visit('/c/maps/11/edit');
cy.get('[aria-label="vortex-loading"]', { timeout: 120000 }).should('not.exist');

View File

@ -1,6 +1,4 @@
import MapsPage from '../pageObject/MapsPage';
context('Forgot Password Page', () => {
describe('Forgot Password Page', () => {
beforeEach(() => {
cy.visit('/c/forgot-password');
});

View File

@ -1,4 +1,4 @@
context('Login Page', () => {
describe('Login Page', () => {
beforeEach(() => {
cy.visit('/c/login');
});

View File

@ -1,4 +1,4 @@
context('Maps Page', () => {
describe('Maps Page', () => {
beforeEach(() => {
cy.visit('/c/maps');
cy.get('.MuiCard-root').should('have.length', 3);

View File

@ -1,4 +1,4 @@
context('Registration Page', () => {
describe('Registration Page', () => {
beforeEach(() => {
cy.visit('/c/registration');
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -4785,6 +4785,7 @@ __metadata:
emoji-picker-react: ^4.4.7
eslint: ^7.14.0
eslint-config-prettier: ^8.5.0
eslint-plugin-cypress: ^2.12.1
eslint-plugin-react: ^7.31.10
eslint-plugin-react-hooks: ^4.6.0
html-webpack-plugin: ^5.5.0