Remove wait and skip of close document for failed tests

The bug referenced has been fixed for a long time
so the workaround is no longer necessary

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Ifac6555c711a0f142dd5d00ba4f4133dd4aece9f
This commit is contained in:
Neil Guertin 2024-04-16 16:45:14 -04:00 committed by Szymon Kłos
parent a25a8e0ee0
commit 4e9bb9eba4
4 changed files with 29 additions and 39 deletions

View file

@ -532,7 +532,7 @@ function reload(fileName, subFolder, noFileCopy, isMultiUser, subsequentLoad, ha
cy.log('Reloading document: ' + subFolder + '/' + fileName); cy.log('Reloading document: ' + subFolder + '/' + fileName);
cy.log('Reloading document - noFileCopy: ' + noFileCopy); cy.log('Reloading document - noFileCopy: ' + noFileCopy);
cy.log('Reloading document - subsequentLoad: ' + subsequentLoad); cy.log('Reloading document - subsequentLoad: ' + subsequentLoad);
closeDocument(fileName, ''); closeDocument(fileName);
var noRename = true; var noRename = true;
return loadTestDoc(fileName, subFolder, noFileCopy, isMultiUser, subsequentLoad, hasInteractionBeforeLoad, noRename); return loadTestDoc(fileName, subFolder, noFileCopy, isMultiUser, subsequentLoad, hasInteractionBeforeLoad, noRename);
} }
@ -545,8 +545,10 @@ function beforeAll(fileName, subFolder, noFileCopy, isMultiUser, subsequentLoad,
return loadTestDoc(fileName, subFolder, noFileCopy, isMultiUser, subsequentLoad, hasInteractionBeforeLoad, noRename); return loadTestDoc(fileName, subFolder, noFileCopy, isMultiUser, subsequentLoad, hasInteractionBeforeLoad, noRename);
} }
// testState no longer used, but not removed from all calls to afterAll yet
// eslint-disable-next-line no-unused-vars
function afterAll(fileName, testState) { function afterAll(fileName, testState) {
closeDocument(fileName, testState); closeDocument(fileName);
} }
// This method is intended to call after each test case. // This method is intended to call after each test case.
@ -555,15 +557,10 @@ function afterAll(fileName, testState) {
// Parameters: // Parameters:
// fileName - test document name (we can check it on the admin console). // fileName - test document name (we can check it on the admin console).
// testState - whether the test passed or failed before this method was called. // testState - whether the test passed or failed before this method was called.
function closeDocument(fileName, testState) { function closeDocument(fileName) {
cy.log('>> closeDocument - start'); cy.log('>> closeDocument - start');
if (Cypress.env('INTEGRATION') === 'nextcloud') { if (Cypress.env('INTEGRATION') === 'nextcloud') {
if (testState === 'failed') {
Cypress.env('IFRAME_LEVEL', '');
return;
}
if (Cypress.env('IFRAME_LEVEL') === '2') { if (Cypress.env('IFRAME_LEVEL') === '2') {
// Close the document, with the close button. // Close the document, with the close button.
doIfOnMobile(function() { doIfOnMobile(function() {
@ -610,13 +607,6 @@ function closeDocument(fileName, testState) {
Cypress.env('SERVER_PORT') + Cypress.env('SERVER_PORT') +
'/browser/dist/admin/admin.html'); '/browser/dist/admin/admin.html');
// https://github.com/cypress-io/cypress/issues/9207
// TODO reproduce or remove
if (testState === 'failed') {
cy.wait(5000);
return;
}
cy.get('#uptime').its('text').should('not.eq', '0'); cy.get('#uptime').its('text').should('not.eq', '0');
// We have all lines of document infos as one long string. // We have all lines of document infos as one long string.

View file

@ -103,7 +103,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('.cool-annotation-autosavelabel').should('be.visible'); cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible'); cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'calc', true, false, false, true); helper.beforeAll(testFileName, 'calc', true, false, false, true);
cy.cGet('.cool-annotation').should('exist'); cy.cGet('.cool-annotation').should('exist');
cy.cGet('#comment-container-1').then(function (element) { cy.cGet('#comment-container-1').then(function (element) {
@ -129,7 +129,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('#comment-container-1').trigger('mouseover'); cy.cGet('#comment-container-1').trigger('mouseover');
cy.cGet('#annotation-content-area-1').should('have.text','some text0'); cy.cGet('#annotation-content-area-1').should('have.text','some text0');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'calc', true, false, false, true); helper.beforeAll(testFileName, 'calc', true, false, false, true);
cy.cGet('.cool-annotation').should('exist'); cy.cGet('.cool-annotation').should('exist');
cy.cGet('#comment-container-1').then(function (element) { cy.cGet('#comment-container-1').then(function (element) {
@ -149,7 +149,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('.cool-annotation').should('not.exist'); cy.cGet('.cool-annotation').should('not.exist');
cy.cGet('.cool-annotation-autosavelabel').should('not.exist'); cy.cGet('.cool-annotation-autosavelabel').should('not.exist');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'calc', true, false, false, true); helper.beforeAll(testFileName, 'calc', true, false, false, true);
cy.cGet('.cool-annotation').should('not.exist'); cy.cGet('.cool-annotation').should('not.exist');
}); });
@ -172,7 +172,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('.cool-annotation-autosavelabel').should('be.visible'); cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible'); cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'calc', true, false, false, true); helper.beforeAll(testFileName, 'calc', true, false, false, true);
cy.cGet('.cool-annotation').should('exist'); cy.cGet('.cool-annotation').should('exist');
cy.cGet('#comment-container-1').then(function (element) { cy.cGet('#comment-container-1').then(function (element) {
@ -209,7 +209,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('#annotation-content-area-1').should('have.text','some other text, some text0'); cy.cGet('#annotation-content-area-1').should('have.text','some other text, some text0');
cy.cGet('#comment-container-1').should('exist'); cy.cGet('#comment-container-1').should('exist');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'calc', true, false, false, true); helper.beforeAll(testFileName, 'calc', true, false, false, true);
cy.cGet('.cool-annotation').should('exist'); cy.cGet('.cool-annotation').should('exist');
cy.cGet('#comment-container-1').then(function (element) { cy.cGet('#comment-container-1').then(function (element) {
@ -246,7 +246,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('#annotation-content-area-1').should('have.text','some text0'); cy.cGet('#annotation-content-area-1').should('have.text','some text0');
cy.cGet('#comment-container-1').should('exist'); cy.cGet('#comment-container-1').should('exist');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'calc', true, false, false, true); helper.beforeAll(testFileName, 'calc', true, false, false, true);
cy.cGet('.cool-annotation').should('exist'); cy.cGet('.cool-annotation').should('exist');
cy.cGet('#comment-container-1').then(function (element) { cy.cGet('#comment-container-1').then(function (element) {

View file

@ -213,7 +213,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('.cool-annotation-autosavelabel').should('be.visible'); cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible'); cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'impress', true, false, false, true); helper.beforeAll(testFileName, 'impress', true, false, false, true);
cy.cGet('.leaflet-marker-icon').should('exist'); cy.cGet('.leaflet-marker-icon').should('exist');
cy.cGet('.cool-annotation-content > div').should('have.text','some text0'); cy.cGet('.cool-annotation-content > div').should('have.text','some text0');
@ -230,7 +230,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('.leaflet-marker-icon').should('exist'); cy.cGet('.leaflet-marker-icon').should('exist');
cy.cGet('.cool-annotation-content > div').should('have.text','some text0'); cy.cGet('.cool-annotation-content > div').should('have.text','some text0');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'impress', true, false, false, true); helper.beforeAll(testFileName, 'impress', true, false, false, true);
cy.cGet('.leaflet-marker-icon').should('exist'); cy.cGet('.leaflet-marker-icon').should('exist');
cy.cGet('.cool-annotation-content > div').should('have.text','some text0'); cy.cGet('.cool-annotation-content > div').should('have.text','some text0');
@ -247,7 +247,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('.leaflet-marker-icon').should('not.exist'); cy.cGet('.leaflet-marker-icon').should('not.exist');
cy.cGet('.cool-annotation-content > div').should('not.exist'); cy.cGet('.cool-annotation-content > div').should('not.exist');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'impress', true, false, false, true); helper.beforeAll(testFileName, 'impress', true, false, false, true);
cy.cGet('.leaflet-marker-icon').should('not.exist'); cy.cGet('.leaflet-marker-icon').should('not.exist');
cy.cGet('.cool-annotation-content > div').should('not.exist'); cy.cGet('.cool-annotation-content > div').should('not.exist');
@ -264,7 +264,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('.cool-annotation-autosavelabel').should('be.visible'); cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible'); cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'impress', true, false, false, true); helper.beforeAll(testFileName, 'impress', true, false, false, true);
cy.cGet('.leaflet-marker-icon').should('exist'); cy.cGet('.leaflet-marker-icon').should('exist');
cy.cGet('.cool-annotation-content > div').should('have.text','some other text, some text0'); cy.cGet('.cool-annotation-content > div').should('have.text','some other text, some text0');
@ -284,7 +284,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('#annotation-content-area-1').should('have.text','some other text, some text0'); cy.cGet('#annotation-content-area-1').should('have.text','some other text, some text0');
cy.cGet('.leaflet-marker-icon').should('exist'); cy.cGet('.leaflet-marker-icon').should('exist');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'impress', true, false, false, true); helper.beforeAll(testFileName, 'impress', true, false, false, true);
cy.cGet('.leaflet-marker-icon').should('exist'); cy.cGet('.leaflet-marker-icon').should('exist');
cy.cGet('.cool-annotation-content > div').should('have.text','some other text, some text0'); cy.cGet('.cool-annotation-content > div').should('have.text','some other text, some text0');
@ -304,7 +304,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('#annotation-content-area-1').should('have.text','some text0'); cy.cGet('#annotation-content-area-1').should('have.text','some text0');
cy.cGet('.leaflet-marker-icon').should('exist'); cy.cGet('.leaflet-marker-icon').should('exist');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'impress', true, false, false, true); helper.beforeAll(testFileName, 'impress', true, false, false, true);
cy.cGet('.leaflet-marker-icon').should('exist'); cy.cGet('.leaflet-marker-icon').should('exist');
cy.cGet('.cool-annotation-content > div').should('have.text','some text0'); cy.cGet('.cool-annotation-content > div').should('have.text','some text0');
@ -323,7 +323,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('#annotation-modify-textarea-1').should('include.text', 'some text0'); cy.cGet('#annotation-modify-textarea-1').should('include.text', 'some text0');
cy.cGet('#annotation-modify-textarea-1').should('include.text', 'some reply text'); cy.cGet('#annotation-modify-textarea-1').should('include.text', 'some reply text');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'impress', true, false, false, true); helper.beforeAll(testFileName, 'impress', true, false, false, true);
cy.cGet('.cool-annotation-edit.reply-annotation').should('be.not.visible'); cy.cGet('.cool-annotation-edit.reply-annotation').should('be.not.visible');
cy.cGet('.cool-annotation-content > div').should('include.text','some reply text'); cy.cGet('.cool-annotation-content > div').should('include.text','some reply text');
@ -347,7 +347,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('.cool-annotation-content > div').should('include.text','some text0'); cy.cGet('.cool-annotation-content > div').should('include.text','some text0');
cy.cGet('.cool-annotation-content > div').should('include.text','some reply text'); cy.cGet('.cool-annotation-content > div').should('include.text','some reply text');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'impress', true, false, false, true); helper.beforeAll(testFileName, 'impress', true, false, false, true);
cy.cGet('.cool-annotation-edit.reply-annotation').should('be.not.visible'); cy.cGet('.cool-annotation-edit.reply-annotation').should('be.not.visible');
cy.cGet('.cool-annotation-content > div').should('include.text','some reply text'); cy.cGet('.cool-annotation-content > div').should('include.text','some reply text');
@ -370,7 +370,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('.cool-annotation-edit.reply-annotation').should('be.not.visible'); cy.cGet('.cool-annotation-edit.reply-annotation').should('be.not.visible');
cy.cGet('.cool-annotation-content > div').should('have.text','some text0'); cy.cGet('.cool-annotation-content > div').should('have.text','some text0');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'impress', true, false, false, true); helper.beforeAll(testFileName, 'impress', true, false, false, true);
cy.cGet('.cool-annotation-edit.reply-annotation').should('be.not.visible'); cy.cGet('.cool-annotation-edit.reply-annotation').should('be.not.visible');
cy.cGet('.cool-annotation-content > div').should('have.text','some text0'); cy.cGet('.cool-annotation-content > div').should('have.text','some text0');

View file

@ -147,7 +147,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('.cool-annotation-autosavelabel').should('be.visible'); cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible'); cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'writer', true, false, false, true); helper.beforeAll(testFileName, 'writer', true, false, false, true);
cy.cGet('.cool-annotation-content-wrapper').should('exist'); cy.cGet('.cool-annotation-content-wrapper').should('exist');
cy.cGet('#annotation-content-area-1').should('have.text','some text0'); cy.cGet('#annotation-content-area-1').should('have.text','some text0');
@ -162,7 +162,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('#annotation-content-area-1').should('have.text','some text0'); cy.cGet('#annotation-content-area-1').should('have.text','some text0');
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible'); cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'writer', true, false, false, true); helper.beforeAll(testFileName, 'writer', true, false, false, true);
cy.cGet('.cool-annotation-content-wrapper').should('exist'); cy.cGet('.cool-annotation-content-wrapper').should('exist');
cy.cGet('#annotation-content-area-1').should('have.text','some text0'); cy.cGet('#annotation-content-area-1').should('have.text','some text0');
@ -177,7 +177,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('#comment-container-1').should('not.exist'); cy.cGet('#comment-container-1').should('not.exist');
cy.cGet('.cool-annotation-autosavelabel').should('not.exist'); cy.cGet('.cool-annotation-autosavelabel').should('not.exist');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'writer', true, false, false, true); helper.beforeAll(testFileName, 'writer', true, false, false, true);
cy.cGet('.cool-annotation-content-wrapper').should('not.exist'); cy.cGet('.cool-annotation-content-wrapper').should('not.exist');
cy.cGet('#comment-container-1').should('not.exist'); cy.cGet('#comment-container-1').should('not.exist');
@ -195,7 +195,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('.cool-annotation-autosavelabel').should('be.visible'); cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible'); cy.cGet('.cool-annotation-edit.modify-annotation').should('be.visible');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'writer', true, false, false, true); helper.beforeAll(testFileName, 'writer', true, false, false, true);
cy.cGet('.cool-annotation-content-wrapper').should('exist'); cy.cGet('.cool-annotation-content-wrapper').should('exist');
cy.cGet('#annotation-content-area-1').should('have.text','some other text, some text0'); cy.cGet('#annotation-content-area-1').should('have.text','some other text, some text0');
@ -216,7 +216,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('#annotation-content-area-1').should('have.text','some other text, some text0'); cy.cGet('#annotation-content-area-1').should('have.text','some other text, some text0');
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible'); cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'writer', true, false, false, true); helper.beforeAll(testFileName, 'writer', true, false, false, true);
cy.cGet('.cool-annotation-content-wrapper').should('exist'); cy.cGet('.cool-annotation-content-wrapper').should('exist');
cy.cGet('#annotation-content-area-1').should('have.text','some other text, some text0'); cy.cGet('#annotation-content-area-1').should('have.text','some other text, some text0');
@ -238,7 +238,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible'); cy.cGet('.cool-annotation-autosavelabel').should('be.not.visible');
cy.cGet('#annotation-content-area-1').should('have.text','some text0'); cy.cGet('#annotation-content-area-1').should('have.text','some text0');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'writer', true, false, false, true); helper.beforeAll(testFileName, 'writer', true, false, false, true);
cy.cGet('.cool-annotation-content-wrapper').should('exist'); cy.cGet('.cool-annotation-content-wrapper').should('exist');
cy.cGet('#annotation-content-area-1').should('have.text','some text0'); cy.cGet('#annotation-content-area-1').should('have.text','some text0');
@ -256,7 +256,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('.cool-annotation-autosavelabel').should('be.visible'); cy.cGet('.cool-annotation-autosavelabel').should('be.visible');
cy.cGet('#annotation-modify-textarea-2').should('be.visible'); cy.cGet('#annotation-modify-textarea-2').should('be.visible');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'writer', true, false, false, true); helper.beforeAll(testFileName, 'writer', true, false, false, true);
cy.cGet('.cool-annotation-content-wrapper').should('exist'); cy.cGet('.cool-annotation-content-wrapper').should('exist');
cy.cGet('#annotation-content-area-2').should('have.text','some reply text'); cy.cGet('#annotation-content-area-2').should('have.text','some reply text');
@ -280,7 +280,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('#annotation-content-area-1').should('have.text','some text0'); cy.cGet('#annotation-content-area-1').should('have.text','some text0');
cy.cGet('#annotation-content-area-2').should('have.text','some reply text'); cy.cGet('#annotation-content-area-2').should('have.text','some reply text');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'writer', true, false, false, true); helper.beforeAll(testFileName, 'writer', true, false, false, true);
cy.cGet('.cool-annotation-content-wrapper').should('exist'); cy.cGet('.cool-annotation-content-wrapper').should('exist');
cy.cGet('#annotation-content-area-2').should('have.text','some reply text'); cy.cGet('#annotation-content-area-2').should('have.text','some reply text');
@ -306,7 +306,7 @@ describe(['tagdesktop'], 'Annotation Autosave Tests', function() {
cy.cGet('#comment-container-1 .cool-annotation-autosavelabel').should('be.not.visible'); cy.cGet('#comment-container-1 .cool-annotation-autosavelabel').should('be.not.visible');
cy.cGet('#comment-container-2 .cool-annotation-autosavelabel').should('not.exist'); cy.cGet('#comment-container-2 .cool-annotation-autosavelabel').should('not.exist');
helper.closeDocument(testFileName, ''); helper.closeDocument(testFileName);
helper.beforeAll(testFileName, 'writer', true, false, false, true); helper.beforeAll(testFileName, 'writer', true, false, false, true);
cy.cGet('.cool-annotation-content-wrapper').should('exist'); cy.cGet('.cool-annotation-content-wrapper').should('exist');
cy.cGet('#annotation-content-area-1').should('have.text','some text0'); cy.cGet('#annotation-content-area-1').should('have.text','some text0');