smoke - actually retry quick access usage

This commit is contained in:
Benjamin Pasero 2021-12-16 14:25:12 +01:00
parent d338a3a0d0
commit fdc4b7101d
No known key found for this signature in database
GPG key ID: E6380CC4C8219E65

View file

@ -45,27 +45,31 @@ export class QuickAccess {
while (++retries < 10) {
let retry = false;
await this.openQuickAccess(fileName);
try {
await this.openQuickAccess(fileName);
await this.quickInput.waitForQuickInputElements(names => {
const name = names[0];
if (exactMatch && name === fileName) {
fileFound = true;
return true;
}
await this.quickInput.waitForQuickInputElements(names => {
const name = names[0];
if (exactMatch && name === fileName) {
fileFound = true;
return true;
}
if (name === 'No matching results') {
retry = true;
return true;
}
if (name === 'No matching results') {
retry = true;
return true; // search does not seem to be ready yet
}
if (!exactMatch) {
fileFound = true;
return !!name;
} else {
return false;
}
});
if (!exactMatch) {
fileFound = true;
return !!name;
} else {
return false;
}
});
} catch (error) {
retry = true; // `waitForQuickInputElements` throws when elements not found
}
if (!retry) {
break;