[ADF-3259] [ADF-3363] e2e login and card metadata (#3612)

* remember me

* add login component e2e test

* add success route test

* add change logo check

* redirect url after logout e2e

* move redirection test in a separate file

* login component tslint

* cardview e2e

* fix login test

* add test case number

* move version test in a separate file

* clean unused elements

* metadata part 1

* tslint fix

* fix metadata test

* remove fit

* fix formatting file viewerPage

* multi propety test

* metadata and login improvements

* fix data automation fix

* metadata permission e2e

* fix tslint problems

* improve selector

* stabilize search component test

* stabilize test step 1

* fix tag test
add config timeout

* tentative

* delay after download

* change meatdata test

* stabilize metadata

* use smaller file for not extension related test

* stabilize test step 2

* exclude failing test

* timeout fix

* split in multiple task e2e

* trick travis

* trigger build

* fix command issue

* fix save screenshot

* fix run subfolder

* test timeout increase
This commit is contained in:
Eugenio Romano
2018-07-23 14:11:54 +01:00
committed by Eugenio Romano
parent 66f534b32c
commit b2cb93468d
116 changed files with 3936 additions and 1519 deletions

View File

@@ -28,8 +28,7 @@ var TestConfig = require('../test.config');
var moment = require('moment');
var CONSTANTS = require('./constants');
var DEFAULT_TIMEOUT = 20000;
var DEFAULT_TIMEOUT = parseInt(TestConfig.main.timeout);
/**
* Provides utility methods used throughout the testing framework.
*
@@ -44,9 +43,7 @@ var apiRequest = TestConfig.main.protocol !== 'http' ? https : http;
*/
exports.uploadParentFolder = function (filePath) {
var parentFolder = path.resolve(path.join(__dirname, 'test'));
var absolutePath = path.resolve(path.join(parentFolder, filePath));
return absolutePath;
return path.resolve(path.join(parentFolder, filePath));
};
/**
@@ -62,11 +59,6 @@ exports.sleep = function (time, callback) {
callback();
};
exports.refreshBrowser = function () {
browser.refresh();
};
/**
* Get current date in long format: Oct 24, 2016
*
@@ -91,9 +83,7 @@ exports.getCrtDateLongFormat = function () {
* @method getCrtDateInFormat
*/
exports.getCrtDateInFormat = function (dateFormat) {
var currentDate = moment().format(dateFormat);
// console.debug("Current date formatted with: '" + dateFormat + "' format, is: '" + currentDate + "'");
return currentDate;
return moment().format(dateFormat);
};
/**
@@ -121,11 +111,11 @@ exports.generatePasswordString = function (length) {
var possibleLowerCase = 'abcdefghijklmnopqrstuvwxyz';
var lowerCaseLimit = Math.floor(length / 2);
for (var i = 0; i < lowerCaseLimit; i++) {
for (let i = 0; i < lowerCaseLimit; i++) {
text += possibleLowerCase.charAt(Math.floor(Math.random() * possibleLowerCase.length));
}
for (var i = 0; i < length - lowerCaseLimit; i++) {
for (let i = 0; i < length - lowerCaseLimit; i++) {
text += possibleUpperCase.charAt(Math.floor(Math.random() * possibleUpperCase.length));
}
@@ -419,7 +409,7 @@ exports.waitUntilElementIsNotVisible = function (elementToCheck, timeout) {
return elementToCheck.isPresent().then(function (present) {
return !present;
})
}, waitTimeout, 'Element is not in Visible ' + elementToCheck.locator());
}, waitTimeout, 'Element is Visible and it should not' + elementToCheck.locator());
};
exports.waitUntilElementIsNotDisplayed = function (elementToCheck, timeout) {
@@ -429,7 +419,7 @@ exports.waitUntilElementIsNotDisplayed = function (elementToCheck, timeout) {
return elementToCheck.isDisplayed().then(function (present) {
return !present;
})
}, waitTimeout, 'Element is not in dysplayed ' + elementToCheck.locator());
}, waitTimeout, 'Element is dysplayed and it should not' + elementToCheck.locator());
};
/*
@@ -501,16 +491,11 @@ exports.openNewTabInBrowser = function () {
};
exports.switchToWindowHandler = function (number) {
browser.driver.getAllWindowHandles().then(function (handles) {
browser.driver.getAllWindowHandles().then((handles) => {
browser.driver.switchTo().window(handles[number]);
});
};
exports.pressDownArrowAndEnter = function () {
browser.actions().sendKeys(protractor.Key.ARROW_DOWN).sendKeys(protractor.Key.ENTER).perform();
};
/**
* Verify file exists
* @param filePath - absolute path to the searched file