diff --git a/.gitignore b/.gitignore index c3d3c1a1..21a52a85 100644 --- a/.gitignore +++ b/.gitignore @@ -49,4 +49,6 @@ Thumbs.db *.wmv **/build/**/* -.vscode \ No newline at end of file +.vscode + +*/test/playground/dist \ No newline at end of file diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 3fd78c62..4246db69 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -17,7 +17,6 @@ pipelines: - cypress script: - export CYPRESS_imageSnaphots="true" - - yarn install - yarn bootstrap - yarn build - yarn lint diff --git a/docker-compose.snapshots.update.yml b/docker-compose.snapshots.update.yml index c84bea7d..0ebe1679 100644 --- a/docker-compose.snapshots.update.yml +++ b/docker-compose.snapshots.update.yml @@ -3,7 +3,7 @@ services: e2e: image: cypress/included:8.4.1 container_name: wisemapping-integration-tests - entrypoint: '/bin/sh -c "yarn bootstrap && yarn test:integration"' + entrypoint: '/bin/sh -c "yarn bootstrap && yarn build && yarn test:integration"' working_dir: /e2e environment: - CYPRESS_imageSnaphots=true diff --git a/docker-compose.snapshots.yml b/docker-compose.snapshots.yml index e34927de..2f498c27 100644 --- a/docker-compose.snapshots.yml +++ b/docker-compose.snapshots.yml @@ -3,7 +3,7 @@ services: e2e: image: cypress/included:8.4.1 container_name: wisemapping-integration-tests - entrypoint: '/bin/sh -c "yarn bootstrap && yarn test:integration"' + entrypoint: '/bin/sh -c "yarn bootstrap && yarn build && yarn test:integration"' working_dir: /e2e environment: - CYPRESS_imageSnaphots=true diff --git a/packages/editor/cypress/integration/topicFontChange.test.js b/packages/editor/cypress/integration/topicFontChange.test.js index 813ee842..5ba77776 100644 --- a/packages/editor/cypress/integration/topicFontChange.test.js +++ b/packages/editor/cypress/integration/topicFontChange.test.js @@ -1,4 +1,6 @@ context('Edit Topic', () => { + // TODO: review why click({force: true}) is needed in these tests + // also, why is the element outside the viewport in screenshots? beforeEach(() => { cy.visit('/editor.html'); cy.reload(); @@ -13,40 +15,32 @@ context('Edit Topic', () => { it('Change Font Size', () => { cy.get('#fontSizeTip').click(); - cy.get('#small').click(); + cy.get('.popover #small').click(); cy.get('[test-id=1] > text').invoke('attr', 'font-size').should('eq', '8.0625'); - cy.matchImageSnapshot('changeFontSizeSmall'); cy.get('#fontSizeTip').click(); - // TODO: The parameter {force: true} was placed because it does not detect that the element is visible cy.get('.popover #normal').click({ force: true }); cy.get('[test-id=1] > text').invoke('attr', 'font-size').should('eq', '10.75'); - cy.matchImageSnapshot('changeFontSizeNormal'); cy.get('#fontSizeTip').click(); - // TODO: The parameter {force: true} was placed because it does not detect that the element is visible - cy.get('#large').click({ force: true }); + cy.get('.popover #large').click({ force: true }); cy.get('[test-id=1] > text').invoke('attr', 'font-size').should('eq', '13.4375'); - - cy.matchImageSnapshot('changeFontSizeNormal'); + cy.matchImageSnapshot('changeFontSizeLarge'); cy.get('#fontSizeTip').click(); - // TODO: The parameter {force: true} was placed because it does not detect that the element is visible - cy.get('#huge').click({ force: true }); + cy.get('.popover #huge').click({ force: true }); cy.get('[test-id=1] > text').invoke('attr', 'font-size').should('eq', '20.15625'); - cy.matchImageSnapshot('changeFontSizeHuge'); }); it('Change Font type', () => { cy.get('#fontFamilyTip').click(); - // TODO: The parameter {force: true} was placed because it does not detect that the element is visible cy.get('[model="Times"]').click({ force: true }); cy.get('[test-id=1] > text').invoke('attr', 'font-family').should('eq', 'Times'); @@ -64,7 +58,6 @@ context('Edit Topic', () => { it('Change Font color', () => { cy.get('#fontColorTip').click(); - // TODO: The parameter {force: true} was placed because it does not detect that the element is visible cy.get('[title="RGB (153, 0, 255)"]').click({ force: true }); cy.get('[test-id=1] > text').invoke('attr', 'fill').should('eq', 'rgb(153, 0, 255)'); diff --git a/packages/editor/cypress/integration/topicManager.test.js b/packages/editor/cypress/integration/topicManager.test.js index 266dc03e..d45e974c 100644 --- a/packages/editor/cypress/integration/topicManager.test.js +++ b/packages/editor/cypress/integration/topicManager.test.js @@ -4,8 +4,6 @@ context('Node manager', () => { }); it('shortcut add sibling node', () => { - // TODO: why is the editor appearing twice in the snapshot? - // cy.matchImageSnapshot('editor'); cy.contains('Mind Mapping').click(); cy.get('body').type('{enter}').type('Mind Mapping rocks!!').type('{enter}'); diff --git a/packages/editor/cypress/integration/topicShape.test.js b/packages/editor/cypress/integration/topicShape.test.js index 0406e89c..7247f406 100644 --- a/packages/editor/cypress/integration/topicShape.test.js +++ b/packages/editor/cypress/integration/topicShape.test.js @@ -9,9 +9,7 @@ context('Change Topic shape', () => { cy.get('#topicShapeTip').click(); cy.get('#rectagle').click(); - cy.get('[test-id=11] > rect').each((element, index, $list) => { - cy.get($list[1]).invoke('attr', 'rx').should('eq', '0'); - }); + cy.get('[test-id=11] > rect').eq(1).invoke('attr', 'rx').should('eq', '0'); cy.matchImageSnapshot('changeToSquareShape'); }); @@ -21,9 +19,7 @@ context('Change Topic shape', () => { // TODO: The parameter {force: true} was placed because it does not detect that the element is visible cy.get('#rounded_rectagle').click({ force: true }); - cy.get('[test-id=11] > rect').each((element, index, $list) => { - cy.get($list[1]).invoke('attr', 'rx').should('eq', '4.6499999999999995'); - }); + cy.get('[test-id=11] > rect').eq(1).invoke('attr', 'rx').should('eq', '4.05'); cy.matchImageSnapshot('changeToRoundedRectagle'); }); @@ -41,9 +37,7 @@ context('Change Topic shape', () => { // TODO: The parameter {force: true} was placed because it does not detect that the element is visible cy.get('#elipse').click({ force: true }); - cy.get('[test-id=11] > rect').each((element, index, $list) => { - cy.get($list[1]).invoke('attr', 'rx').should('eq', '13.950000000000001'); - }); + cy.get('[test-id=11] > rect').eq(1).invoke('attr', 'rx').should('eq', '12.15'); cy.matchImageSnapshot('changeToElipseShape'); }); diff --git a/packages/editor/cypress/snapshots/playground.test.js/container.snap.png b/packages/editor/cypress/snapshots/playground.test.js/container.snap.png index ca5ce98e..d46f39c0 100644 Binary files a/packages/editor/cypress/snapshots/playground.test.js/container.snap.png and b/packages/editor/cypress/snapshots/playground.test.js/container.snap.png differ diff --git a/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample2.snap.png b/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample2.snap.png index a9b5c353..d85d9f05 100644 Binary files a/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample2.snap.png and b/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample2.snap.png differ diff --git a/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample5.snap.png b/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample5.snap.png index d018fefd..be4bbf2f 100644 Binary files a/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample5.snap.png and b/packages/editor/cypress/snapshots/playground.test.js/viewmode-sample5.snap.png differ diff --git a/packages/editor/cypress/snapshots/relationship.test.js/changeShapeRealtionship.snap.png b/packages/editor/cypress/snapshots/relationship.test.js/changeShapeRealtionship.snap.png new file mode 100644 index 00000000..25c832bd Binary files /dev/null and b/packages/editor/cypress/snapshots/relationship.test.js/changeShapeRealtionship.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicFontChange.test.js/changeFontColor.snap.png b/packages/editor/cypress/snapshots/topicFontChange.test.js/changeFontColor.snap.png new file mode 100644 index 00000000..90bfbbb0 Binary files /dev/null and b/packages/editor/cypress/snapshots/topicFontChange.test.js/changeFontColor.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicFontChange.test.js/changeFontItalic.snap.png b/packages/editor/cypress/snapshots/topicFontChange.test.js/changeFontItalic.snap.png new file mode 100644 index 00000000..093814fb Binary files /dev/null and b/packages/editor/cypress/snapshots/topicFontChange.test.js/changeFontItalic.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicFontChange.test.js/changeFontSizeHuge.snap.png b/packages/editor/cypress/snapshots/topicFontChange.test.js/changeFontSizeHuge.snap.png new file mode 100644 index 00000000..1c2572e1 Binary files /dev/null and b/packages/editor/cypress/snapshots/topicFontChange.test.js/changeFontSizeHuge.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicFontChange.test.js/changeFontSizeLarge.snap.png b/packages/editor/cypress/snapshots/topicFontChange.test.js/changeFontSizeLarge.snap.png new file mode 100644 index 00000000..aa9da27c Binary files /dev/null and b/packages/editor/cypress/snapshots/topicFontChange.test.js/changeFontSizeLarge.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicFontChange.test.js/changeFontSizeNormal.snap.png b/packages/editor/cypress/snapshots/topicFontChange.test.js/changeFontSizeNormal.snap.png new file mode 100644 index 00000000..87ee4f5f Binary files /dev/null and b/packages/editor/cypress/snapshots/topicFontChange.test.js/changeFontSizeNormal.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicFontChange.test.js/changeFontSizeSmall.snap.png b/packages/editor/cypress/snapshots/topicFontChange.test.js/changeFontSizeSmall.snap.png new file mode 100644 index 00000000..10222b9b Binary files /dev/null and b/packages/editor/cypress/snapshots/topicFontChange.test.js/changeFontSizeSmall.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicFontChange.test.js/changeFontType.snap.png b/packages/editor/cypress/snapshots/topicFontChange.test.js/changeFontType.snap.png new file mode 100644 index 00000000..614c9e50 Binary files /dev/null and b/packages/editor/cypress/snapshots/topicFontChange.test.js/changeFontType.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicFontChange.test.js/changeMainTopicText.snap.png b/packages/editor/cypress/snapshots/topicFontChange.test.js/changeMainTopicText.snap.png new file mode 100644 index 00000000..fa28917d Binary files /dev/null and b/packages/editor/cypress/snapshots/topicFontChange.test.js/changeMainTopicText.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicManager.test.js/addChildNodeSortcut.snap.png b/packages/editor/cypress/snapshots/topicManager.test.js/addChildNodeSortcut.snap.png new file mode 100644 index 00000000..d3c6994d Binary files /dev/null and b/packages/editor/cypress/snapshots/topicManager.test.js/addChildNodeSortcut.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicManager.test.js/deleteTopicShortcut.snap.png b/packages/editor/cypress/snapshots/topicManager.test.js/deleteTopicShortcut.snap.png new file mode 100644 index 00000000..28bd948d Binary files /dev/null and b/packages/editor/cypress/snapshots/topicManager.test.js/deleteTopicShortcut.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicManager.test.js/editor-shortcut-edit.snap.png b/packages/editor/cypress/snapshots/topicManager.test.js/editor-shortcut-edit.snap.png new file mode 100644 index 00000000..696e5816 Binary files /dev/null and b/packages/editor/cypress/snapshots/topicManager.test.js/editor-shortcut-edit.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicManager.test.js/saveChagesShortcut.snap.png b/packages/editor/cypress/snapshots/topicManager.test.js/saveChagesShortcut.snap.png new file mode 100644 index 00000000..6aeaba70 Binary files /dev/null and b/packages/editor/cypress/snapshots/topicManager.test.js/saveChagesShortcut.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicManager.test.js/undoChange.snap.png b/packages/editor/cypress/snapshots/topicManager.test.js/undoChange.snap.png new file mode 100644 index 00000000..44ea8b04 Binary files /dev/null and b/packages/editor/cypress/snapshots/topicManager.test.js/undoChange.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicPosition.test.js/moveDefaultPosition.snap.png b/packages/editor/cypress/snapshots/topicPosition.test.js/moveDefaultPosition.snap.png new file mode 100644 index 00000000..24c9072a Binary files /dev/null and b/packages/editor/cypress/snapshots/topicPosition.test.js/moveDefaultPosition.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicPosition.test.js/movedownNode.snap.png b/packages/editor/cypress/snapshots/topicPosition.test.js/movedownNode.snap.png new file mode 100644 index 00000000..3f7686f2 Binary files /dev/null and b/packages/editor/cypress/snapshots/topicPosition.test.js/movedownNode.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicPosition.test.js/moveleftNode.snap.png b/packages/editor/cypress/snapshots/topicPosition.test.js/moveleftNode.snap.png new file mode 100644 index 00000000..575db5eb Binary files /dev/null and b/packages/editor/cypress/snapshots/topicPosition.test.js/moveleftNode.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicPosition.test.js/moveupNode.snap.png b/packages/editor/cypress/snapshots/topicPosition.test.js/moveupNode.snap.png new file mode 100644 index 00000000..eb86c969 Binary files /dev/null and b/packages/editor/cypress/snapshots/topicPosition.test.js/moveupNode.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicShape.test.js/changeToElipseShape.snap.png b/packages/editor/cypress/snapshots/topicShape.test.js/changeToElipseShape.snap.png new file mode 100644 index 00000000..8680e14c Binary files /dev/null and b/packages/editor/cypress/snapshots/topicShape.test.js/changeToElipseShape.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicShape.test.js/changeToLine.snap.png b/packages/editor/cypress/snapshots/topicShape.test.js/changeToLine.snap.png new file mode 100644 index 00000000..b2d65d21 Binary files /dev/null and b/packages/editor/cypress/snapshots/topicShape.test.js/changeToLine.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicShape.test.js/changeToRoundedRectagle.snap.png b/packages/editor/cypress/snapshots/topicShape.test.js/changeToRoundedRectagle.snap.png new file mode 100644 index 00000000..e3af6a66 Binary files /dev/null and b/packages/editor/cypress/snapshots/topicShape.test.js/changeToRoundedRectagle.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicShape.test.js/changeToSquareShape.snap.png b/packages/editor/cypress/snapshots/topicShape.test.js/changeToSquareShape.snap.png new file mode 100644 index 00000000..c993cc1e Binary files /dev/null and b/packages/editor/cypress/snapshots/topicShape.test.js/changeToSquareShape.snap.png differ diff --git a/packages/editor/package.json b/packages/editor/package.json index 0806b7c8..5d998906 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -1,6 +1,6 @@ { "name": "@wisemapping/editor", - "version": "0.1.0", + "version": "0.4.0", "main": "dist/editor.bundle.js", "scripts": { "build": "webpack --config webpack.prod.js", diff --git a/packages/editor/webpack.playground.js b/packages/editor/webpack.playground.js index 84d74cfc..70830fef 100644 --- a/packages/editor/webpack.playground.js +++ b/packages/editor/webpack.playground.js @@ -8,13 +8,12 @@ const { merge } = require('webpack-merge'); const playgroundConfig = { mode: 'development', entry: { - "editor.bundle": path.join(__dirname, 'src', 'index.tsx'), viewmode: path.resolve(__dirname, './test/playground/map-render/js/viewmode'), embedded: path.resolve(__dirname, './test/playground/map-render/js/embedded'), editor: path.resolve(__dirname, './test/playground/map-render/js/editor'), }, output: { - path: path.resolve(__dirname, 'dist'), + path: path.resolve(__dirname, 'test/playground/dist'), filename: '[name].js', library: { type: 'umd', @@ -24,7 +23,6 @@ const playgroundConfig = { historyApiFallback: true, port: 8081, open: false, - writeToDisk: true, }, module: { rules: [ diff --git a/packages/mindplot/webpack.playground.js b/packages/mindplot/webpack.playground.js index 211410a6..434f0681 100644 --- a/packages/mindplot/webpack.playground.js +++ b/packages/mindplot/webpack.playground.js @@ -8,14 +8,19 @@ const common = require('./webpack.common'); const playgroundConfig = { mode: 'development', entry: { - mindplot: path.resolve(__dirname, './src/index.js'), layout: path.resolve(__dirname, './test/playground/layout/context-loader'), }, + output: { + path: path.resolve(__dirname, 'test/playground/dist'), + filename: '[name].js', + library: { + type: 'umd', + }, + }, devServer: { historyApiFallback: true, port: 8083, open: false, - writeToDisk: true, }, module: { rules: [ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Arrow.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Arrow.snap.png index be29c7f7..a68db1d6 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Arrow.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Arrow.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Curved Line.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Curved Line.snap.png index 544c59a6..6a8b8469 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Curved Line.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Curved Line.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Events.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Events.snap.png index 8e516e2c..33d72583 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Events.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Events.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Font.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Font.snap.png index 01991ef1..c5fe6c76 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Font.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Font.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Group.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Group.snap.png index 809f9c4a..2063694c 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Group.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Group.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Line.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Line.snap.png index d58730c4..b571f4f6 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Line.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Line.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Poly Line.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Poly Line.snap.png index 79d3b438..396b326c 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Poly Line.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Poly Line.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Prototype.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Prototype.snap.png index 998ed81c..258d1316 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Prototype.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Prototype.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Rect.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Rect.snap.png index 4f4141ac..d76d437d 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Rect.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Rect.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Shapes.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Shapes.snap.png index 1737da5d..0852e626 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Shapes.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Shapes.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Text.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Text.snap.png index 9974f930..adab458c 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Text.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Text.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Workspace.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Workspace.snap.png index 784db25e..21987edb 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Workspace.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Workspace.snap.png differ diff --git a/packages/web2d/webpack.playground.js b/packages/web2d/webpack.playground.js index 9852eac7..77e37cb1 100644 --- a/packages/web2d/webpack.playground.js +++ b/packages/web2d/webpack.playground.js @@ -20,7 +20,7 @@ module.exports = { image: './test/playground/image.js', }, output: { - path: path.resolve(__dirname, 'dist', 'tests'), + path: path.resolve(__dirname, 'test/playground/dist'), filename: '[name].js', publicPath: '/', }, diff --git a/packages/webapp/cypress/snapshots/maps.test.ts/maps-create.snap.png b/packages/webapp/cypress/snapshots/maps.test.ts/maps-create.snap.png index fb9d4daf..5f375108 100644 Binary files a/packages/webapp/cypress/snapshots/maps.test.ts/maps-create.snap.png and b/packages/webapp/cypress/snapshots/maps.test.ts/maps-create.snap.png differ diff --git a/packages/webapp/cypress/snapshots/maps.test.ts/maps.snap.png b/packages/webapp/cypress/snapshots/maps.test.ts/maps.snap.png index 9d53dd43..a0b20a37 100644 Binary files a/packages/webapp/cypress/snapshots/maps.test.ts/maps.snap.png and b/packages/webapp/cypress/snapshots/maps.test.ts/maps.snap.png differ