Skip to content

Commit

Permalink
try/catch approve warning in e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
GrandSchtroumpf committed May 13, 2024
1 parent a7bb009 commit 9933723
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions e2e/utils/strategy/EditStrategyDriver.ts
Expand Up @@ -69,8 +69,12 @@ export class EditStrategyDriver {
async submit(type: 'deposit' | 'withdraw' | 'renew' | 'editPrices') {
const btn = this.page.getByTestId('edit-submit');

if (await this.page.isVisible('[data-testid=approve-warnings]')) {
await this.page.getByTestId('approve-warnings').click();
try {
if (await this.page.isVisible('[data-testid=approve-warnings]')) {
await this.page.getByTestId('approve-warnings').click();
}
} catch {
// do nothing, there is no approval needed
}
if (shouldTakeScreenshot) {
const mainMenu = new MainMenuDriver(this.page);
Expand Down

0 comments on commit 9933723

Please sign in to comment.