summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2020-01-25 20:39:52 +0100
committerTamás Zolnai <tamas.zolnai@collabora.com>2020-01-26 06:42:38 +0100
commit517ebe5f2faebc4c6a7c22994b61bc7b899b89aa (patch)
tree035526725d59892bad56dd5ac9dfc3b319644be0
parentcypress: Add an example for copy-ing. (diff)
downloadonline-517ebe5f2faebc4c6a7c22994b61bc7b899b89aa.tar.gz
online-517ebe5f2faebc4c6a7c22994b61bc7b899b89aa.zip
cypress: Add a test case of shape insertion.
Change-Id: Ic76be157b6fb61c1fbc098ab4d2e627f9b25664e
-rw-r--r--cypress_test/data/desktop/empty.odtbin0 -> 8337 bytes
-rw-r--r--cypress_test/integration_tests/desktop/example_desktop_test_spec2.js29
-rw-r--r--cypress_test/integration_tests/desktop/shape_operations_spec.js30
3 files changed, 30 insertions, 29 deletions
diff --git a/cypress_test/data/desktop/empty.odt b/cypress_test/data/desktop/empty.odt
new file mode 100644
index 0000000000..b8fe3d9dca
--- /dev/null
+++ b/cypress_test/data/desktop/empty.odt
Binary files differ
diff --git a/cypress_test/integration_tests/desktop/example_desktop_test_spec2.js b/cypress_test/integration_tests/desktop/example_desktop_test_spec2.js
deleted file mode 100644
index 7425d48711..0000000000
--- a/cypress_test/integration_tests/desktop/example_desktop_test_spec2.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/* global describe it cy require*/
-
-var helper = require('../common/helper');
-
-describe('Example test suit 2', function() {
- it('Example test case 1', function() {
- helper.loadTestDoc('simple.odt');
-
- // Select a text
- cy.get('#document-container').dblclick();
- cy.get('.leaflet-marker-icon');
-
- // Click on bold toolbar button
- cy.get('#tb_editbar_item_italic').click();
-
- // Remove selection and do a reselection
- cy.get('#document-container').click();
- cy.get('.leaflet-marker-icon').should('not.be.visible');
-
- cy.get('#document-container').dblclick();
- cy.get('.leaflet-marker-icon');
-
- // Bold toolbar button is checked
- cy.get('#tb_editbar_item_italic table.w2ui-button.checked');
-
- // Click on bold toolbar button
- cy.get('#tb_editbar_item_italic').click();
- });
-});
diff --git a/cypress_test/integration_tests/desktop/shape_operations_spec.js b/cypress_test/integration_tests/desktop/shape_operations_spec.js
new file mode 100644
index 0000000000..afeaf79b3d
--- /dev/null
+++ b/cypress_test/integration_tests/desktop/shape_operations_spec.js
@@ -0,0 +1,30 @@
+/* global describe it cy require expect*/
+
+var helper = require('../common/helper');
+
+describe('Shape operations', function() {
+ it('Insert a simple shape.', function() {
+ helper.loadTestDoc('empty.odt');
+
+ // Scroll on the up toolbar
+ cy.get('#toolbar-up .w2ui-scroll-right').click();
+ cy.get('.w2ui-tb-image.w2ui-icon.basicshapes_ellipse')
+ .should('be.visible')
+ .click();
+
+ // Insert a rectangle
+ cy.get('.col.w2ui-icon.basicshapes_rectangle')
+ .click({force : true});
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane svg g')
+ .should('exist');
+
+ // Check whether the rectangle was inserted as an SVG
+ cy.get('.leaflet-pane.leaflet-overlay-pane svg')
+ .then(function(svg) {
+ expect(svg).to.have.lengthOf(1);
+ expect(svg[0].getBBox().width).to.be.greaterThan(0);
+ expect(svg[0].getBBox().height).to.be.greaterThan(0);
+ });
+ });
+});