Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dead code from the e2e #3542

Merged
merged 6 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,4 @@ export class Breadcrumb extends Component {
return str.split('\nchevron_right')[0];
});
}

async clickItem(name: string): Promise<void> {
const elem = this.byCss(`.adf-breadcrumb-item[title=${name}]`);
await elem.click();
}
}
1 change: 0 additions & 1 deletion projects/aca-testing-shared/src/components/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export * from './pageLayoutHeader/pageLayoutHeader';
export * from './data-table/data-table';
export * from './dialog/confirm-dialog';
export * from './dialog/create-edit-folder-dialog';
export * from './dialog/password-dialog';
export * from './pagination/pagination';
export * from './sidenav/sidenav';
export * from './toolbar/toolbar';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,11 @@ export class DataTable extends Component {
head = this.byCss('.adf-datatable-header');
body = this.byCss('.adf-datatable-body');
emptyList = this.byCss('div.adf-no-content-container');
emptyFolderDragAndDrop = this.byCss('.adf-empty-list_template .adf-empty-folder');
emptyListTitle = this.byCss('.adf-empty-content__title');
emptyListSubtitle = this.byCss('.adf-empty-content__subtitle');
emptySearchText = this.byCss('.empty-search__text');
selectedRow = this.byCss('.adf-datatable-row.adf-is-selected');

columnModified = this.byCss('.adf-datatable-header [data-automation-id="auto_id_modifiedAt"]');

menu = new Menu();

constructor(ancestor?: string) {
Expand Down Expand Up @@ -103,19 +100,6 @@ export class DataTable extends Component {
}
}

async sortByModified(order: 'asc' | 'desc'): Promise<void> {
let sortOrder = await this.getSortingOrder();
const sortColumn = await this.getSortedColumnHeaderText();

if (sortColumn !== 'Modified') {
await this.columnModified.click();
sortOrder = await this.getSortingOrder();
}
if (sortOrder !== order) {
await this.columnModified.click();
}
}

private getSortedColumnHeader(): ElementFinder {
const locator = by.css(DataTable.selectors.sortedColumnHeader);
return this.head.element(locator);
Expand Down Expand Up @@ -150,12 +134,6 @@ export class DataTable extends Component {
return this.body.all(by.css('.adf-datatable-row.adf-is-selected'));
}

async getSelectedRowsNames(): Promise<string[]> {
return this.getSelectedRows().map((row) => {
return row.element(by.css('.adf-datatable-cell[title="Name"]')).getText();
});
}

async getSelectedRowsCount(): Promise<number> {
return this.getSelectedRows().count();
}
Expand All @@ -174,10 +152,6 @@ export class DataTable extends Component {
return this.getRowByName(name, location).all(by.css(DataTable.selectors.cell));
}

async getRowCellsCount(itemName: string): Promise<number> {
return this.getRowCells(itemName).count();
}

private getRowFirstCell(name: string, location: string = ''): ElementFinder {
return this.getRowCells(name, location).get(0);
}
Expand Down Expand Up @@ -218,14 +192,6 @@ export class DataTable extends Component {
return '';
}

private getNameLink(itemName: string): ElementFinder {
return this.getRowNameCell(itemName).$('.adf-datatable-link [role="link"]');
}

async hasLinkOnName(itemName: string): Promise<boolean> {
return this.getNameLink(itemName).isPresent();
}

async doubleClickOnRowByName(name: string, location: string = ''): Promise<void> {
try {
const item = this.getRowFirstCell(name, location);
Expand Down Expand Up @@ -262,15 +228,6 @@ export class DataTable extends Component {
}
}

async clickItem(name: string, location: string = ''): Promise<void> {
const item = this.getRowFirstCell(name, location);
await item.click();
}

async clickNameLink(itemName: string): Promise<void> {
await this.getNameLink(itemName).click();
}

async selectMultipleItems(names: string[], location: string = ''): Promise<void> {
await this.clearSelection();
await Utils.pressCmd();
Expand Down Expand Up @@ -298,12 +255,6 @@ export class DataTable extends Component {
await browser.actions().click(protractor.Button.RIGHT).perform();
}

async rightClickOnMultipleSelection(): Promise<void> {
const itemFromSelection = this.getSelectedRows().get(0);
await browser.actions().mouseMove(itemFromSelection).perform();
await browser.actions().click(protractor.Button.RIGHT).perform();
}

private getItemLocationEl(name: string): ElementFinder {
return this.getRowByName(name).element(by.css('.aca-location-link'));
}
Expand All @@ -330,14 +281,6 @@ export class DataTable extends Component {
return this.emptyList.isPresent();
}

async getEmptyDragAndDropText(): Promise<string> {
const isEmpty = await this.emptyFolderDragAndDrop.isDisplayed();
if (isEmpty) {
return this.emptyFolderDragAndDrop.getText();
}
return '';
}

async getEmptyStateTitle(): Promise<string> {
const isEmpty = await this.isEmpty();
if (isEmpty) {
Expand Down Expand Up @@ -369,11 +312,6 @@ export class DataTable extends Component {
});
}

async hasContextMenu(): Promise<boolean> {
const count = await this.menu.getItemsCount();
return count > 0;
}

async getLibraryRole(name: string): Promise<string> {
return this.getRowByName(name).element(by.css('adf-library-role-column')).getText();
}
Expand Down Expand Up @@ -413,26 +351,4 @@ export class DataTable extends Component {
getNthSearchResultsRow(nth: number): ElementFinder {
return this.getSearchResultsRows().get(nth - 1);
}

private getSearchResultsRowByName(name: string, location: string = ''): ElementFinder {
if (location) {
return this.body
.all(by.cssContainingText(DataTable.selectors.searchResultsRow, name))
.filter(async (elem) => browser.isElementPresent(elem.element(by.cssContainingText(DataTable.selectors.searchResultsRowLine, location))))
.first();
}
return this.body.element(by.cssContainingText(DataTable.selectors.searchResultsRow, name));
}

private getSearchResultNameLink(itemName: string, location: string = ''): ElementFinder {
return this.getSearchResultsRowByName(itemName, location).$('.aca-link');
}

async hasLinkOnSearchResultName(itemName: string, location: string = ''): Promise<boolean> {
return this.getSearchResultNameLink(itemName, location).isPresent();
}

async clickSearchResultNameLink(itemName: string, location: string = ''): Promise<void> {
await this.getSearchResultNameLink(itemName, location).click();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@ import { BrowserActions } from '@alfresco/adf-testing';

export class DateTimePicker extends Component {
calendar = this.byCss('.mat-datepicker-popup', browser);
headerTime = this.byCss('.mat-datetimepicker-calendar-header-time');
headerDate = this.byCss('.mat-datetimepicker-calendar-header-date');
headerYear = this.byCss('.mat-datetimepicker-calendar-header-year');
dayPicker = this.byCss('mat-month-view');
hourPicker = this.byCss('.mat-datetimepicker-clock-hours');
minutePicker = this.byCss('.mat-datetimepicker-clock-minutes');
nextMonthBtn = this.byCss('.mat-calendar-next-button');
rootElemLocator = by.css('.mat-datepicker-popup');

Expand All @@ -53,7 +48,7 @@ export class DateTimePicker extends Component {
}

async pickDateTime(): Promise<void> {
const today = new Date()
const today = new Date();
const nextAvailableDay = new Date();
nextAvailableDay.setDate(today.getDate() + 2);
if (nextAvailableDay.getMonth() !== today.getMonth()) {
Expand All @@ -67,16 +62,4 @@ export class DateTimePicker extends Component {
const firstActiveDayElem = this.dayPicker.element(by.cssContainingText(firstActiveDay, `${day}`));
await BrowserActions.click(firstActiveDayElem);
}

async selectHour(hour: number): Promise<void> {
const clockCellClass = '.mat-datetimepicker-clock-cell';
const selectedHourElem = this.hourPicker.element(by.cssContainingText(clockCellClass, `${hour}`));
await BrowserActions.click(selectedHourElem);
}

async selectMinute(minute: number): Promise<void> {
const clockCellClass = '.mat-datetimepicker-clock-cell';
const selectedMinuteElem = this.minutePicker.element(by.cssContainingText(clockCellClass, `${minute}`));
await BrowserActions.click(selectedMinuteElem);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ export class CreateOrEditFolderDialog extends GenericDialog {
return isPresentAndEnabled(this.updateButton);
}

async isCreateButtonEnabled(): Promise<boolean> {
return isPresentAndEnabled(this.createButton);
}

async isCancelButtonEnabled(): Promise<boolean> {
return isPresentAndEnabled(this.cancelButton);
}
Expand Down

This file was deleted.

Loading
Loading