[AD-4222] e2e compilation fixes (#4426)

* Run tsc on the e2e folder and as part of the sh script

* in progress

* in progress

* in progress

* in progress

* in progress

* in progress

* fixing compile errors

* fixing compile errors.

* Fix the apiService and exclude nodemodules

* Add semicolumn

* fix import

* fix configuration test package

* fix

* fix errors

* fix typescript

* restore packages.json

* fix errors after rebase

* fix type prolems and add protracotr path mapping

* remove undefined
This commit is contained in:
gmandakini
2019-03-15 23:11:58 +00:00
committed by Eugenio Romano
parent f891ea3df5
commit fc2132e248
48 changed files with 3400 additions and 3950 deletions

View File

@@ -165,7 +165,7 @@ export class DataTableComponentPage {
async getAllRowsColumnValues(column) {
let columnLocator = by.css("adf-datatable div[class*='adf-datatable-body'] div[class*='adf-datatable-row'] div[title='" + column + "'] span");
Util.waitUntilElementIsVisible(element.all(columnLocator).first());
let initialList = await element.all(columnLocator).getText();
let initialList: any = await element.all(columnLocator).getText();
return initialList.filter((el) => el);
}

View File

@@ -22,7 +22,7 @@ import { TaskListCloudComponent } from '../../process-cloud/taskListCloudCompone
import { EditTaskFilterCloudComponent } from '../../process-cloud/editTaskFilterCloudComponent';
import { FormControllersPage } from '../../material/formControllersPage';
import { element, by } from 'protractor';
import { element, by, browser } from 'protractor';
export class TasksCloudDemoPage {

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { by, element } from 'protractor';
import { by, element, protractor } from 'protractor';
import { Util } from '../../../util/util';
export class EditProcessFilterDialog {

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { by, element } from 'protractor';
import { by, element, protractor } from 'protractor';
import { Util } from '../../../util/util';
export class EditTaskFilterDialog {

View File

@@ -111,7 +111,7 @@ export class ShareDialog {
}
calendarTodayDayIsDisabled() {
const today = this.dayPicker.element(by.css('.mat-datetimepicker-calendar-body-today')).getText();
const today: any = this.dayPicker.element(by.css('.mat-datetimepicker-calendar-body-today')).getText();
Util.waitUntilElementIsPresent(element(by.cssContainingText('.mat-datetimepicker-calendar-body-disabled', today)));
}

View File

@@ -113,12 +113,6 @@ export class UploadDialog {
return this;
}
removeFileWhileUploading(content) {
browser.driver.actions().mouseMove(this.getRowByRowName(content).element(this.sizeUploaded)).perform();
this.getRowByRowName(content).element(this.cancelWhileUploadingIcon).click();
return this;
}
getTitleText() {
Util.waitUntilElementIsVisible(this.title);
let deferred = protractor.promise.defer();
@@ -164,7 +158,7 @@ export class UploadDialog {
numberOfCurrentFilesUploaded() {
let deferred = protractor.promise.defer();
this.getTitleText().then((text) => {
this.getTitleText().then((text: any) => {
deferred.fulfill(text.split('Uploaded ')[1].split(' / ')[0]);
});
return deferred.promise;
@@ -172,7 +166,7 @@ export class UploadDialog {
numberOfInitialFilesUploaded() {
let deferred = protractor.promise.defer();
this.getTitleText().then((text) => {
this.getTitleText().then((text: any) => {
deferred.fulfill(text.split('Uploaded ')[1].split(' / ')[1]);
});
return deferred.promise;

View File

@@ -38,7 +38,7 @@ export class FilePreviewPage {
let deferred = protractor.promise.defer();
Util.waitUntilElementIsVisible(this.pdfTitleFromSearch);
Util.waitUntilElementIsVisible(this.textLayer);
this.pdfTitleFromSearch.getText().then(function (result) {
this.pdfTitleFromSearch.getText().then((result) => {
deferred.fulfill(result);
});
return deferred.promise;
@@ -152,13 +152,13 @@ export class FilePreviewPage {
}
checkCanvasWidth() {
return element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first().getAttribute(`width`).then(function (width) {
return element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first().getAttribute(`width`).then((width) => {
return width;
});
}
checkCanvasHeight() {
return element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first().getAttribute(`height`).then(function (height) {
return element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first().getAttribute(`height`).then((height) => {
return height;
});
}
@@ -175,14 +175,14 @@ export class FilePreviewPage {
actualHeight,
zoomedInHeight;
this.checkCanvasWidth().then(function (width) {
this.checkCanvasWidth().then((width) => {
actualWidth = width;
if (actualWidth && zoomedInWidth) {
expect(zoomedInWidth).toBeGreaterThan(actualWidth);
}
});
this.checkCanvasHeight().then(function (height) {
this.checkCanvasHeight().then( (height) => {
actualHeight = height;
if (actualHeight && zoomedInHeight) {
expect(zoomedInHeight).toBeGreaterThan(actualHeight);
@@ -191,14 +191,14 @@ export class FilePreviewPage {
this.clickZoomIn();
this.checkCanvasWidth().then(function (width) {
this.checkCanvasWidth().then((width) => {
zoomedInWidth = width;
if (actualWidth && zoomedInWidth) {
expect(zoomedInWidth).toBeGreaterThan(actualWidth);
}
});
this.checkCanvasHeight().then(function (height) {
this.checkCanvasHeight().then( (height) => {
zoomedInHeight = height;
if (actualHeight && zoomedInHeight) {
expect(zoomedInHeight).toBeGreaterThan(actualHeight);
@@ -220,27 +220,27 @@ export class FilePreviewPage {
newWidth,
newHeight;
this.checkCanvasWidth().then(function (width) {
this.checkCanvasWidth().then((width) => {
actualWidth = width;
});
this.checkCanvasHeight().then(function (height) {
this.checkCanvasHeight().then((height) => {
actualHeight = height;
});
this.clickZoomIn();
this.checkCanvasWidth().then(function (width) {
this.checkCanvasWidth().then((width) => {
zoomedWidth = width;
});
this.checkCanvasHeight().then(function (height) {
this.checkCanvasHeight().then((height) => {
zoomedHeight = height;
});
this.clickActualSize();
this.checkCanvasWidth().then(function (width) {
this.checkCanvasWidth().then((width) => {
newWidth = width;
if (actualWidth && zoomedWidth && newWidth) {
expect(newWidth).toBeLessThan(zoomedWidth);
@@ -248,7 +248,7 @@ export class FilePreviewPage {
}
});
this.checkCanvasHeight().then(function (height) {
this.checkCanvasHeight().then((height) => {
newHeight = height;
if (actualHeight && zoomedHeight && newHeight) {
expect(newHeight).toBeLessThan(zoomedHeight);
@@ -267,17 +267,16 @@ export class FilePreviewPage {
let actualWidth,
zoomedOutWidth,
actualHeight,
zoomedOutHeight,
zoomedInHeight;
zoomedOutHeight;
this.checkCanvasWidth().then(function (width) {
this.checkCanvasWidth().then((width) => {
actualWidth = width;
if (actualWidth && zoomedOutWidth) {
expect(zoomedOutWidth).toBeLessThan(actualWidth);
}
});
this.checkCanvasHeight().then(function (height) {
this.checkCanvasHeight().then((height) => {
actualHeight = height;
if (actualHeight && zoomedOutHeight) {
expect(zoomedOutHeight).toBeLessThan(actualHeight);
@@ -286,15 +285,14 @@ export class FilePreviewPage {
this.clickZoomOut();
this.checkCanvasWidth().then(function (width) {
this.checkCanvasWidth().then((width) => {
zoomedOutWidth = width;
if (actualWidth && zoomedOutWidth) {
expect(zoomedOutWidth).toBeLessThan(actualWidth);
}
});
this.checkCanvasHeight().then(function (height) {
zoomedInHeight = height;
this.checkCanvasHeight().then(() => {
if (actualHeight && zoomedOutHeight) {
expect(zoomedOutHeight).toBeLessThan(actualHeight);
}

View File

@@ -110,7 +110,7 @@ export class EditProcessFilterCloudComponent {
async checkAppNamesAreUnique() {
let appNameList = element.all(by.css('mat-option[data-automation-id="adf-cloud-edit-process-property-optionsappName"] span'));
let appTextList = await appNameList.getText();
let appTextList: any = await appNameList.getText();
let uniqueArray = appTextList.filter((appName) => {
let sameAppNameArray = appTextList.filter((eachApp) => eachApp === appName);
return sameAppNameArray.length === 1;

View File

@@ -57,13 +57,13 @@ export class FormFields {
return widget;
}
getFieldValue(fieldId, valueLocatorParam) {
getFieldValue(fieldId, valueLocatorParam?: any) {
let value = this.getWidget(fieldId).element(valueLocatorParam || this.valueLocator);
Util.waitUntilElementIsVisible(value);
return value.getAttribute('value');
}
getFieldLabel(fieldId, labelLocatorParam) {
getFieldLabel(fieldId, labelLocatorParam?: any) {
let label = this.getWidget(fieldId).all(labelLocatorParam || this.labelLocator).first();
Util.waitUntilElementIsVisible(label);
return label.getText();
@@ -74,7 +74,7 @@ export class FormFields {
return error.getText();
}
getFieldText(fieldId, labelLocatorParam) {
getFieldText(fieldId, labelLocatorParam?: any) {
let label = this.getWidget(fieldId).element(labelLocatorParam || this.labelLocator);
Util.waitUntilElementIsVisible(label);
return label.getText();