libreoffice-online/cypress_test/plugins/tasks.js
Rash419 4ab08eea1b cypress: introducing notebookbar tests
fix: image_operation test unstable

leaflet: fix: scroll button not available in top toolbar of notebookbar when it is directly opened in small window

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: Ib27f3019fbee4ad87239eb659912074f41d42874
2021-06-12 11:28:57 +05:30

32 lines
814 B
JavaScript

/* global require Promise */
var fs = require('fs');
var list = require('./selectorList').list;
function copyFile(args) {
return new Promise(function(resolve) {
var sourceFile = args.sourceDir + args.fileName;
var destFile = args.destDir + args.fileName;
if (fs.existsSync(sourceFile)) {
fs.mkdirSync(args.destDir, { recursive: true });
if (fs.existsSync(destFile)) {
fs.unlinkSync(destFile);
}
fs.writeFileSync(destFile, fs.readFileSync(sourceFile));
resolve('File ${sourceFile} copied to ${destFile}');
}
resolve('File ${sourceFile} does not exist');
});
}
function getSelectors(args) {
if (args.mode === 'notebookbar') {
return list[args.name][0];
} else {
return list[args.name][1];
}
}
module.exports.copyFile = copyFile;
module.exports.getSelectors = getSelectors;