Skip to content

Commit 359c42f

Browse files
committed
Test: Update test cases for autosaved comments feature
Signed-off-by: Parth Raiyani <[email protected]> Change-Id: I4646f04c9d6da69b69a69a9cba3a336ff047ab5b
1 parent c1664ae commit 359c42f

File tree

6 files changed

+395
-302
lines changed

6 files changed

+395
-302
lines changed

cypress_test/integration_tests/desktop/calc/annotation_spec.js

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,24 @@ describe(['tagdesktop'], 'Annotation Tests', function() {
9696
cy.cGet('#comment-container-1').should('not.exist');
9797
});
9898

99-
it('Tab Nevigation', function() {
99+
it('Tab Navigation', function() {
100100
desktopHelper.insertComment(undefined, false);
101101

102-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
102+
cy.cGet('.annotation-button-autosaved').should('not.exist');
103+
cy.cGet('.annotation-button-delete').should('not.exist');
103104
cy.realPress('Tab');
104-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
105+
cy.cGet('.annotation-button-autosaved').should('not.exist');
106+
cy.cGet('.annotation-button-delete').should('not.exist');
105107
cy.cGet('#annotation-cancel-new:focus-visible');
106108

107109
cy.realPress('Tab');
108110
cy.cGet('#annotation-save-new:focus-visible');
109-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
111+
cy.cGet('.annotation-button-autosaved').should('not.exist');
112+
cy.cGet('.annotation-button-delete').should('not.exist');
110113

111114
cy.realPress('Tab');
112-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
115+
cy.cGet('.annotation-button-autosaved').should('be.visible');
116+
cy.cGet('.annotation-button-delete').should('be.visible');
113117
});
114118
});
115119

@@ -124,7 +128,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
124128
it('Insert autosave',function() {
125129
desktopHelper.insertComment(undefined, false);
126130
cy.cGet('#map').focus();
127-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
131+
cy.cGet('.annotation-button-autosaved').should('be.visible');
132+
cy.cGet('.annotation-button-delete').should('be.visible');
128133
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
129134

130135
helper.reloadDocument(newFilePath);
@@ -140,15 +145,17 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
140145
it('Insert autosave save',function() {
141146
desktopHelper.insertComment(undefined, false);
142147
cy.cGet('#map').focus();
143-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
148+
cy.cGet('.annotation-button-autosaved').should('be.visible');
149+
cy.cGet('.annotation-button-delete').should('be.visible');
144150
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
145151
cy.cGet('#annotation-save-1').click();
146152
cy.cGet('.cool-annotation').should('exist');
147153
cy.cGet('#comment-container-1').then(function (element) {
148154
element[0].style.visibility = '';
149155
element[0].style.display = '';
150156
});
151-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
157+
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
158+
cy.cGet('.annotation-button-delete').should('be.not.visible');
152159
cy.cGet('#comment-container-1').trigger('mouseover', {force: true});
153160
cy.cGet('#annotation-content-area-1').should('have.text','some text0');
154161

@@ -165,11 +172,13 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
165172
it('Insert autosave cancel',function() {
166173
desktopHelper.insertComment(undefined, false);
167174
cy.cGet('#map').focus();
168-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
175+
cy.cGet('.annotation-button-autosaved').should('be.visible');
176+
cy.cGet('.annotation-button-delete').should('be.visible');
169177
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
170178
cy.cGet('#annotation-cancel-1').click();
171179
cy.cGet('.cool-annotation').should('not.exist');
172-
cy.cGet('.cool-annotation-autosavelabel').should('not.exist');
180+
cy.cGet('.annotation-button-autosaved').should('not.exist');
181+
cy.cGet('.annotation-button-delete').should('not.exist');
173182

174183
helper.reloadDocument(newFilePath);
175184
cy.cGet('.cool-annotation').should('not.exist');
@@ -190,7 +199,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
190199
cy.cGet('body').contains('.context-menu-item','Modify').click();
191200
cy.cGet('#annotation-modify-textarea-1').type(', some other text');
192201
cy.cGet('#map').focus();
193-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
202+
cy.cGet('.annotation-button-autosaved').should('be.visible');
203+
cy.cGet('.annotation-button-delete').should('be.visible');
194204
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
195205

196206
helper.reloadDocument(newFilePath);
@@ -218,7 +228,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
218228
cy.cGet('body').contains('.context-menu-item','Modify').click();
219229
cy.cGet('#annotation-modify-textarea-1').type(', some other text');
220230
cy.cGet('#map').focus();
221-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
231+
cy.cGet('.annotation-button-autosaved').should('be.visible');
232+
cy.cGet('.annotation-button-delete').should('be.visible');
222233
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
223234
cy.cGet('#annotation-save-1').click();
224235
cy.cGet('#comment-container-1').then(function (element) {
@@ -254,7 +265,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
254265
cy.cGet('body').contains('.context-menu-item','Modify').click();
255266
cy.cGet('#annotation-modify-textarea-1').type('some other text, ');
256267
cy.cGet('#map').focus();
257-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
268+
cy.cGet('.annotation-button-autosaved').should('be.visible');
269+
cy.cGet('.annotation-button-delete').should('be.visible');
258270
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
259271
cy.cGet('#annotation-cancel-1').click();
260272
cy.cGet('#comment-container-1').then(function (element) {

0 commit comments

Comments
 (0)