Skip to content

Commit

Permalink
fix: ui test
Browse files Browse the repository at this point in the history
  • Loading branch information
ioanmo226 committed Oct 29, 2024
1 parent bb1adb2 commit 6268a96
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
13 changes: 8 additions & 5 deletions appium/tests/screenobjects/email.screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,15 @@ class EmailScreen extends BaseScreen {
clickToggleQuoteButton = async (index: number) => {
const element = await $(`~aid-message-${index}-quote-toggle`);
if (await element.isDisplayed()) {
await ElementHelper.waitAndClick(element);
// Try to click quote toggle button one more time if quote doesn't appear
await browser.pause(100);
const quoteEl = await this.messageQuote(index);
if (!(await quoteEl.isDisplayed())) {
try {
await ElementHelper.waitAndClick(element);
} catch {
// Try to click quote toggle button one more time if quote doesn't appear
await browser.pause(100);
const quoteEl = await this.messageQuote(index);
if (!(await quoteEl.isDisplayed())) {
await ElementHelper.waitAndClick(element);
}
}
}
};
Expand Down
8 changes: 7 additions & 1 deletion appium/tests/screenobjects/refresh-key.screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ class RefreshKeyScreen extends BaseScreen {
};

cancelRefresh = async () => {
await ElementHelper.waitAndClick(await this.cancelButton);
try {
await ElementHelper.waitAndClick(await this.cancelButton);
} catch {
// For some reason clicking cancel button with aid-cancel-button identifier doesn't work. Try to click with click text identifier
// https://flowcrypt.semaphoreci.com/jobs/fdde00a1-33b1-4df9-a9b8-49d546c2ef79/summary?report_id=4ae71336-e44b-39bf-b9d2-752e234818a5&test_id=8e5e69c0-6bc7-316b-ab4d-7b75d419353e
await ElementHelper.waitAndClick(await $('~Cancel'));
}
};

clickOkButton = async () => {
Expand Down

0 comments on commit 6268a96

Please sign in to comment.