fix: use toHaveText to correctly await swap completion after testId migration
getByTestId('swap-buy-button').waitFor({ state: 'visible' }) resolved
immediately because the button is always rendered; only its text changes.
Replace with expect(...).toHaveText('Buy KRK', { timeout: 60_000 }) to
correctly gate on the button returning to its idle state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
68601c255a
commit
ed5db3b000
3 changed files with 3 additions and 3 deletions
|
|
@ -193,7 +193,7 @@ test.describe('Max Stake All Tax Rates', () => {
|
|||
console.log('[TEST] Waiting for swap to process...');
|
||||
try {
|
||||
await page.getByRole('button', { name: /Submitting/i }).waitFor({ state: 'visible', timeout: 5_000 });
|
||||
await page.getByTestId('swap-buy-button').waitFor({ state: 'visible', timeout: 60_000 });
|
||||
await expect(page.getByTestId('swap-buy-button')).toHaveText('Buy KRK', { timeout: 60_000 });
|
||||
console.log('[TEST] Swap completed!');
|
||||
} catch (e) {
|
||||
console.log('[TEST] Swap may have completed instantly');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue