Skip to content

Commit

Permalink
test: Fix tx group tests after new changes
Browse files Browse the repository at this point in the history
Signed-off-by: Yordan Iliev <[email protected]>
  • Loading branch information
yiliev0 committed Jan 23, 2025
1 parent 5050575 commit 686b8fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
22 changes: 5 additions & 17 deletions automation/pages/GroupPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,28 +294,16 @@ class GroupPage extends BasePage {
console.log(`Attempt ${attempt}/${retries} to click "Sign All" button.`);

try {
// Attempt to click the button
await this.click(selector);
await new Promise(resolve => setTimeout(resolve, 2000));
const isButtonVisible = await this.isElementVisible(selector, null, 3000);

// Wait for it to disappear (tweak timeouts as needed)
await this.waitForElementToDisappear(selector, 10000, 30000);
if (!isButtonVisible) {
return;
}

// If no error was thrown, we succeeded — break out
console.log(
`Successfully clicked "Sign All" button and it disappeared on attempt #${attempt}.`,
);
return; // or break;
} catch (error) {
console.error(`Attempt #${attempt} to click "Sign All" button failed: ${error.message}`);

if (attempt < retries) {
console.log(`Retrying in ${retryDelay}ms...`);
await new Promise(resolve => setTimeout(resolve, retryDelay));
} else {
throw new Error(
`Failed to click "Sign All" button and wait for it to disappear after ${retries} attempts.`,
);
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions automation/tests/organizationGroupTests.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ test.describe('Organization Group Tx tests', () => {
test('Verify user can execute group transaction in organization', async () => {
test.slow();
await groupPage.addOrgAllowanceTransactionToGroup(2, complexKeyAccountId, '10');
const txId = await groupPage.getTransactionTimestamp(0);
const secondTxId = await groupPage.getTransactionTimestamp(1);

await groupPage.clickOnSignAndExecuteButton();
const txId = await groupPage.getTransactionTimestamp(0);
const secondTxId = await groupPage.getTransactionTimestamp(1);
await groupPage.clickOnConfirmGroupTransactionButton();
await groupPage.clickOnSignAllButton();
await loginPage.waitForToastToDisappear();
Expand Down

0 comments on commit 686b8fa

Please sign in to comment.