mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-10-01 14:41:14 +00:00
search button workaround
This commit is contained in:
@@ -29,7 +29,10 @@ import { waitForPresence, waitElement } from '../../utilities/utils';
|
|||||||
import { BrowserActions, BrowserVisibility, TestElement } from '@alfresco/adf-testing';
|
import { BrowserActions, BrowserVisibility, TestElement } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class SearchInput extends Component {
|
export class SearchInput extends Component {
|
||||||
searchButton = this.component.element(by.css('.app-search-button'));
|
get searchButton() {
|
||||||
|
return browser.element(by.css('.app-search-button'));
|
||||||
|
}
|
||||||
|
|
||||||
searchContainer = browser.element(by.css('.app-search-container'));
|
searchContainer = browser.element(by.css('.app-search-container'));
|
||||||
searchControl = browser.element(by.css('.app-search-control'));
|
searchControl = browser.element(by.css('.app-search-control'));
|
||||||
|
|
||||||
@@ -59,6 +62,11 @@ export class SearchInput extends Component {
|
|||||||
|
|
||||||
async clickSearchButton() {
|
async clickSearchButton() {
|
||||||
await BrowserActions.click(this.searchButton);
|
await BrowserActions.click(this.searchButton);
|
||||||
|
|
||||||
|
// TODO: Workaround for new Layout having 2 buttons
|
||||||
|
await waitForPresence(this.searchButton);
|
||||||
|
await BrowserActions.click(this.searchButton);
|
||||||
|
|
||||||
await this.waitForSearchControl();
|
await this.waitForSearchControl();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,8 +178,8 @@ export class SearchInput extends Component {
|
|||||||
const check = async () => {
|
const check = async () => {
|
||||||
loopCount++;
|
loopCount++;
|
||||||
loopCount >= attempts ? reject('File not found') : methodType === 'UI' ? await this.searchFor(text) : await this.searchByURL(text);
|
loopCount >= attempts ? reject('File not found') : methodType === 'UI' ? await this.searchFor(text) : await this.searchByURL(text);
|
||||||
await this.searchResult.isPresent(waitPerSearch) ? resolve('File found') : setTimeout(check, waitPerSearch);
|
(await this.searchResult.isPresent(waitPerSearch)) ? resolve('File found') : setTimeout(check, waitPerSearch);
|
||||||
}
|
};
|
||||||
return check();
|
return check();
|
||||||
});
|
});
|
||||||
return myPromise;
|
return myPromise;
|
||||||
|
Reference in New Issue
Block a user