Skip to content

Commit

Permalink
fix: e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OtavioStasiak committed Mar 7, 2025
1 parent 0f1640b commit a3dd35a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions e2e/helpers/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,26 @@ async function mockMessage(message: string, isThread = false) {
return message;
}

async function tapCustomBackButton() {
try {
await element(by.id('custom-header-back')).atIndex(0).tap();
} catch (error) {
await element(by.id('header-back')).atIndex(0).tap();
}
}

async function tapBack() {
if (device.getPlatform() === 'ios') {
try {
await element(by.id('custom-header-back')).atIndex(0).tap();
await element(by.type('UIAccessibilityBackButtonElement')).tap();
} catch (error) {
await element(by.id('header-back')).atIndex(0).tap();
await tapCustomBackButton();
}
} else {
try {
await element(by.label('Navigate up')).tap();
} catch (error) {
await element(by.id('header-back')).atIndex(0).tap();
await tapCustomBackButton();
}
}
}
Expand Down

0 comments on commit a3dd35a

Please sign in to comment.