mirror of
https://github.com/nextcloud/richdocuments.git
synced 2025-12-18 05:20:43 +01:00
test(cypress): Wait for App_LoadingStatus
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
e6b62d8fbc
commit
6db0245011
3 changed files with 17 additions and 12 deletions
|
|
@ -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()
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue