From 1065a613a9ce67b699154555e8edff9649fc2ff4 Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Tue, 8 Jul 2025 11:02:17 +0200 Subject: [PATCH] Add hierarchy logging to test failures --- test/android/test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/android/test.ts b/test/android/test.ts index c0405cf..5aa044d 100644 --- a/test/android/test.ts +++ b/test/android/test.ts @@ -135,6 +135,17 @@ describe('Test Android unpinning', function () { }); } + afterEach(async function (this: Mocha.Context) { + if (this.currentTest?.state === 'failed') { + console.log('Test failed'); + if (driver) { + const source = await driver.getPageSource().catch((e) => e.message); + console.log('Current page source:', source); + } + } + }); + + afterEach(async () => { if (driver) { await driver.deleteSession();