Skip to content

Commit

Permalink
Merge pull request #3638 from nextcloud/backport/3634/stable28
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr authored Apr 30, 2024
2 parents 635ec78 + ec1537f commit dad8bd5
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 18 deletions.
13 changes: 7 additions & 6 deletions cypress/e2e/integration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('Nextcloud integration', function() {
it('Sharing sidebar', function() {
cy.get('@loleafletframe').within(() => {
cy.get('#File-tab-label').click()
cy.get('#ShareAs').click()
cy.get('#ShareAs-button').click()
})

cy.get('#app-sidebar-vue')
Expand All @@ -62,7 +62,7 @@ describe('Nextcloud integration', function() {
it('Versions sidebar', function() {
cy.get('@loleafletframe').within(() => {
cy.get('#File-tab-label').click()
cy.get('#Rev-History').click()
cy.get('#Rev-History-button').click()
})

cy.get('#app-sidebar-vue')
Expand All @@ -76,11 +76,12 @@ describe('Nextcloud integration', function() {
cy.get('#tab-version_vue .list-item-content__name').contains('Current version')
})

// Currently it seems that Collabora is missing the save as button
it('Save as', function() {
cy.get('@loleafletframe').within(() => {
cy.get('#File-tab-label').click()
cy.get('#saveas').click()
cy.get('#w2ui-overlay-download-as-menu .menu-text').eq(1).click()
cy.get('#saveas-entries #saveas-entry-1').click()
})

cy.get('.oc-dialog').should('be.visible')
Expand Down Expand Up @@ -128,16 +129,16 @@ describe('Nextcloud integration', function() {
it('Insert image', function() {
cy.get('@loleafletframe').within(() => {
cy.get('#Insert-tab-label').click()
cy.get('#insert-insert-graphic').click()
cy.get('#w2ui-overlay-insert-graphic-menu .menu-text').eq(1).click()
cy.get('#insert-insert-graphic-button').click()
cy.get('#insert-insert-graphic-entries #insert-insert-graphic-entry-1').click()
})
cy.get('.modal-container__content').should('be.visible')
})

it('Smart picker', function() {
cy.get('@loleafletframe').within(() => {
cy.get('#Insert-tab-label').click()
cy.get('#insert-insert-remote-link').click()
cy.get('#insert-insert-remote-link-button').click()
})
cy.get('.reference-picker-modal--content').should('be.visible')
})
Expand Down
5 changes: 3 additions & 2 deletions cypress/e2e/open.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@ describe('Open existing office files', function() {
cy.waitForViewer()
cy.waitForCollabora()

cy.screenshot('open-file_' + filename)
cy.waitForPostMessage('App_LoadingStatus', { Status: 'Document_Loaded' })

// Share action
cy.wait(2000)
cy.get('@loleafletframe').within(() => {
cy.get('#main-menu #menu-file > a').click()
cy.get('#main-menu #menu-shareas > a').click()
cy.get('#main-menu #menu-shareas > a').should('be.visible').click()
})

cy.get('#app-sidebar-vue')
Expand Down
10 changes: 1 addition & 9 deletions cypress/e2e/share-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,7 @@ describe('Public sharing of office documents', function() {
})

cy.waitForCollabora()
cy.get('@postMessage', { timeout: 20000 }).should(spy => {
const calls = spy.getCalls()
const findMatchingCall = calls.find(call => call.args[0].indexOf('"MessageId":"App_LoadingStatus"') !== -1)
if (!findMatchingCall) {
return expect(findMatchingCall).to.not.be.undefined
}
const object = JSON.parse(findMatchingCall.args[0])
expect(object.Values).to.have.property('Status', 'Initialized')
})
cy.waitForPostMessage('App_LoadingStatus', { Status: 'Document_Loaded' })

cy.get('@loleafletframe').within(() => {
cy.get('#closebutton').click()
Expand Down
16 changes: 15 additions & 1 deletion cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,21 @@ Cypress.Commands.add('waitForCollabora', (wrapped = false) => {
.as('loleafletframe')
cy.get('@loleafletframe').find('#main-document-content').should('be.visible')
})

Cypress.Commands.add('waitForPostMessage', (messageId, values = undefined) => {
cy.get('@postMessage', { timeout: 20000 }).should(spy => {
const calls = spy.getCalls()
const findMatchingCall = calls.find(call => call.args[0].indexOf('"MessageId":"' + messageId + '"') !== -1)
if (!findMatchingCall) {
return expect(findMatchingCall).to.not.be.undefined
}
if (!values) {
const object = JSON.parse(findMatchingCall.args[0])
values.forEach(value => {
expect(object.Values).to.have.property(value, values[value])
})
}
})
})
Cypress.Commands.add('uploadSystemTemplate', () => {
cy.login(new User('admin', 'admin'))
cy.visit('/settings/admin/richdocuments')
Expand Down
2 changes: 2 additions & 0 deletions src/view/Office.vue
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ export default {
case 'UI_ZoteroKeyMissing':
this.showZotero = true
break
// FIXME: Remove once https://github.com/CollaboraOnline/online/pull/8926 is released
case 'UI UI_PickLink':
case 'UI_PickLink':
this.pickLink()
break
Expand Down

0 comments on commit dad8bd5

Please sign in to comment.