Faster CI runs

This commit is contained in:
Fedor Indutny
2025-08-07 10:33:21 -07:00
committed by GitHub
parent 109c3036c9
commit ec8d6a7359
26 changed files with 242 additions and 207 deletions

View File

@@ -400,17 +400,22 @@ export class Bootstrap {
await app.stageLocalBackupForImport(localBackup);
}
debug('looking for QR code or relink button');
const qrCode = window.locator(
'.module-InstallScreenQrCodeNotScannedStep__qr-code__code'
let gotProvisionURL = false;
drop(
(async () => {
try {
const relinkButton = window.locator('.LeftPaneDialog__icon--relink');
await relinkButton.waitFor();
if (gotProvisionURL) {
return;
}
await relinkButton.click();
} catch {
// Ignore, provision will fail if QR code was never generated
}
})()
);
const relinkButton = window.locator('.LeftPaneDialog__icon--relink');
await qrCode.or(relinkButton).waitFor();
if (await relinkButton.isVisible()) {
debug('unlinked, clicking left pane button');
await relinkButton.click();
await qrCode.waitFor();
}
debug('waiting for provision');
const provision = await this.server.waitForProvision();
@@ -418,6 +423,8 @@ export class Bootstrap {
debug('waiting for provision URL');
const provisionURL = await app.waitForProvisionURL();
gotProvisionURL = true;
debug('completing provision');
this.#privDesktop = await provision.complete({
provisionURL,

View File

@@ -57,7 +57,9 @@ describe('readSync', function (this: Mocha.Suite) {
const leftPane = page.locator('#LeftPane');
await leftPane
.locator('.module-conversation-list__item--contact-or-conversation')
.locator(
'.module-conversation-list__item--contact-or-conversation >> "<(˶ᵔᵕᵔ˶)>"'
)
.first()
.waitFor();

View File

@@ -87,11 +87,13 @@ describe('messaging/relink', function (this: Mocha.Suite) {
)
.waitFor();
debug('unlinkng');
await app.unlink();
await app.waitForUnlink();
await phone.unlink(desktop);
await server.removeDevice(desktop.number, desktop.deviceId);
debug('closing');
await app.close();
debug('change pinned contact, identity key');

View File

@@ -88,9 +88,7 @@ describe('unprocessed', function (this: Mocha.Suite) {
const page = await app.getWindow();
debug('opening conversation');
await page
.locator(`[data-testid="${alice.device.aci}"] >> "${alice.profileName}"`)
.click();
await page.getByTestId(alice.device.aci).click();
await page.locator('.module-message__text >> "hello: 4"').waitFor();
await page.locator('.module-message__text >> "hello: 5"').waitFor();

View File

@@ -83,6 +83,7 @@ export class App extends EventEmitter {
snapshots: true,
});
}
await page?.emulateMedia({ reducedMotion: 'reduce' });
await page?.waitForLoadState('load');
})(),
20 * SECOND

View File

@@ -110,10 +110,12 @@ describe('storage service', function (this: Mocha.Suite) {
}
const updatedState = await phone.setStorageState(
state.addRecord({
type: IdentifierType.ACCOUNT,
record: oldAccount.record,
})
state
.addRecord({
type: IdentifierType.ACCOUNT,
record: oldAccount.record,
})
.updateAccount({})
);
debug('sending fetch storage');

View File

@@ -48,20 +48,21 @@ describe('storage service', function (this: Mocha.Suite) {
debug('Unpinning group via storage service');
{
const state = await phone.expectStorageState('initial state');
const newState = state.unpinGroup(group);
await phone.setStorageState(state.unpinGroup(group));
await phone.setStorageState(newState);
await phone.sendFetchStorage({
timestamp: bootstrap.getTimestamp(),
});
await leftPane.locator(`[data-testid="${group.id}"]`).waitFor();
await app.waitForManifestVersion(newState.version);
}
debug('Pinning group in the app');
{
const state = await phone.expectStorageState('consistency check');
const convo = leftPane.locator(`[data-testid="${group.id}"]`);
const convo = leftPane.getByTestId(group.id);
await convo.click();
const moreButton = conversationStack.locator(

View File

@@ -70,11 +70,10 @@ describe('storage service', function (this: Mocha.Suite) {
await conversationView
.locator(`a:has-text("${STICKER_PACKS[0].id.toString('hex')}")`)
.click({ noWaitAfter: true });
.click();
await window
.locator(
'.module-sticker-manager__preview-modal__footer--install button >> "Install"'
)
.getByTestId('StickerPreviewModal')
.getByRole('button', { name: 'Install' })
.click();
debug('waiting for sync message');
@@ -114,12 +113,10 @@ describe('storage service', function (this: Mocha.Suite) {
await conversationView
.locator(`a:has-text("${STICKER_PACKS[0].id.toString('hex')}")`)
.click({ noWaitAfter: true });
.click();
await window
.locator(
'.module-sticker-manager__preview-modal__footer--install button ' +
'>> "Uninstall"'
)
.getByTestId('StickerPreviewModal')
.getByRole('button', { name: 'Uninstall' })
.click();
// Confirm