ESLint: cleanup await expect from protractor tests (#9630)

This commit is contained in:
Denys Vuika
2024-04-30 08:07:10 -04:00
committed by GitHub
parent 4109f272ea
commit f401b8c13e
114 changed files with 2096 additions and 1908 deletions

View File

@@ -281,11 +281,11 @@ export class ContentServicesPage {
async checkEmptyFolderTextToBe(text: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.emptyFolder);
await expect(await this.emptyFolder.getText()).toContain(text);
expect(await this.emptyFolder.getText()).toContain(text);
}
async checkEmptyFolderImageUrlToContain(url): Promise<void> {
await expect(await BrowserActions.getAttribute(this.emptyFolderImage, 'src')).toContain(url);
expect(await BrowserActions.getAttribute(this.emptyFolderImage, 'src')).toContain(url);
}
async getAttributeValueForElement(elementName: string, propertyName: string): Promise<string> {

View File

@@ -114,7 +114,10 @@ export class MetadataViewPage {
async clickOnPropertiesTab(): Promise<void> {
const propertiesTab = element(
by.cssContainingText(`.adf-info-drawer-layout-content div${materialLocators.Tab.labels.class} div ${materialLocators.Tab.label.content.class}`, `Properties`)
by.cssContainingText(
`.adf-info-drawer-layout-content div${materialLocators.Tab.labels.class} div ${materialLocators.Tab.label.content.class}`,
`Properties`
)
);
await BrowserActions.click(propertiesTab);
}
@@ -164,12 +167,12 @@ export class MetadataViewPage {
async checkMetadataGroupIsExpand(groupName: string): Promise<void> {
const group = await this.getExpandedMetadataGroupLocator(groupName);
await expect(await BrowserActions.getAttribute(group, 'class')).toContain(materialLocators.Expanded.root);
expect(await BrowserActions.getAttribute(group, 'class')).toContain(materialLocators.Expanded.root);
}
async checkMetadataGroupIsNotExpand(groupName: string): Promise<void> {
const group = await this.getExpandedMetadataGroupLocator(groupName);
await expect(await BrowserActions.getAttribute(group, 'class')).not.toContain(materialLocators.Expanded.root);
expect(await BrowserActions.getAttribute(group, 'class')).not.toContain(materialLocators.Expanded.root);
}
async checkPropertyIsVisible(propertyName: string, type: string): Promise<void> {

View File

@@ -15,7 +15,8 @@
* limitations under the License.
*/
import { createApiService,
import {
createApiService,
ArrayUtil,
LoginPage,
PaginationPage,
@@ -104,24 +105,24 @@ describe('Pagination - returns to previous page when current is empty', () => {
await contentServicesPage.checkDocumentListElementsAreDisplayed();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
let list = await contentServicesPage.getAllRowsNameColumn();
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
await paginationPage.clickOnNextPage();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(5, 6))).toEqual(true);
expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(5, 6))).toEqual(true);
await contentServicesPage.deleteContent(lastFile);
await contentServicesPage.checkContentIsNotDisplayed(lastFile);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
list = await contentServicesPage.getAllRowsNameColumn();
await expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
expect(ArrayUtil.arrayContainsArray(list, fileNames.slice(0, 5))).toEqual(true);
});
it('[C297494] Should display content when navigating to a non-empty folder not in the first page', async () => {
@@ -132,8 +133,8 @@ describe('Pagination - returns to previous page when current is empty', () => {
await contentServicesPage.checkDocumentListElementsAreDisplayed();
await contentServicesPage.contentList.dataTablePage().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(await contentServicesPage.numberOfResultsDisplayed()).toBe(itemsPerPage.fiveValue);
await paginationPage.clickOnNextPage();
await contentServicesPage.checkDocumentListElementsAreDisplayed();