Fix search smoketest - use span for all searchview messages and fix selector

Fix #89795
This commit is contained in:
Rob Lourens 2020-01-31 09:32:52 -08:00
parent d1fca9d427
commit f550dcc7ba
2 changed files with 5 additions and 4 deletions

View file

@ -1543,7 +1543,7 @@ export class SearchView extends ViewPane {
if (this.searchConfig.enableSearchEditorPreview) {
dom.append(messageEl, $('span', undefined, resultMsg + ' - '));
const span = dom.append(messageEl, $('span', undefined));
const span = dom.append(messageEl, $('span'));
const openInEditorLink = dom.append(span, $('a.pointer.prominent', undefined, nls.localize('openInEditor.message', "Open in editor")));
openInEditorLink.title = appendKeyBindingLabel(
@ -1556,7 +1556,7 @@ export class SearchView extends ViewPane {
}));
} else {
dom.append(messageEl, $('p', undefined, resultMsg));
dom.append(messageEl, $('span', undefined, resultMsg));
}
this.reLayout();
} else if (!msgWasHidden) {

View file

@ -109,11 +109,12 @@ export class Search extends Viewlet {
}
async waitForResultText(text: string): Promise<void> {
await this.code.waitForTextContent(`${VIEWLET} .messages .message>p`, text);
// The label can end with " - " depending on whether the search editor is enabled
await this.code.waitForTextContent(`${VIEWLET} .messages .message>span`, undefined, result => result.startsWith(text));
}
async waitForNoResultText(): Promise<void> {
await this.code.waitForElement(`${VIEWLET} .messages[aria-hidden="true"] .message>p`);
await this.code.waitForElement(`${VIEWLET} .messages[aria-hidden="true"] .message>span`);
}
private async waitForInputFocus(selector: string): Promise<void> {