From ff6eac08ba05ca6d9241edc17fb4864d6ccad105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 29 Apr 2024 14:31:32 +0200 Subject: [PATCH 1/5] test(cypress): Adapt selectors to Collabora 24.04 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- cypress/e2e/integration.spec.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/integration.spec.js b/cypress/e2e/integration.spec.js index 7401c94e26..276ee1b74e 100644 --- a/cypress/e2e/integration.spec.js +++ b/cypress/e2e/integration.spec.js @@ -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') @@ -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') @@ -76,11 +76,12 @@ describe('Nextcloud integration', function() { cy.get('#tab-version_vue .version__info__label').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('.saveas-dialog').should('be.visible') @@ -128,8 +129,8 @@ 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') }) @@ -137,7 +138,7 @@ describe('Nextcloud integration', function() { 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') }) From 38639f1c8e26c621bee74f02bf710ce34bdc1b04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 29 Apr 2024 16:57:57 +0200 Subject: [PATCH 2/5] fix: Temporary fix for wrong post message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/view/Office.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/view/Office.vue b/src/view/Office.vue index 7d9676be87..386e5d3e34 100644 --- a/src/view/Office.vue +++ b/src/view/Office.vue @@ -452,6 +452,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 From 065b675ea4b76951a2d68c3d8b5e723dce455a9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 29 Apr 2024 16:59:01 +0200 Subject: [PATCH 3/5] test(cypress): Wait for menu to be visible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl test(cypress): Wait for menu to be visible (try) Signed-off-by: Julius Härtl --- cypress/e2e/open.spec.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/open.spec.js b/cypress/e2e/open.spec.js index 8c27845451..b7886f35ad 100644 --- a/cypress/e2e/open.spec.js +++ b/cypress/e2e/open.spec.js @@ -56,7 +56,8 @@ describe('Open existing office files', function() { // Share action cy.get('@loleafletframe').within(() => { cy.get('#main-menu #menu-file > a').click() - cy.get('#main-menu #menu-shareas > a').click() + cy.wait(1000) + cy.get('#main-menu #menu-shareas > a').should('be.visible').click() }) cy.get('#app-sidebar-vue') From 724c7147a8283035489dfd917ee0e88786e0cb74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 30 Apr 2024 08:12:00 +0200 Subject: [PATCH 4/5] test(cypress): Wait for App_LoadingStatus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- cypress/e2e/open.spec.js | 3 +-- cypress/e2e/share-link.js | 10 +--------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/cypress/e2e/open.spec.js b/cypress/e2e/open.spec.js index b7886f35ad..5324f2f26f 100644 --- a/cypress/e2e/open.spec.js +++ b/cypress/e2e/open.spec.js @@ -51,12 +51,11 @@ 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.get('@loleafletframe').within(() => { cy.get('#main-menu #menu-file > a').click() - cy.wait(1000) cy.get('#main-menu #menu-shareas > a').should('be.visible').click() }) diff --git a/cypress/e2e/share-link.js b/cypress/e2e/share-link.js index 84f49a03f8..3b9e61f20a 100644 --- a/cypress/e2e/share-link.js +++ b/cypress/e2e/share-link.js @@ -52,15 +52,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() From 654cd50a86d398f193a6dfc8d94152316a444e95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 30 Apr 2024 08:26:14 +0200 Subject: [PATCH 5/5] test(cypress): Temporarily wait until we figure out why the menu disappears if loading is not fully ready MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- cypress/e2e/open.spec.js | 1 + 1 file changed, 1 insertion(+) diff --git a/cypress/e2e/open.spec.js b/cypress/e2e/open.spec.js index 5324f2f26f..3f1727a9d5 100644 --- a/cypress/e2e/open.spec.js +++ b/cypress/e2e/open.spec.js @@ -54,6 +54,7 @@ describe('Open existing office files', function() { 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').should('be.visible').click()