Skip to content

Commit cf59091

Browse files
gokaysatireszkadev
authored andcommitted
Add a test for accidental page deletion.
Signed-off-by: Gökay Şatır <[email protected]> Change-Id: I3524206ade02a69295214e4f18cb399b0d9d86f4
1 parent 74b93d3 commit cf59091

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

cypress_test/integration_tests/desktop/impress/delete_objects_spec.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,34 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Delete Objects', function(
2424
helper.textSelectionShouldNotExist();
2525
});
2626

27+
it('Delete Text From Second Page', function() {
28+
// Insert second page.
29+
cy.cGet('#insertpage-button').click();
30+
31+
// Check / wait for the inserted page.
32+
cy.cGet('#preview-img-part-1').should('exist');
33+
34+
// Activate the inserted page.
35+
cy.cGet('#preview-img-part-1').click();
36+
37+
// Click on canvas to activate the document.
38+
cy.cGet('#document-canvas').click(100, 100);
39+
40+
// Press delete button. If the document is correctly activated, the second page shouldn't be deleted.
41+
helper.typeIntoDocument('{del}');
42+
43+
/*
44+
Manually tested the failing case.
45+
This wait is a little long but it takes more than 3 seconds to remove the preview while testing.
46+
We are testing if we accidentaly delete the slide or not. To be sure we didn't delete it, we need to wait.
47+
Or below condition will succeed first, then the page will be deleted = false positive.
48+
*/
49+
cy.wait(5000);
50+
51+
// Check if the second page still exists.
52+
cy.cGet('#preview-img-part-1').should('exist');
53+
});
54+
2755
it('Delete Shapes', function() {
2856
//insert
2957
cy.cGet('#toolbar-up #overflow-button-other-toptoolbar .arrowbackground').click();

0 commit comments

Comments
 (0)