Skip to content

Commit a49a70a

Browse files
authored
Merge pull request #4520 from nextcloud/fix/notebookbar-selector
fix(test): fix verify document open in notebookbar
2 parents 8b826c6 + d13e5f2 commit a49a70a

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

cypress/e2e/open.spec.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,8 @@ describe('Open existing office files', function() {
4141
// Share action
4242
cy.wait(2000)
4343
cy.get('@loleafletframe').within(() => {
44-
cy.get('#main-menu #menu-file > a').click()
45-
cy.get('#main-menu #menu-shareas > a').should('be.visible').click()
44+
cy.verifyOpen(filename)
4645
})
47-
cy.verifyOpen(filename)
4846

4947
// FIXME: wait for sidebar tab content
5048
// FIXME: validate sharing tab
@@ -69,9 +67,8 @@ describe('Open existing office files', function() {
6967

7068
cy.screenshot('open-file_' + filename)
7169
cy.get('@loleafletframe').within(() => {
72-
cy.get('button.icon-nextcloud-sidebar').click()
70+
cy.verifyOpen(filename)
7371
})
74-
cy.verifyOpen(filename)
7572
// FIXME: wait for sidebar tab content
7673
// FIXME: validate sharing tab
7774
cy.screenshot('share-sidebar_' + filename)
@@ -133,9 +130,8 @@ describe('Open PDF with richdocuments', () => {
133130

134131
// Verify that the correct file is open
135132
cy.get('@loleafletframe').within(() => {
136-
cy.get('button.icon-nextcloud-sidebar').click()
133+
cy.verifyOpen('document.pdf')
137134
})
138-
cy.verifyOpen('document.pdf')
139135

140136
// Make sure we can close the document
141137
cy.closeDocument()

cypress/support/commands.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,9 @@ Cypress.Commands.add('closeDocument', () => {
292292
})
293293

294294
Cypress.Commands.add('verifyOpen', (filename) => {
295-
cy.get('#app-sidebar-vue')
296-
.should('be.visible')
297-
cy.get('.app-sidebar-header__mainname')
298-
.should('be.visible')
299-
.should('contain.text', filename)
295+
cy.get('input#document-name-input').should(($docName) => {
296+
expect($docName.val()).to.equal(filename)
297+
})
300298
})
301299

302300
Cypress.Commands.add('uploadSystemTemplate', () => {

0 commit comments

Comments
 (0)