[ACS-6797] search general migrated from Protractor to Playwright (#3674)

* ACS-6797 search general migrated v1

* [ACS-6797] SonarCloud fix + test name update

* [ACS-6797] Tests fixed and passing

* [ACS-6797] Old protractor tests deleted from yml file
This commit is contained in:
Adam Świderski
2024-02-29 14:21:32 +01:00
committed by GitHub
parent 224cd62cbb
commit 89f12dc731
10 changed files with 358 additions and 5 deletions

View File

@@ -37,6 +37,7 @@ export class DataTableComponent extends BaseComponent {
}
public pagination = new PaginationComponent(this.page);
body = this.getChild('.adf-datatable-body')
getEmptyFolderLocator = this.getChild('.adf-empty-folder');
getEmptyContentTitleLocator = this.getChild('adf-empty-content .adf-empty-content__title');
getEmptyContentSubTitleLocator = this.getChild('adf-empty-content .adf-empty-content__subtitle');

View File

@@ -28,7 +28,18 @@ import { timeouts } from '../../../utils';
export class SearchInputComponent extends BaseComponent {
private static rootElement = 'aca-page-layout';
public searchButton = this.getChild('aca-search-input .app-search-button');
public searchOptionsArea = this.page.locator('mat-checkbox');
public searchInput = this.getChild('input[id="app-control-input"]');
public searchButton = this.getChild('.app-search-button');
public searchButtonWindow = this.page.locator('#app-search-button');
public searchInputWindow = this.page.locator('.app-search-control');
public searchInputWindowInput = this.page.locator('.app-search-control input');
public searchOptions = this.page.locator('#search-options');
public searchFilesOption = this.searchOptionsArea.getByText(' Files ');
public searchLibrariesOption = this.searchOptionsArea.getByText(' Libraries ');
public searchFoldersOption = this.searchOptionsArea.getByText(' Folders ');
getIconByName = (name: string): Locator => this.getChild('.mat-icon', { hasText: name });
/**
@@ -48,4 +59,71 @@ export class SearchInputComponent extends BaseComponent {
await this.getCellLinkByName(name).dblclick();
await this.spinnerWaitForReload();
}
async clickLibrariesOption() {
await this.searchLibrariesOption.click();
}
async clickFilesOption() {
await this.searchFilesOption.click();
}
async clickFoldersOption() {
await this.searchFoldersOption.click();
}
async isFoldersOptionChecked() {
const optClass = await this.searchFoldersOption.getAttribute('class');
return optClass.includes('mat-checkbox-checked');
}
async isFilesOptionChecked() {
const optClass = await this.searchFilesOption.getAttribute('class');
return optClass.includes('mat-checkbox-checked');
}
async isLibrariesOptionChecked() {
const optClass = await this.searchLibrariesOption.getAttribute('class');
return optClass.includes('mat-checkbox-checked');
}
async clearOptions() {
if (await this.isFilesOptionChecked()) {
await this.clickFilesOption();
}
if (await this.isFoldersOptionChecked()) {
await this.clickFoldersOption();
}
if (await this.isLibrariesOptionChecked()) {
await this.clickLibrariesOption();
}
}
async checkOnlyFolders() {
await this.clearOptions();
await this.clickFoldersOption();
}
async checkOnlyFiles() {
await this.clearOptions();
await this.clickFilesOption();
}
async checkLibraries() {
await this.clearOptions();
await this.clickLibrariesOption();
}
async checkFilesAndFolders() {
await this.clearOptions();
await this.clickFilesOption();
await this.clickFoldersOption();
}
async searchFor(text: string) {
await this.searchInputWindow.click();
await this.searchInputWindowInput.clear();
await this.searchInputWindow.type(text);
await this.searchButtonWindow.click();
}
}