Skip to content

Commit 799f357

Browse files
committed
Test: Update test cases for autosaved comments feature
Signed-off-by: Parth Raiyani <[email protected]> Change-Id: I0ebb1c8805d04e687e16529ba39742f00577dd0c
1 parent 8252ec5 commit 799f357

File tree

6 files changed

+162
-81
lines changed

6 files changed

+162
-81
lines changed

cypress_test/integration_tests/desktop/calc/annotation_spec.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
124124
it('Insert autosave',function() {
125125
desktopHelper.insertComment(undefined, false);
126126
cy.cGet('#map').focus();
127-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
127+
cy.cGet('.annotation-button-autosaved').should('be.visible');
128+
cy.cGet('.annotation-button-delete').should('be.visible');
128129
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
129130

130131
helper.reloadDocument(newFilePath);
@@ -140,15 +141,17 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
140141
it('Insert autosave save',function() {
141142
desktopHelper.insertComment(undefined, false);
142143
cy.cGet('#map').focus();
143-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
144+
cy.cGet('.annotation-button-autosaved').should('be.visible');
145+
cy.cGet('.annotation-button-delete').should('be.visible');
144146
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
145147
cy.cGet('#annotation-save-1').click();
146148
cy.cGet('.cool-annotation').should('exist');
147149
cy.cGet('#comment-container-1').then(function (element) {
148150
element[0].style.visibility = '';
149151
element[0].style.display = '';
150152
});
151-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
153+
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
154+
cy.cGet('.annotation-button-delete').should('be.not.visible');
152155
cy.cGet('#comment-container-1').trigger('mouseover', {force: true});
153156
cy.cGet('#annotation-content-area-1').should('have.text','some text0');
154157

@@ -165,11 +168,13 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
165168
it('Insert autosave cancel',function() {
166169
desktopHelper.insertComment(undefined, false);
167170
cy.cGet('#map').focus();
168-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
171+
cy.cGet('.annotation-button-autosaved').should('be.visible');
172+
cy.cGet('.annotation-button-delete').should('be.visible');
169173
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
170174
cy.cGet('#annotation-cancel-1').click();
171175
cy.cGet('.cool-annotation').should('not.exist');
172-
cy.cGet('.cool-annotation-autosavelabel').should('not.exist');
176+
cy.cGet('.annotation-button-autosaved').should('not.exist');
177+
cy.cGet('.annotation-button-delete').should('not.exist');
173178

174179
helper.reloadDocument(newFilePath);
175180
cy.cGet('.cool-annotation').should('not.exist');
@@ -190,7 +195,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
190195
cy.cGet('body').contains('.context-menu-item','Modify').click();
191196
cy.cGet('#annotation-modify-textarea-1').type(', some other text');
192197
cy.cGet('#map').focus();
193-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
198+
cy.cGet('.annotation-button-autosaved').should('be.visible');
199+
cy.cGet('.annotation-button-delete').should('be.visible');
194200
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
195201

196202
helper.reloadDocument(newFilePath);
@@ -218,7 +224,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
218224
cy.cGet('body').contains('.context-menu-item','Modify').click();
219225
cy.cGet('#annotation-modify-textarea-1').type(', some other text');
220226
cy.cGet('#map').focus();
221-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
227+
cy.cGet('.annotation-button-autosaved').should('be.visible');
228+
cy.cGet('.annotation-button-delete').should('be.visible');
222229
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
223230
cy.cGet('#annotation-save-1').click();
224231
cy.cGet('#comment-container-1').then(function (element) {
@@ -254,7 +261,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
254261
cy.cGet('body').contains('.context-menu-item','Modify').click();
255262
cy.cGet('#annotation-modify-textarea-1').type('some other text, ');
256263
cy.cGet('#map').focus();
257-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
264+
cy.cGet('.annotation-button-autosaved').should('be.visible');
265+
cy.cGet('.annotation-button-delete').should('be.visible');
258266
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
259267
cy.cGet('#annotation-cancel-1').click();
260268
cy.cGet('#comment-container-1').then(function (element) {

cypress_test/integration_tests/desktop/impress/annotation_spec.js

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,13 @@ describe(['tagdesktop'], 'Collapsed Annotation Tests', function() {
149149
cy.cGet('.cool-annotation-info-collapsed').should('have.text','!');
150150
cy.cGet('.cool-annotation-info-collapsed').should('be.visible');
151151
cy.cGet('.cool-annotation-img').click();
152-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
152+
cy.cGet('.annotation-button-autosaved').should('be.visible');
153+
cy.cGet('.annotation-button-delete').should('be.visible');
153154
cy.cGet('[id^=annotation-save-]').click();
154155
cy.cGet('.cool-annotation-img').click();
155156
cy.cGet('[id^=annotation-content-area-]').should('have.text','some text0');
156-
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');
157159
cy.cGet('.cool-annotation-info-collapsed').should('not.have.text','!');
158160
cy.cGet('#map').focus();
159161
cy.cGet('.cool-annotation-info-collapsed').should('be.not.visible');
@@ -238,7 +240,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
238240
it('Insert autosave', function() {
239241
desktopHelper.insertComment(undefined, false);
240242
cy.cGet('#map').focus();
241-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
243+
cy.cGet('.annotation-button-autosaved').should('be.visible');
244+
cy.cGet('.annotation-button-delete').should('be.visible');
242245
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
243246

244247
helper.reloadDocument(newFilePath);
@@ -249,10 +252,12 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
249252
it('Insert autosave save', function() {
250253
desktopHelper.insertComment(undefined, false);
251254
cy.cGet('#map').focus();
252-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
255+
cy.cGet('.annotation-button-autosaved').should('be.visible');
256+
cy.cGet('.annotation-button-delete').should('be.visible');
253257
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
254258
cy.cGet('[id^=annotation-save-]').click();
255-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
259+
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
260+
cy.cGet('.annotation-button-delete').should('be.not.visible');
256261
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.not.visible');
257262
cy.cGet('.annotation-marker').should('be.visible');
258263
cy.cGet('.cool-annotation-content > div').should('have.text','some text0');
@@ -265,10 +270,12 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
265270
it('Insert autosave cancel', function() {
266271
desktopHelper.insertComment(undefined, false);
267272
cy.cGet('#map').focus();
268-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
273+
cy.cGet('.annotation-button-autosaved').should('be.visible');
274+
cy.cGet('.annotation-button-delete').should('be.visible');
269275
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
270276
cy.cGet('.modify-annotation [id^=annotation-cancel-]').click();
271-
cy.cGet('.cool-annotation-autosavelabel').should('not.exist');
277+
cy.cGet('.annotation-button-autosaved').should('not.exist');
278+
cy.cGet('.annotation-button-delete').should('not.exist');
272279
cy.cGet('.cool-annotation-edit.modify-annotation').should('not.exist');
273280
cy.cGet('.annotation-marker').should('not.exist');
274281
cy.cGet('.cool-annotation-content > div').should('not.exist');
@@ -286,7 +293,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
286293
cy.cGet('body').contains('.context-menu-item','Modify').click();
287294
cy.cGet('[id^=annotation-modify-textarea-]').type(', some other text');
288295
cy.cGet('#map').focus();
289-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
296+
cy.cGet('.annotation-button-autosaved').should('be.visible');
297+
cy.cGet('.annotation-button-delete').should('be.visible');
290298
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
291299

292300
helper.reloadDocument(newFilePath);
@@ -302,7 +310,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
302310
cy.cGet('body').contains('.context-menu-item','Modify').click();
303311
cy.cGet('[id^=annotation-modify-textarea-]').type(', some other text');
304312
cy.cGet('#map').focus();
305-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
313+
cy.cGet('.annotation-button-autosaved').should('be.visible');
314+
cy.cGet('.annotation-button-delete').should('be.visible');
306315
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
307316
cy.cGet('[id^=annotation-save-]').click();
308317
cy.cGet('[id^=annotation-content-area-]').should('have.text','some text0, some other text');
@@ -321,7 +330,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
321330
cy.cGet('body').contains('.context-menu-item','Modify').click();
322331
cy.cGet('[id^=annotation-modify-textarea-]').type(', some other text');
323332
cy.cGet('#map').focus();
324-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
333+
cy.cGet('.annotation-button-autosaved').should('be.visible');
334+
cy.cGet('.annotation-button-delete').should('be.visible');
325335
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
326336
cy.cGet('.modify-annotation [id^=annotation-cancel-]').click();
327337
cy.cGet('[id^=annotation-content-area-]').should('have.text','some text0');
@@ -340,7 +350,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
340350
cy.cGet('body').contains('.context-menu-item','Reply').click();
341351
cy.cGet('[id^=annotation-reply-textarea-]').type('some reply text');
342352
cy.cGet('#map').focus();
343-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
353+
cy.cGet('.annotation-button-autosaved').should('be.visible');
354+
cy.cGet('.annotation-button-delete').should('be.visible');
344355
cy.cGet('[id^=annotation-modify-textarea-]').should('be.visible');
345356
cy.cGet('[id^=annotation-modify-textarea-]').should('include.text', 'some text0');
346357
cy.cGet('[id^=annotation-modify-textarea-]').should('include.text', 'some reply text');
@@ -358,12 +369,14 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
358369
cy.cGet('body').contains('.context-menu-item','Reply').click();
359370
cy.cGet('[id^=annotation-reply-textarea-]').type('some reply text');
360371
cy.cGet('#map').focus();
361-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
372+
cy.cGet('.annotation-button-autosaved').should('be.visible');
373+
cy.cGet('.annotation-button-delete').should('be.visible');
362374
cy.cGet('[id^=annotation-modify-textarea-]').should('be.visible');
363375
cy.cGet('[id^=annotation-modify-textarea-]').should('include.text', 'some text0');
364376
cy.cGet('[id^=annotation-modify-textarea-]').should('include.text', 'some reply text');
365377
cy.cGet('[id^=annotation-save-]').click();
366-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
378+
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
379+
cy.cGet('.annotation-button-delete').should('be.not.visible');
367380
cy.cGet('.cool-annotation-edit.reply-annotation').should('be.not.visible');
368381
cy.cGet('.cool-annotation-content > div').should('include.text','some text0');
369382
cy.cGet('.cool-annotation-content > div').should('include.text','some reply text');
@@ -381,12 +394,14 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
381394
cy.cGet('body').contains('.context-menu-item','Reply').click();
382395
cy.cGet('[id^=annotation-reply-textarea-]').type('some reply text');
383396
cy.cGet('#map').focus();
384-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
397+
cy.cGet('.annotation-button-autosaved').should('be.visible');
398+
cy.cGet('.annotation-button-delete').should('be.visible');
385399
cy.cGet('[id^=annotation-modify-textarea-]').should('be.visible');
386400
cy.cGet('[id^=annotation-modify-textarea-]').should('include.text', 'some text0');
387401
cy.cGet('[id^=annotation-modify-textarea-]').should('include.text', 'some reply text');
388402
cy.cGet('.modify-annotation [id^=annotation-cancel-]').click();
389-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
403+
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
404+
cy.cGet('.annotation-button-delete').should('be.not.visible');
390405
cy.cGet('.cool-annotation-edit.reply-annotation').should('be.not.visible');
391406
cy.cGet('.cool-annotation-content > div').should('have.text','some text0');
392407

0 commit comments

Comments
 (0)