Skip to content

Commit fe6c9be

Browse files
committed
Test: Update test cases for autosaved comment feature
Signed-off-by: Parth Raiyani <[email protected]> Change-Id: I961abaff25c9062b99d27d50b66e0967da7f4168
1 parent 59447db commit fe6c9be

File tree

6 files changed

+188
-95
lines changed

6 files changed

+188
-95
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) {

cypress_test/integration_tests/desktop/impress/annotation_spec.js

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,21 @@ describe(['tagdesktop'], 'Annotation Tests', function() {
7070
it('Tab Navigation', function() {
7171
desktopHelper.insertComment(undefined, false);
7272

73-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
73+
cy.cGet('.annotation-button-autosaved').should('not.exist');
74+
cy.cGet('.annotation-button-delete').should('not.exist');
7475
cy.realPress('Tab');
75-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
76+
cy.cGet('.annotation-button-autosaved').should('not.exist');
77+
cy.cGet('.annotation-button-delete').should('not.exist');
7678
cy.cGet('#annotation-cancel-new:focus-visible');
7779

7880
cy.realPress('Tab');
7981
cy.cGet('#annotation-save-new:focus-visible');
80-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
82+
cy.cGet('.annotation-button-autosaved').should('not.exist');
83+
cy.cGet('.annotation-button-delete').should('not.exist');
8184

8285
cy.realPress('Tab');
83-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
86+
cy.cGet('.annotation-button-autosaved').should('be.visible');
87+
cy.cGet('.annotation-button-delete').should('be.visible');
8488
});
8589
});
8690

@@ -147,11 +151,13 @@ describe(['tagdesktop'], 'Collapsed Annotation Tests', function() {
147151
cy.cGet('.cool-annotation-info-collapsed').should('have.text','!');
148152
cy.cGet('.cool-annotation-info-collapsed').should('be.visible');
149153
cy.cGet('.cool-annotation-img').click();
150-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
154+
cy.cGet('.annotation-button-autosaved').should('be.visible');
155+
cy.cGet('.annotation-button-delete').should('be.visible');
151156
cy.cGet('[id^=annotation-save-]').click();
152157
cy.cGet('.cool-annotation-img').click();
153158
cy.cGet('[id^=annotation-content-area-]').should('have.text','some text0');
154-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
159+
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
160+
cy.cGet('.annotation-button-delete').should('be.not.visible');
155161
cy.cGet('.cool-annotation-info-collapsed').should('not.have.text','!');
156162
cy.cGet('#map').focus();
157163
cy.cGet('.cool-annotation-info-collapsed').should('be.not.visible');
@@ -237,7 +243,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
237243
it('Insert autosave', function() {
238244
desktopHelper.insertComment(undefined, false);
239245
cy.cGet('#map').focus();
240-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
246+
cy.cGet('.annotation-button-autosaved').should('be.visible');
247+
cy.cGet('.annotation-button-delete').should('be.visible');
241248
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
242249

243250
helper.reloadDocument(newFilePath);
@@ -248,10 +255,12 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
248255
it('Insert autosave save', function() {
249256
desktopHelper.insertComment(undefined, false);
250257
cy.cGet('#map').focus();
251-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
258+
cy.cGet('.annotation-button-autosaved').should('be.visible');
259+
cy.cGet('.annotation-button-delete').should('be.visible');
252260
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
253261
cy.cGet('[id^=annotation-save-]').click();
254-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
262+
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
263+
cy.cGet('.annotation-button-delete').should('be.not.visible');
255264
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.not.visible');
256265
cy.cGet('.annotation-marker').should('be.visible');
257266
cy.cGet('.cool-annotation-content > div').should('have.text','some text0');
@@ -264,10 +273,12 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
264273
it('Insert autosave cancel', function() {
265274
desktopHelper.insertComment(undefined, false);
266275
cy.cGet('#map').focus();
267-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
276+
cy.cGet('.annotation-button-autosaved').should('be.visible');
277+
cy.cGet('.annotation-button-delete').should('be.visible');
268278
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
269279
cy.cGet('.modify-annotation [id^=annotation-cancel-]').click();
270-
cy.cGet('.cool-annotation-autosavelabel').should('not.exist');
280+
cy.cGet('.annotation-button-autosaved').should('not.exist');
281+
cy.cGet('.annotation-button-delete').should('not.exist');
271282
cy.cGet('.cool-annotation-edit.modify-annotation').should('not.exist');
272283
cy.cGet('.annotation-marker').should('not.exist');
273284
cy.cGet('.cool-annotation-content > div').should('not.exist');
@@ -285,7 +296,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
285296
cy.cGet('body').contains('.context-menu-item','Modify').click();
286297
cy.cGet('[id^=annotation-modify-textarea-]').type(', some other text');
287298
cy.cGet('#map').focus();
288-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
299+
cy.cGet('.annotation-button-autosaved').should('be.visible');
300+
cy.cGet('.annotation-button-delete').should('be.visible');
289301
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
290302

291303
helper.reloadDocument(newFilePath);
@@ -301,7 +313,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
301313
cy.cGet('body').contains('.context-menu-item','Modify').click();
302314
cy.cGet('[id^=annotation-modify-textarea-]').type(', some other text');
303315
cy.cGet('#map').focus();
304-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
316+
cy.cGet('.annotation-button-autosaved').should('be.visible');
317+
cy.cGet('.annotation-button-delete').should('be.visible');
305318
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
306319
cy.cGet('[id^=annotation-save-]').click();
307320
cy.cGet('[id^=annotation-content-area-]').should('have.text','some text0, some other text');
@@ -320,7 +333,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
320333
cy.cGet('body').contains('.context-menu-item','Modify').click();
321334
cy.cGet('[id^=annotation-modify-textarea-]').type(', some other text');
322335
cy.cGet('#map').focus();
323-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
336+
cy.cGet('.annotation-button-autosaved').should('be.visible');
337+
cy.cGet('.annotation-button-delete').should('be.visible');
324338
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
325339
cy.cGet('.modify-annotation [id^=annotation-cancel-]').click();
326340
cy.cGet('[id^=annotation-content-area-]').should('have.text','some text0');
@@ -339,7 +353,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
339353
cy.cGet('body').contains('.context-menu-item','Reply').click();
340354
cy.cGet('[id^=annotation-reply-textarea-]').type('some reply text');
341355
cy.cGet('#map').focus();
342-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
356+
cy.cGet('.annotation-button-autosaved').should('be.visible');
357+
cy.cGet('.annotation-button-delete').should('be.visible');
343358
cy.cGet('[id^=annotation-modify-textarea-]').should('be.visible');
344359
cy.cGet('[id^=annotation-modify-textarea-]').should('include.text', 'some text0');
345360
cy.cGet('[id^=annotation-modify-textarea-]').should('include.text', 'some reply text');
@@ -357,12 +372,14 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
357372
cy.cGet('body').contains('.context-menu-item','Reply').click();
358373
cy.cGet('[id^=annotation-reply-textarea-]').type('some reply text');
359374
cy.cGet('#map').focus();
360-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
375+
cy.cGet('.annotation-button-autosaved').should('be.visible');
376+
cy.cGet('.annotation-button-delete').should('be.visible');
361377
cy.cGet('[id^=annotation-modify-textarea-]').should('be.visible');
362378
cy.cGet('[id^=annotation-modify-textarea-]').should('include.text', 'some text0');
363379
cy.cGet('[id^=annotation-modify-textarea-]').should('include.text', 'some reply text');
364380
cy.cGet('[id^=annotation-save-]').click();
365-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
381+
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
382+
cy.cGet('.annotation-button-delete').should('be.not.visible');
366383
cy.cGet('.cool-annotation-edit.reply-annotation').should('be.not.visible');
367384
cy.cGet('.cool-annotation-content > div').should('include.text','some text0');
368385
cy.cGet('.cool-annotation-content > div').should('include.text','some reply text');
@@ -380,12 +397,14 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
380397
cy.cGet('body').contains('.context-menu-item','Reply').click();
381398
cy.cGet('[id^=annotation-reply-textarea-]').type('some reply text');
382399
cy.cGet('#map').focus();
383-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
400+
cy.cGet('.annotation-button-autosaved').should('be.visible');
401+
cy.cGet('.annotation-button-delete').should('be.visible');
384402
cy.cGet('[id^=annotation-modify-textarea-]').should('be.visible');
385403
cy.cGet('[id^=annotation-modify-textarea-]').should('include.text', 'some text0');
386404
cy.cGet('[id^=annotation-modify-textarea-]').should('include.text', 'some reply text');
387405
cy.cGet('.modify-annotation [id^=annotation-cancel-]').click();
388-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
406+
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
407+
cy.cGet('.annotation-button-delete').should('be.not.visible');
389408
cy.cGet('.cool-annotation-edit.reply-annotation').should('be.not.visible');
390409
cy.cGet('.cool-annotation-content > div').should('have.text','some text0');
391410

0 commit comments

Comments
 (0)