Attempt to fix flakiness with window title assertion

This commit is contained in:
Evan Hahn 2021-03-19 11:08:11 -05:00 committed by Josh Perez
parent 850e759579
commit df45e6a95f
1 changed files with 12 additions and 6 deletions

View File

@ -1,4 +1,4 @@
// Copyright 2014-2020 Signal Messenger, LLC
// Copyright 2014-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
const { join } = require('path');
@ -382,12 +382,18 @@ module.exports = grunt => {
console.log('window opened');
})
.then(() =>
// Get the window's title
app.client.getTitle()
)
.then(title => {
// Verify the window's title
assert.equal(title, packageJson.productName);
app.client.waitUntil(
async () =>
(await app.client.getTitle()) === packageJson.productName,
{
timeoutMsg: `Expected window title to be ${JSON.stringify(
packageJson.productName
)}`,
}
)
)
.then(() => {
console.log('title ok');
})
.then(() => {