Remove excluded test (#6096)

* remove excluded test part1

* remove fit

* fix

* fix lint

* fix

* fix

* fix

* fix

* fix lint

* fix lint

* fixes

* update protractor due incompatibility with new node versions

* increase timeout pdf when system is busy
This commit is contained in:
Eugenio Romano
2020-09-08 14:39:22 +01:00
committed by GitHub
parent 8d6baf2536
commit c57253ff54
22 changed files with 238 additions and 143 deletions

View File

@@ -288,18 +288,25 @@ export class DataTableComponentPage {
async waitTillContentLoaded(): Promise<void> {
await browser.sleep(500);
Logger.log('wait datatable loading');
if (element(by.tagName('mat-spinner')).isPresent()) {
Logger.log('wait datatable loading spinner disappear');
await BrowserVisibility.waitUntilElementIsNotPresent(element(by.tagName('mat-spinner')));
} else {
try {
await BrowserVisibility.waitUntilElementIsPresent(element(by.tagName('mat-spinner')), 500);
Logger.log('wait datatable loading spinner is present');
await BrowserVisibility.waitUntilElementIsPresent(element(by.tagName('mat-spinner')));
} catch (error) {
}
}
await BrowserVisibility.waitUntilElementIsVisible(this.contents.first());
try {
Logger.log('wait first element is present');
await BrowserVisibility.waitUntilElementIsVisible(this.contents.first(), 1000);
} catch (error) {
Logger.log('Possible empty page');
}
}
async checkColumnIsDisplayed(column: string): Promise<void> {
@@ -423,7 +430,7 @@ export class DataTableComponentPage {
}
async waitForEmptyState(): Promise<void> {
await BrowserVisibility.waitUntilElementIsPresent(this.tableBody.element(this.emptyList));
await BrowserVisibility.waitUntilElementIsPresent(this.emptyList);
}
async getEmptyStateTitle(): Promise<string> {

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Locator, by, element, ElementFinder } from 'protractor';
import { browser, Locator, by, element, ElementFinder } from 'protractor';
import { BrowserVisibility, BrowserActions } from '../../utils/public-api';
import { DropdownPage } from '../material/dropdown.page';
@@ -67,7 +67,7 @@ export class FormFields {
const valueWidget = await (await this.getWidget(fieldId)).element(valueLocatorParam || this.valueLocator);
await BrowserVisibility.waitUntilElementIsVisible(valueWidget);
return valueWidget.getAttribute('value');
return BrowserActions.getInputValue(valueWidget);
}
async getFieldLabel(fieldId: string, labelLocatorParam?: any) {
@@ -98,6 +98,7 @@ export class FormFields {
async refreshForm(): Promise<void> {
await BrowserActions.click(this.refreshButton);
await browser.sleep(500);
}
async saveForm(): Promise<void> {

View File

@@ -18,6 +18,7 @@
import { Locator, by, element } from 'protractor';
import { BrowserVisibility } from '../utils/browser-visibility';
import { BrowserActions } from '../utils/browser-actions';
import { Logger } from '../utils/logger';
export class PaginationPage {
@@ -45,6 +46,7 @@ export class PaginationPage {
await BrowserVisibility.waitUntilElementIsPresent(itemsPerPage);
await BrowserActions.click(itemsPerPage);
await BrowserVisibility.waitUntilElementIsNotVisible(this.pageSelectorDropDown);
Logger.log('Select page size ', numberOfItem);
}
async checkPageSelectorIsNotDisplayed(): Promise<void> {
@@ -81,10 +83,12 @@ export class PaginationPage {
async clickOnNextPage(): Promise<void> {
return BrowserActions.click(this.nextPageButton);
Logger.log('Next page');
}
async clickOnPageDropdown(): Promise<void> {
await BrowserActions.click(this.pageDropDown);
Logger.log('Click page dropdown');
}
async clickOnPageDropdownOption(numberOfItemPerPage: string): Promise<void> {

View File

@@ -113,7 +113,7 @@ export class ViewerPage {
}
async clearPageNumber(): Promise<void> {
await BrowserActions.clearSendKeys(this.pageSelectorInput, protractor.Key.ENTER);
await BrowserActions.clearSendKeys(this.pageSelectorInput);
}
async getZoom(): Promise<string> {
@@ -143,7 +143,7 @@ export class ViewerPage {
}
async checkFileIsLoaded(fileName?: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.pdfPageLoaded, 30000, `${fileName} not loaded`);
await BrowserVisibility.waitUntilElementIsVisible(this.pdfPageLoaded, 60000, `${fileName} not loaded`);
}
async clickClosePasswordDialog(): Promise<void> {
@@ -230,9 +230,9 @@ export class ViewerPage {
await BrowserVisibility.waitUntilElementIsVisible(this.fileThumbnail);
}
async checkFileNameIsDisplayed(file): Promise<void> {
async checkFileNameIsDisplayed(filename: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.fileName);
await expect(await BrowserActions.getText(this.fileName)).toEqual(file);
await BrowserVisibility.waitUntilElementHasText(this.fileName, filename);
}
async checkPreviousPageButtonIsDisplayed() {

View File

@@ -127,7 +127,7 @@ export class BrowserActions {
}
}
static async clearSendKeys(elementFinder: ElementFinder, text: string, sleepTime: number = 0): Promise<void> {
static async clearSendKeys(elementFinder: ElementFinder, text: string = '', sleepTime: number = 0): Promise<void> {
Logger.info(`Clear and sendKeys text:${text} locator:${elementFinder.locator().toString()}`);
await this.click(elementFinder);
@@ -143,6 +143,13 @@ export class BrowserActions {
}
}
try {
if (text !== protractor.Key.SPACE && text !== protractor.Key.ENTER) {
await BrowserVisibility.waitUntilElementHasValue(elementFinder, text, 1000);
}
} catch (e) {
Logger.info(`Set value different from the input`);
}
}
static async checkIsDisabled(elementFinder: ElementFinder): Promise<void> {