mirror of
https://github.com/LibreOffice/online.git
synced 2025-07-23 00:48:13 +00:00
cypress: NC: test restoring a document's previous version.
Change-Id: I7cabd7138dbabe870382603b5ad9d5415c9db21c Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103412 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
This commit is contained in:
Binary file not shown.
@ -2,7 +2,7 @@
|
||||
|
||||
var mobileHelper = require('./mobile_helper');
|
||||
|
||||
function checkAndCloseRevisionHistory() {
|
||||
function openRevisionHistory() {
|
||||
mobileHelper.openHamburgerMenu();
|
||||
|
||||
cy.contains('.menu-entry-with-icon', 'File')
|
||||
@ -14,12 +14,18 @@ function checkAndCloseRevisionHistory() {
|
||||
cy.wrap(item)
|
||||
.click();
|
||||
});
|
||||
|
||||
cy.get('#app-sidebar')
|
||||
.should('be.visible');
|
||||
|
||||
cy.get('section#tab-versionsTabView')
|
||||
.should('be.visible');
|
||||
|
||||
}
|
||||
|
||||
function checkAndCloseRevisionHistory() {
|
||||
openRevisionHistory();
|
||||
|
||||
cy.get('.app-sidebar__close.icon-close')
|
||||
.then(function(item) {
|
||||
Cypress.env('IFRAME_LEVEL', '1');
|
||||
@ -35,6 +41,22 @@ function checkAndCloseRevisionHistory() {
|
||||
});
|
||||
}
|
||||
|
||||
function restorePreviousVersion() {
|
||||
openRevisionHistory();
|
||||
|
||||
cy.get('#versionsTabView .versions li:nth-of-type(1) .revertVersion')
|
||||
.click();
|
||||
|
||||
cy.get('.app-sidebar__close.icon-close')
|
||||
.then(function(item) {
|
||||
Cypress.env('IFRAME_LEVEL', '2');
|
||||
cy.wrap(item)
|
||||
.click();
|
||||
});
|
||||
|
||||
cy.wait(10000);
|
||||
}
|
||||
|
||||
function checkAndCloseSharing() {
|
||||
mobileHelper.openHamburgerMenu();
|
||||
|
||||
@ -121,3 +143,4 @@ module.exports.checkAndCloseRevisionHistory = checkAndCloseRevisionHistory;
|
||||
module.exports.checkAndCloseSharing = checkAndCloseSharing;
|
||||
module.exports.insertImageFromStorage = insertImageFromStorage;
|
||||
module.exports.saveFileAs = saveFileAs;
|
||||
module.exports.restorePreviousVersion = restorePreviousVersion;
|
||||
|
@ -2,7 +2,9 @@
|
||||
|
||||
var helper = require('../../common/helper');
|
||||
var mobileHelper = require('../../common/mobile_helper');
|
||||
var calcHelper = require('../../common/calc_helper');
|
||||
var nextcloudHelper = require('../../common/nextcloud_helper');
|
||||
var calcMobileHelper = require('./calc_mobile_helper');
|
||||
|
||||
describe('Nextcloud specific tests.', function() {
|
||||
var testFileName = 'nextcloud.ods';
|
||||
@ -66,5 +68,46 @@ describe('Nextcloud specific tests.', function() {
|
||||
|
||||
nextcloudHelper.checkAndCloseRevisionHistory();
|
||||
});
|
||||
|
||||
it('Restore previous revision.', function() {
|
||||
helper.beforeAll(testFileName, 'calc');
|
||||
|
||||
mobileHelper.enableEditingMobile();
|
||||
|
||||
// Initially we have "text" text in the document
|
||||
calcMobileHelper.selectAllMobile();
|
||||
|
||||
cy.get('#copy-paste-container table td')
|
||||
.should('have.text', 'Text');
|
||||
|
||||
// Change the document content and save it
|
||||
calcHelper.clickOnFirstCell(false, true);
|
||||
|
||||
helper.selectAllText();
|
||||
|
||||
helper.typeIntoDocument('new');
|
||||
|
||||
calcMobileHelper.selectAllMobile();
|
||||
|
||||
cy.get('#copy-paste-container table td')
|
||||
.should('have.text', 'new');
|
||||
|
||||
mobileHelper.openHamburgerMenu();
|
||||
|
||||
cy.contains('.menu-entry-with-icon', 'File')
|
||||
.click();
|
||||
|
||||
cy.contains('.menu-entry-with-icon', 'Save')
|
||||
.click();
|
||||
|
||||
nextcloudHelper.restorePreviousVersion();
|
||||
|
||||
mobileHelper.enableEditingMobile();
|
||||
|
||||
calcMobileHelper.selectAllMobile();
|
||||
|
||||
cy.get('#copy-paste-container table td')
|
||||
.should('have.text', 'Text');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
var helper = require('../../common/helper');
|
||||
var mobileHelper = require('../../common/mobile_helper');
|
||||
var nextcloudHelper = require('../../common/nextcloud_helper');
|
||||
var impressMobileHelper = require('./impress_mobile_helper');
|
||||
|
||||
describe('Nextcloud specific tests.', function() {
|
||||
var testFileName = 'nextcloud.odp';
|
||||
@ -65,5 +66,42 @@ describe('Nextcloud specific tests.', function() {
|
||||
|
||||
nextcloudHelper.checkAndCloseRevisionHistory();
|
||||
});
|
||||
|
||||
it('Restore previous revision.', function() {
|
||||
helper.beforeAll(testFileName, 'impress');
|
||||
|
||||
mobileHelper.enableEditingMobile();
|
||||
|
||||
// Initially we have "text" text in the document
|
||||
impressMobileHelper.selectTextShapeInTheCenter();
|
||||
|
||||
impressMobileHelper.selectTextOfShape();
|
||||
|
||||
helper.expectTextForClipboard('text');
|
||||
|
||||
helper.typeIntoDocument('new');
|
||||
|
||||
helper.selectAllText();
|
||||
|
||||
helper.expectTextForClipboard('new');
|
||||
|
||||
mobileHelper.openHamburgerMenu();
|
||||
|
||||
cy.contains('.menu-entry-with-icon', 'File')
|
||||
.click();
|
||||
|
||||
cy.contains('.menu-entry-with-icon', 'Save')
|
||||
.click();
|
||||
|
||||
nextcloudHelper.restorePreviousVersion();
|
||||
|
||||
mobileHelper.enableEditingMobile();
|
||||
|
||||
impressMobileHelper.selectTextShapeInTheCenter();
|
||||
|
||||
impressMobileHelper.selectTextOfShape();
|
||||
|
||||
helper.expectTextForClipboard('text');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
var helper = require('../../common/helper');
|
||||
var mobileHelper = require('../../common/mobile_helper');
|
||||
var nextcloudHelper = require('../../common/nextcloud_helper');
|
||||
var writerMobileHelper = require('./writer_mobile_helper');
|
||||
|
||||
describe('Nextcloud specific tests.', function() {
|
||||
var testFileName = 'nextcloud.odt';
|
||||
@ -64,5 +65,39 @@ describe('Nextcloud specific tests.', function() {
|
||||
|
||||
nextcloudHelper.checkAndCloseRevisionHistory();
|
||||
});
|
||||
|
||||
it('Restore previous revision.', function() {
|
||||
helper.beforeAll(testFileName, 'writer');
|
||||
|
||||
mobileHelper.enableEditingMobile();
|
||||
|
||||
// Initially we have "text" text in the document
|
||||
writerMobileHelper.selectAllMobile();
|
||||
|
||||
helper.expectTextForClipboard('text');
|
||||
|
||||
// Change the document content and save it
|
||||
helper.typeIntoDocument('new');
|
||||
|
||||
writerMobileHelper.selectAllMobile();
|
||||
|
||||
helper.expectTextForClipboard('new');
|
||||
|
||||
mobileHelper.openHamburgerMenu();
|
||||
|
||||
cy.contains('.menu-entry-with-icon', 'File')
|
||||
.click();
|
||||
|
||||
cy.contains('.menu-entry-with-icon', 'Save')
|
||||
.click();
|
||||
|
||||
nextcloudHelper.restorePreviousVersion();
|
||||
|
||||
mobileHelper.enableEditingMobile();
|
||||
|
||||
writerMobileHelper.selectAllMobile();
|
||||
|
||||
helper.expectTextForClipboard('text');
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user