Skip to content

Commit 33c301f

Browse files
authored
Merge pull request #684 from nextcloud/backport/662/stable20
2 parents 4a61319 + cab31db commit 33c301f

18 files changed

+348
-306
lines changed

cypress/integration/files-shares.spec.js

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -86,42 +86,42 @@ describe('See shared folder with link share', function() {
8686

8787
it('Open the viewer on file click', function() {
8888
cy.openFile('image1.jpg')
89-
cy.get('#viewer-content').should('be.visible')
89+
cy.get('body > .viewer').should('be.visible')
9090
})
9191

9292
it('Does not see a loading animation', function() {
93-
cy.get('#viewer-content', { timeout: 10000 })
93+
cy.get('body > .viewer', { timeout: 10000 })
9494
.should('be.visible')
9595
.and('have.class', 'modal-mask')
9696
.and('not.have.class', 'icon-loading')
9797
})
9898

9999
it('See the menu icon and title on the viewer header', function() {
100-
cy.get('#viewer-content .modal-title').should('contain', 'image1.jpg')
101-
cy.get('#viewer-content .modal-header button.icon-menu-sidebar-white-forced').should('not.be.visible')
102-
cy.get('#viewer-content .modal-header button.icon-close').should('be.visible')
100+
cy.get('body > .viewer .modal-title').should('contain', 'image1.jpg')
101+
cy.get('body > .viewer .modal-header button.icon-menu-sidebar-white-forced').should('not.be.visible')
102+
cy.get('body > .viewer .modal-header button.icon-close').should('be.visible')
103103
})
104104

105105
it('Does see next navigation arrows', function() {
106-
cy.get('#viewer-content .modal-container img').should('have.length', 2)
107-
cy.get('#viewer-content .modal-container img').should('have.attr', 'src')
108-
cy.get('#viewer-content a.next').should('be.visible')
109-
cy.get('#viewer-content a.next').should('be.visible')
106+
cy.get('body > .viewer .modal-container img').should('have.length', 2)
107+
cy.get('body > .viewer .modal-container img').should('have.attr', 'src')
108+
cy.get('body > .viewer a.next').should('be.visible')
109+
cy.get('body > .viewer a.next').should('be.visible')
110110
})
111111

112112
it('Does not have any visual regression 4', function() {
113113
cy.matchImageSnapshot()
114114
})
115115

116116
it('Show image2 on next', function() {
117-
cy.get('#viewer-content a.next').click()
118-
cy.get('#viewer-content .modal-container img').should('have.length', 3)
119-
cy.get('#viewer-content a.prev').should('be.visible')
120-
cy.get('#viewer-content a.next').should('be.visible')
117+
cy.get('body > .viewer a.next').click()
118+
cy.get('body > .viewer .modal-container img').should('have.length', 3)
119+
cy.get('body > .viewer a.prev').should('be.visible')
120+
cy.get('body > .viewer a.next').should('be.visible')
121121
})
122122

123123
it('Does not see a loading animation', function() {
124-
cy.get('#viewer-content', { timeout: 10000 })
124+
cy.get('body > .viewer', { timeout: 10000 })
125125
.should('be.visible')
126126
.and('have.class', 'modal-mask')
127127
.and('not.have.class', 'icon-loading')
@@ -132,14 +132,14 @@ describe('See shared folder with link share', function() {
132132
})
133133

134134
it('Show image3 on next', function() {
135-
cy.get('#viewer-content a.next').click()
136-
cy.get('#viewer-content .modal-container img').should('have.length', 3)
137-
cy.get('#viewer-content a.prev').should('be.visible')
138-
cy.get('#viewer-content a.next').should('be.visible')
135+
cy.get('body > .viewer a.next').click()
136+
cy.get('body > .viewer .modal-container img').should('have.length', 3)
137+
cy.get('body > .viewer a.prev').should('be.visible')
138+
cy.get('body > .viewer a.next').should('be.visible')
139139
})
140140

141141
it('Does not see a loading animation', function() {
142-
cy.get('#viewer-content', { timeout: 10000 })
142+
cy.get('body > .viewer', { timeout: 10000 })
143143
.should('be.visible')
144144
.and('have.class', 'modal-mask')
145145
.and('not.have.class', 'icon-loading')
@@ -150,14 +150,14 @@ describe('See shared folder with link share', function() {
150150
})
151151

152152
it('Show image4 on next', function() {
153-
cy.get('#viewer-content a.next').click()
154-
cy.get('#viewer-content .modal-container img').should('have.length', 2)
155-
cy.get('#viewer-content a.prev').should('be.visible')
156-
cy.get('#viewer-content a.next').should('be.visible')
153+
cy.get('body > .viewer a.next').click()
154+
cy.get('body > .viewer .modal-container img').should('have.length', 2)
155+
cy.get('body > .viewer a.prev').should('be.visible')
156+
cy.get('body > .viewer a.next').should('be.visible')
157157
})
158158

159159
it('Does not see a loading animation', function() {
160-
cy.get('#viewer-content', { timeout: 10000 })
160+
cy.get('body > .viewer', { timeout: 10000 })
161161
.should('be.visible')
162162
.and('have.class', 'modal-mask')
163163
.and('not.have.class', 'icon-loading')
@@ -168,17 +168,17 @@ describe('See shared folder with link share', function() {
168168
})
169169

170170
it('Show video1 on next', function() {
171-
cy.get('#viewer-content a.next').click()
171+
cy.get('body > .viewer a.next').click()
172172
// only 2 because we don't know if we're at the end of the slideshow, current vid and prev img
173-
cy.get('#viewer-content .modal-container img').should('have.length', 1)
174-
cy.get('#viewer-content .modal-container video').should('have.length', 1)
175-
cy.get('#viewer-content a.prev').should('be.visible')
176-
cy.get('#viewer-content a.next').should('be.visible')
177-
cy.get('#viewer-content .modal-title').should('contain', 'video1.mp4')
173+
cy.get('body > .viewer .modal-container img').should('have.length', 1)
174+
cy.get('body > .viewer .modal-container video').should('have.length', 1)
175+
cy.get('body > .viewer a.prev').should('be.visible')
176+
cy.get('body > .viewer a.next').should('be.visible')
177+
cy.get('body > .viewer .modal-title').should('contain', 'video1.mp4')
178178
})
179179

180180
it('Does not see a loading animation', function() {
181-
cy.get('#viewer-content', { timeout: 10000 })
181+
cy.get('body > .viewer', { timeout: 10000 })
182182
.should('be.visible')
183183
.and('have.class', 'modal-mask')
184184
.and('not.have.class', 'icon-loading')
@@ -189,14 +189,14 @@ describe('See shared folder with link share', function() {
189189
})
190190

191191
it('Show image1 again on next', function() {
192-
cy.get('#viewer-content a.next').click()
193-
cy.get('#viewer-content .modal-container img').should('have.length', 2)
194-
cy.get('#viewer-content a.prev').should('be.visible')
195-
cy.get('#viewer-content a.next').should('be.visible')
192+
cy.get('body > .viewer a.next').click()
193+
cy.get('body > .viewer .modal-container img').should('have.length', 2)
194+
cy.get('body > .viewer a.prev').should('be.visible')
195+
cy.get('body > .viewer a.next').should('be.visible')
196196
})
197197

198198
it('Does not see a loading animation', function() {
199-
cy.get('#viewer-content', { timeout: 10000 })
199+
cy.get('body > .viewer', { timeout: 10000 })
200200
.should('be.visible')
201201
.and('have.class', 'modal-mask')
202202
.and('not.have.class', 'icon-loading')

cypress/integration/image-small.png.spec.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,25 @@ describe('Open image-small.png in viewer', function() {
4747

4848
it('Open the viewer on file click', function() {
4949
cy.openFile('image-small.png')
50-
cy.get('#viewer-content').should('be.visible')
50+
cy.get('body > .viewer').should('be.visible')
5151
})
5252

5353
it('Does not see a loading animation', function() {
54-
cy.get('#viewer-content', { timeout: 10000 })
54+
cy.get('body > .viewer', { timeout: 10000 })
5555
.should('be.visible')
5656
.and('have.class', 'modal-mask')
5757
.and('not.have.class', 'icon-loading')
5858
})
5959

6060
it('See the menu icon and title on the viewer header', function() {
61-
cy.get('#viewer-content .modal-title').should('contain', 'image-small.png')
62-
cy.get('#viewer-content .modal-header button.icon-menu-sidebar-white-forced').should('be.visible')
63-
cy.get('#viewer-content .modal-header button.icon-close').should('be.visible')
61+
cy.get('body > .viewer .modal-title').should('contain', 'image-small.png')
62+
cy.get('body > .viewer .modal-header button.icon-menu-sidebar-white-forced').should('be.visible')
63+
cy.get('body > .viewer .modal-header button.icon-close').should('be.visible')
6464
})
6565

6666
it('Does not see navigation arrows', function() {
67-
cy.get('#viewer-content a.prev').should('not.be.visible')
68-
cy.get('#viewer-content a.next').should('not.be.visible')
67+
cy.get('body > .viewer a.prev').should('not.be.visible')
68+
cy.get('body > .viewer a.next').should('not.be.visible')
6969
})
7070

7171
it('Does not have any visual regression', function() {

cypress/integration/image.gif.spec.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,25 @@ describe('Open image.gif in viewer', function() {
4848

4949
it('Open the viewer on file click', function() {
5050
cy.openFile('image.gif')
51-
cy.get('#viewer-content').should('be.visible')
51+
cy.get('body > .viewer').should('be.visible')
5252
})
5353

5454
it('Does not see a loading animation', function() {
55-
cy.get('#viewer-content', { timeout: 10000 })
55+
cy.get('body > .viewer', { timeout: 10000 })
5656
.should('be.visible')
5757
.and('have.class', 'modal-mask')
5858
.and('not.have.class', 'icon-loading')
5959
})
6060

6161
it('See the menu icon and title on the viewer header', function() {
62-
cy.get('#viewer-content .modal-title').should('contain', 'image.gif')
63-
cy.get('#viewer-content .modal-header button.icon-menu-sidebar-white-forced').should('be.visible')
64-
cy.get('#viewer-content .modal-header button.icon-close').should('be.visible')
62+
cy.get('body > .viewer .modal-title').should('contain', 'image.gif')
63+
cy.get('body > .viewer .modal-header button.icon-menu-sidebar-white-forced').should('be.visible')
64+
cy.get('body > .viewer .modal-header button.icon-close').should('be.visible')
6565
})
6666

6767
it('Does not see navigation arrows', function() {
68-
cy.get('#viewer-content a.prev').should('not.be.visible')
69-
cy.get('#viewer-content a.next').should('not.be.visible')
68+
cy.get('body > .viewer a.prev').should('not.be.visible')
69+
cy.get('body > .viewer a.next').should('not.be.visible')
7070
})
7171

7272
it('Take screenshot', function() {

cypress/integration/image.heic.spec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,29 @@ describe('Open image.heic in viewer', function() {
4848

4949
it('Open the viewer on file click', function() {
5050
cy.openFile('image.heic')
51-
cy.get('#viewer-content').should('be.visible')
51+
cy.get('body > .viewer').should('be.visible')
5252
})
5353

5454
it('Does not see a loading animation', function() {
55-
cy.get('#viewer-content', { timeout: 4000 })
55+
cy.get('body > .viewer', { timeout: 4000 })
5656
.should('be.visible')
5757
.and('have.class', 'modal-mask')
5858
.and('not.have.class', 'icon-loading')
5959
})
6060

6161
it('Is not in mobile fullscreen mode', function() {
62-
cy.get('#viewer-content .modal-wrapper').should('not.have.class', 'modal-wrapper--full')
62+
cy.get('body > .viewer .modal-wrapper').should('not.have.class', 'modal-wrapper--full')
6363
})
6464

6565
it('See the menu icon and title on the viewer header', function() {
66-
cy.get('#viewer-content .modal-title').should('contain', 'image.heic')
67-
cy.get('#viewer-content .modal-header button.icon-menu-sidebar-white-forced').should('be.visible')
68-
cy.get('#viewer-content .modal-header button.icon-close').should('be.visible')
66+
cy.get('body > .viewer .modal-title').should('contain', 'image.heic')
67+
cy.get('body > .viewer .modal-header button.icon-menu-sidebar-white-forced').should('be.visible')
68+
cy.get('body > .viewer .modal-header button.icon-close').should('be.visible')
6969
})
7070

7171
it('Does not see navigation arrows', function() {
72-
cy.get('#viewer-content a.prev').should('not.be.visible')
73-
cy.get('#viewer-content a.next').should('not.be.visible')
72+
cy.get('body > .viewer a.prev').should('not.be.visible')
73+
cy.get('body > .viewer a.next').should('not.be.visible')
7474
})
7575

7676
it('Does not have any visual regression', function() {

cypress/integration/image.png.spec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,29 +47,29 @@ describe('Open image.png in viewer', function() {
4747

4848
it('Open the viewer on file click', function() {
4949
cy.openFile('image.png')
50-
cy.get('#viewer-content').should('be.visible')
50+
cy.get('body > .viewer').should('be.visible')
5151
})
5252

5353
it('Does not see a loading animation', function() {
54-
cy.get('#viewer-content', { timeout: 10000 })
54+
cy.get('body > .viewer', { timeout: 10000 })
5555
.should('be.visible')
5656
.and('have.class', 'modal-mask')
5757
.and('not.have.class', 'icon-loading')
5858
})
5959

6060
it('Is not in mobile fullscreen mode', function() {
61-
cy.get('#viewer-content .modal-wrapper').should('not.have.class', 'modal-wrapper--full')
61+
cy.get('body > .viewer .modal-wrapper').should('not.have.class', 'modal-wrapper--full')
6262
})
6363

6464
it('See the menu icon and title on the viewer header', function() {
65-
cy.get('#viewer-content .modal-title').should('contain', 'image.png')
66-
cy.get('#viewer-content .modal-header button.icon-menu-sidebar-white-forced').should('be.visible')
67-
cy.get('#viewer-content .modal-header button.icon-close').should('be.visible')
65+
cy.get('body > .viewer .modal-title').should('contain', 'image.png')
66+
cy.get('body > .viewer .modal-header button.icon-menu-sidebar-white-forced').should('be.visible')
67+
cy.get('body > .viewer .modal-header button.icon-close').should('be.visible')
6868
})
6969

7070
it('Does not see navigation arrows', function() {
71-
cy.get('#viewer-content a.prev').should('not.be.visible')
72-
cy.get('#viewer-content a.next').should('not.be.visible')
71+
cy.get('body > .viewer a.prev').should('not.be.visible')
72+
cy.get('body > .viewer a.next').should('not.be.visible')
7373
})
7474

7575
it('Does not have any visual regression', function() {

cypress/integration/image.svg.spec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,29 @@ describe('Open image.svg in viewer', function() {
4848

4949
it('Open the viewer on file click', function() {
5050
cy.openFile('image.svg')
51-
cy.get('#viewer-content').should('be.visible')
51+
cy.get('body > .viewer').should('be.visible')
5252
})
5353

5454
it('Does not see a loading animation', function() {
55-
cy.get('#viewer-content', { timeout: 10000 })
55+
cy.get('body > .viewer', { timeout: 10000 })
5656
.should('be.visible')
5757
.and('have.class', 'modal-mask')
5858
.and('not.have.class', 'icon-loading')
5959
})
6060

6161
it('See the menu icon and title on the viewer header', function() {
62-
cy.get('#viewer-content .modal-title').should('contain', 'image.svg')
63-
cy.get('#viewer-content .modal-header button.icon-menu-sidebar-white-forced').should('be.visible')
64-
cy.get('#viewer-content .modal-header button.icon-close').should('be.visible')
62+
cy.get('body > .viewer .modal-title').should('contain', 'image.svg')
63+
cy.get('body > .viewer .modal-header button.icon-menu-sidebar-white-forced').should('be.visible')
64+
cy.get('body > .viewer .modal-header button.icon-close').should('be.visible')
6565
})
6666

6767
it('Does not see navigation arrows', function() {
68-
cy.get('#viewer-content a.prev').should('not.be.visible')
69-
cy.get('#viewer-content a.next').should('not.be.visible')
68+
cy.get('body > .viewer a.prev').should('not.be.visible')
69+
cy.get('body > .viewer a.next').should('not.be.visible')
7070
})
7171

7272
it('Have the base64 encoded value of the svg', function() {
73-
cy.get('#viewer-content .modal-container img.active')
73+
cy.get('body > .viewer .modal-container .viewer__file.viewer__file--active')
7474
.should('have.attr', 'src')
7575
.should('contain', 'data:image/svg+xml;base64')
7676
})

0 commit comments

Comments
 (0)