add tests for downloading a single file (#967)

This commit is contained in:
Adina Parpalita
2019-02-22 14:37:26 +02:00
committed by Suzana Dirla
parent 4ed77d45bb
commit 8f00aa77f1
2 changed files with 162 additions and 8 deletions

View File

@@ -95,11 +95,11 @@ export class Utils {
const config = await browser.getProcessedConfig();
const filePath = path.join(config.params.downloadFolder, fileName);
let tries = 5;
let tries = 15;
return new Promise(function(resolve) {
const checkExist = setInterval(() => {
fs.stat(filePath, function(error) {
fs.access(filePath, function(error) {
tries--;
if (error && tries === 0) {
@@ -116,16 +116,16 @@ export class Utils {
});
}
static pressEscape() {
return browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
static async pressEscape() {
return await browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
}
static pressTab() {
return browser.actions().sendKeys(protractor.Key.TAB).perform();
static async pressTab() {
return await browser.actions().sendKeys(protractor.Key.TAB).perform();
}
static getBrowserLog() {
return browser.manage().logs().get('browser');
static async getBrowserLog() {
return await browser.manage().logs().get('browser');
}
static formatDate(date: string) {