Skip to content

Commit d7be124

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

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

@@ -149,11 +153,13 @@ describe(['tagdesktop'], 'Collapsed Annotation Tests', function() {
149153
cy.cGet('.cool-annotation-info-collapsed').should('have.text','!');
150154
cy.cGet('.cool-annotation-info-collapsed').should('be.visible');
151155
cy.cGet('.cool-annotation-img').click();
152-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
156+
cy.cGet('.annotation-button-autosaved').should('be.visible');
157+
cy.cGet('.annotation-button-delete').should('be.visible');
153158
cy.cGet('[id^=annotation-save-]').click();
154159
cy.cGet('.cool-annotation-img').click();
155160
cy.cGet('[id^=annotation-content-area-]').should('have.text','some text0');
156-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
161+
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
162+
cy.cGet('.annotation-button-delete').should('be.not.visible');
157163
cy.cGet('.cool-annotation-info-collapsed').should('not.have.text','!');
158164
cy.cGet('#map').focus();
159165
cy.cGet('.cool-annotation-info-collapsed').should('be.not.visible');
@@ -238,7 +244,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
238244
it('Insert autosave', function() {
239245
desktopHelper.insertComment(undefined, false);
240246
cy.cGet('#map').focus();
241-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
247+
cy.cGet('.annotation-button-autosaved').should('be.visible');
248+
cy.cGet('.annotation-button-delete').should('be.visible');
242249
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
243250

244251
helper.reloadDocument(newFilePath);
@@ -249,10 +256,12 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
249256
it('Insert autosave save', function() {
250257
desktopHelper.insertComment(undefined, false);
251258
cy.cGet('#map').focus();
252-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
259+
cy.cGet('.annotation-button-autosaved').should('be.visible');
260+
cy.cGet('.annotation-button-delete').should('be.visible');
253261
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
254262
cy.cGet('[id^=annotation-save-]').click();
255-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
263+
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
264+
cy.cGet('.annotation-button-delete').should('be.not.visible');
256265
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.not.visible');
257266
cy.cGet('.annotation-marker').should('be.visible');
258267
cy.cGet('.cool-annotation-content > div').should('have.text','some text0');
@@ -265,10 +274,12 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
265274
it('Insert autosave cancel', function() {
266275
desktopHelper.insertComment(undefined, false);
267276
cy.cGet('#map').focus();
268-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
277+
cy.cGet('.annotation-button-autosaved').should('be.visible');
278+
cy.cGet('.annotation-button-delete').should('be.visible');
269279
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
270280
cy.cGet('.modify-annotation [id^=annotation-cancel-]').click();
271-
cy.cGet('.cool-annotation-autosavelabel').should('not.exist');
281+
cy.cGet('.annotation-button-autosaved').should('not.exist');
282+
cy.cGet('.annotation-button-delete').should('not.exist');
272283
cy.cGet('.cool-annotation-edit.modify-annotation').should('not.exist');
273284
cy.cGet('.annotation-marker').should('not.exist');
274285
cy.cGet('.cool-annotation-content > div').should('not.exist');
@@ -286,7 +297,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
286297
cy.cGet('body').contains('.context-menu-item','Modify').click();
287298
cy.cGet('[id^=annotation-modify-textarea-]').type(', some other text');
288299
cy.cGet('#map').focus();
289-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
300+
cy.cGet('.annotation-button-autosaved').should('be.visible');
301+
cy.cGet('.annotation-button-delete').should('be.visible');
290302
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
291303

292304
helper.reloadDocument(newFilePath);
@@ -302,7 +314,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
302314
cy.cGet('body').contains('.context-menu-item','Modify').click();
303315
cy.cGet('[id^=annotation-modify-textarea-]').type(', some other text');
304316
cy.cGet('#map').focus();
305-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
317+
cy.cGet('.annotation-button-autosaved').should('be.visible');
318+
cy.cGet('.annotation-button-delete').should('be.visible');
306319
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
307320
cy.cGet('[id^=annotation-save-]').click();
308321
cy.cGet('[id^=annotation-content-area-]').should('have.text','some text0, some other text');
@@ -321,7 +334,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
321334
cy.cGet('body').contains('.context-menu-item','Modify').click();
322335
cy.cGet('[id^=annotation-modify-textarea-]').type(', some other text');
323336
cy.cGet('#map').focus();
324-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
337+
cy.cGet('.annotation-button-autosaved').should('be.visible');
338+
cy.cGet('.annotation-button-delete').should('be.visible');
325339
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
326340
cy.cGet('.modify-annotation [id^=annotation-cancel-]').click();
327341
cy.cGet('[id^=annotation-content-area-]').should('have.text','some text0');
@@ -340,7 +354,8 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
340354
cy.cGet('body').contains('.context-menu-item','Reply').click();
341355
cy.cGet('[id^=annotation-reply-textarea-]').type('some reply text');
342356
cy.cGet('#map').focus();
343-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
357+
cy.cGet('.annotation-button-autosaved').should('be.visible');
358+
cy.cGet('.annotation-button-delete').should('be.visible');
344359
cy.cGet('[id^=annotation-modify-textarea-]').should('be.visible');
345360
cy.cGet('[id^=annotation-modify-textarea-]').should('include.text', 'some text0');
346361
cy.cGet('[id^=annotation-modify-textarea-]').should('include.text', 'some reply text');
@@ -358,12 +373,14 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
358373
cy.cGet('body').contains('.context-menu-item','Reply').click();
359374
cy.cGet('[id^=annotation-reply-textarea-]').type('some reply text');
360375
cy.cGet('#map').focus();
361-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
376+
cy.cGet('.annotation-button-autosaved').should('be.visible');
377+
cy.cGet('.annotation-button-delete').should('be.visible');
362378
cy.cGet('[id^=annotation-modify-textarea-]').should('be.visible');
363379
cy.cGet('[id^=annotation-modify-textarea-]').should('include.text', 'some text0');
364380
cy.cGet('[id^=annotation-modify-textarea-]').should('include.text', 'some reply text');
365381
cy.cGet('[id^=annotation-save-]').click();
366-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
382+
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
383+
cy.cGet('.annotation-button-delete').should('be.not.visible');
367384
cy.cGet('.cool-annotation-edit.reply-annotation').should('be.not.visible');
368385
cy.cGet('.cool-annotation-content > div').should('include.text','some text0');
369386
cy.cGet('.cool-annotation-content > div').should('include.text','some reply text');
@@ -381,12 +398,14 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
381398
cy.cGet('body').contains('.context-menu-item','Reply').click();
382399
cy.cGet('[id^=annotation-reply-textarea-]').type('some reply text');
383400
cy.cGet('#map').focus();
384-
cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
401+
cy.cGet('.annotation-button-autosaved').should('be.visible');
402+
cy.cGet('.annotation-button-delete').should('be.visible');
385403
cy.cGet('[id^=annotation-modify-textarea-]').should('be.visible');
386404
cy.cGet('[id^=annotation-modify-textarea-]').should('include.text', 'some text0');
387405
cy.cGet('[id^=annotation-modify-textarea-]').should('include.text', 'some reply text');
388406
cy.cGet('.modify-annotation [id^=annotation-cancel-]').click();
389-
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
407+
cy.cGet('.annotation-button-autosaved').should('be.not.visible');
408+
cy.cGet('.annotation-button-delete').should('be.not.visible');
390409
cy.cGet('.cool-annotation-edit.reply-annotation').should('be.not.visible');
391410
cy.cGet('.cool-annotation-content > div').should('have.text','some text0');
392411

0 commit comments

Comments
 (0)