Skip to content

Commit

Permalink
Test: Update test cases for autosaved comments feature
Browse files Browse the repository at this point in the history
Signed-off-by: Parth Raiyani <[email protected]>
Change-Id: I0ebb1c8805d04e687e16529ba39742f00577dd0c
  • Loading branch information
rparth07 committed Dec 12, 2024
1 parent 90a356a commit 9e5b8d0
Show file tree
Hide file tree
Showing 6 changed files with 162 additions and 81 deletions.
24 changes: 16 additions & 8 deletions cypress_test/integration_tests/desktop/calc/annotation_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
it('Insert autosave',function() {
desktopHelper.insertComment(undefined, false);
cy.cGet('#map').focus();
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.annotation-button-autosaved').should('be.visible');
cy.cGet('.annotation-button-delete').should('be.visible');
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');

helper.reloadDocument(newFilePath);
Expand All @@ -124,15 +125,17 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
it('Insert autosave save',function() {
desktopHelper.insertComment(undefined, false);
cy.cGet('#map').focus();
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.annotation-button-autosaved').should('be.visible');
cy.cGet('.annotation-button-delete').should('be.visible');
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
cy.cGet('#annotation-save-1').click();
cy.cGet('.cool-annotation').should('exist');
cy.cGet('#comment-container-1').then(function (element) {
element[0].style.visibility = '';
element[0].style.display = '';
});
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
cy.cGet('.annotation-button-delete').should('be.not.visible');
cy.cGet('#comment-container-1').trigger('mouseover');
cy.cGet('#annotation-content-area-1').should('have.text','some text0');

Expand All @@ -149,11 +152,13 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
it('Insert autosave cancel',function() {
desktopHelper.insertComment(undefined, false);
cy.cGet('#map').focus();
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.annotation-button-autosaved').should('be.visible');
cy.cGet('.annotation-button-delete').should('be.visible');
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
cy.cGet('#annotation-cancel-1').click();
cy.cGet('.cool-annotation').should('not.exist');
cy.cGet('.cool-annotation-autosavelabel').should('not.exist');
cy.cGet('.annotation-button-autosaved').should('not.exist');
cy.cGet('.annotation-button-delete').should('not.exist');

helper.reloadDocument(newFilePath);
cy.cGet('.cool-annotation').should('not.exist');
Expand All @@ -174,7 +179,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('body').contains('.context-menu-item','Modify').click();
cy.cGet('#annotation-modify-textarea-1').type('some other text, ');
cy.cGet('#map').focus();
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.annotation-button-autosaved').should('be.visible');
cy.cGet('.annotation-button-delete').should('be.visible');
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');

helper.reloadDocument(newFilePath);
Expand Down Expand Up @@ -202,7 +208,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('body').contains('.context-menu-item','Modify').click();
cy.cGet('#annotation-modify-textarea-1').type('some other text, ');
cy.cGet('#map').focus();
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.annotation-button-autosaved').should('be.visible');
cy.cGet('.annotation-button-delete').should('be.visible');
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
cy.cGet('#annotation-save-1').click();
cy.cGet('#comment-container-1').then(function (element) {
Expand Down Expand Up @@ -238,7 +245,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('body').contains('.context-menu-item','Modify').click();
cy.cGet('#annotation-modify-textarea-1').type('some other text, ');
cy.cGet('#map').focus();
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.annotation-button-autosaved').should('be.visible');
cy.cGet('.annotation-button-delete').should('be.visible');
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
cy.cGet('#annotation-cancel-1').click();
cy.cGet('#comment-container-1').then(function (element) {
Expand Down
45 changes: 30 additions & 15 deletions cypress_test/integration_tests/desktop/impress/annotation_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,13 @@ describe(['tagdesktop'], 'Collapsed Annotation Tests', function() {
cy.cGet('.cool-annotation-info-collapsed').should('have.text','!');
cy.cGet('.cool-annotation-info-collapsed').should('be.visible');
cy.cGet('.cool-annotation-img').click();
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.annotation-button-autosaved').should('be.visible');
cy.cGet('.annotation-button-delete').should('be.visible');
cy.cGet('#annotation-save-1').click();
cy.cGet('.cool-annotation-img').click();
cy.cGet('#annotation-content-area-1').should('have.text','some text0');
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
cy.cGet('.annotation-button-delete').should('be.not.visible');
cy.cGet('.cool-annotation-info-collapsed').should('not.have.text','!');
cy.cGet('#map').focus();
cy.cGet('.cool-annotation-info-collapsed').should('be.not.visible');
Expand Down Expand Up @@ -214,7 +216,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
it('Insert autosave', function() {
desktopHelper.insertComment(undefined, false);
cy.cGet('#map').focus();
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.annotation-button-autosaved').should('be.visible');
cy.cGet('.annotation-button-delete').should('be.visible');
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');

helper.reloadDocument(newFilePath);
Expand All @@ -225,10 +228,12 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
it('Insert autosave save', function() {
desktopHelper.insertComment(undefined, false);
cy.cGet('#map').focus();
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.annotation-button-autosaved').should('be.visible');
cy.cGet('.annotation-button-delete').should('be.visible');
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
cy.cGet('#annotation-save-1').click();
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
cy.cGet('.annotation-button-delete').should('be.not.visible');
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.not.visible');
cy.cGet('.leaflet-marker-icon').should('exist');
cy.cGet('.cool-annotation-content > div').should('have.text','some text0');
Expand All @@ -241,10 +246,12 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
it('Insert autosave cancel', function() {
desktopHelper.insertComment(undefined, false);
cy.cGet('#map').focus();
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.annotation-button-autosaved').should('be.visible');
cy.cGet('.annotation-button-delete').should('be.visible');
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
cy.cGet('#annotation-cancel-1').click();
cy.cGet('.cool-annotation-autosavelabel').should('not.exist');
cy.cGet('.annotation-button-autosaved').should('not.exist');
cy.cGet('.annotation-button-delete').should('not.exist');
cy.cGet('.cool-annotation-edit.modify-annotation').should('not.exist');
cy.cGet('.leaflet-marker-icon').should('not.exist');
cy.cGet('.cool-annotation-content > div').should('not.exist');
Expand All @@ -262,7 +269,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('body').contains('.context-menu-item','Modify').click();
cy.cGet('#annotation-modify-textarea-1').type('some other text, ');
cy.cGet('#map').focus();
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.annotation-button-autosaved').should('be.visible');
cy.cGet('.annotation-button-delete').should('be.visible');
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');

helper.reloadDocument(newFilePath);
Expand All @@ -278,7 +286,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('body').contains('.context-menu-item','Modify').click();
cy.cGet('#annotation-modify-textarea-1').type('some other text, ');
cy.cGet('#map').focus();
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.annotation-button-autosaved').should('be.visible');
cy.cGet('.annotation-button-delete').should('be.visible');
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
cy.cGet('#annotation-save-1').click();
cy.cGet('#annotation-content-area-1').should('have.text','some other text, some text0');
Expand All @@ -297,7 +306,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('body').contains('.context-menu-item','Modify').click();
cy.cGet('#annotation-modify-textarea-1').type('some other text, ');
cy.cGet('#map').focus();
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.annotation-button-autosaved').should('be.visible');
cy.cGet('.annotation-button-delete').should('be.visible');
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
cy.cGet('#annotation-cancel-1').click();
cy.cGet('#annotation-content-area-1').should('have.text','some text0');
Expand All @@ -316,7 +326,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('body').contains('.context-menu-item','Reply').click();
cy.cGet('#annotation-reply-textarea-1').type('some reply text');
cy.cGet('#map').focus();
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.annotation-button-autosaved').should('be.visible');
cy.cGet('.annotation-button-delete').should('be.visible');
cy.cGet('#annotation-modify-textarea-1').should('be.visible');
cy.cGet('#annotation-modify-textarea-1').should('include.text', 'some text0');
cy.cGet('#annotation-modify-textarea-1').should('include.text', 'some reply text');
Expand All @@ -334,12 +345,14 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('body').contains('.context-menu-item','Reply').click();
cy.cGet('#annotation-reply-textarea-1').type('some reply text');
cy.cGet('#map').focus();
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.annotation-button-autosaved').should('be.visible');
cy.cGet('.annotation-button-delete').should('be.visible');
cy.cGet('#annotation-modify-textarea-1').should('be.visible');
cy.cGet('#annotation-modify-textarea-1').should('include.text', 'some text0');
cy.cGet('#annotation-modify-textarea-1').should('include.text', 'some reply text');
cy.cGet('#annotation-save-1').click();
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
cy.cGet('.annotation-button-delete').should('be.not.visible');
cy.cGet('.cool-annotation-edit.reply-annotation').should('be.not.visible');
cy.cGet('.cool-annotation-content > div').should('include.text','some text0');
cy.cGet('.cool-annotation-content > div').should('include.text','some reply text');
Expand All @@ -357,12 +370,14 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('body').contains('.context-menu-item','Reply').click();
cy.cGet('#annotation-reply-textarea-1').type('some reply text');
cy.cGet('#map').focus();
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.annotation-button-autosaved').should('be.visible');
cy.cGet('.annotation-button-delete').should('be.visible');
cy.cGet('#annotation-modify-textarea-1').should('be.visible');
cy.cGet('#annotation-modify-textarea-1').should('include.text', 'some text0');
cy.cGet('#annotation-modify-textarea-1').should('include.text', 'some reply text');
cy.cGet('#annotation-cancel-1').click();
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
cy.cGet('.annotation-button-delete').should('be.not.visible');
cy.cGet('.cool-annotation-edit.reply-annotation').should('be.not.visible');
cy.cGet('.cool-annotation-content > div').should('have.text','some text0');

Expand Down
Loading

0 comments on commit 9e5b8d0

Please sign in to comment.