Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
be68018290
commit
f612090eeb
2 changed files with 9 additions and 27 deletions
|
|
@ -164,29 +164,27 @@ test.describe('Acquire & Stake', () => {
|
|||
await mintButton.click();
|
||||
await page.waitForTimeout(3_000);
|
||||
|
||||
console.log('[TEST] Buying KRK tokens via swap...');
|
||||
console.log('[TEST] Navigating to get-krk page to buy KRK...');
|
||||
await navigateSPA(page, '/app/get-krk');
|
||||
await expect(page.getByRole('heading', { name: 'Get $KRK Tokens' })).toBeVisible({ timeout: 10_000 });
|
||||
|
||||
await page.screenshot({ path: 'test-results/before-swap.png' });
|
||||
|
||||
// Check if swap is available
|
||||
const buyWarning = await page.getByText('Connect to the Base Sepolia fork').isVisible().catch(() => false);
|
||||
if (buyWarning) {
|
||||
throw new Error('Swap not available - chain config issue persists');
|
||||
}
|
||||
|
||||
const ethToSpendInput = page.getByLabel('ETH to spend');
|
||||
await expect(ethToSpendInput).toBeVisible({ timeout: 15_000 });
|
||||
await ethToSpendInput.fill('0.05');
|
||||
|
||||
const buyButton = page.getByRole('button', { name: 'Buy' }).last();
|
||||
const buyButton = page.getByRole('button', { name: 'Buy KRK' });
|
||||
await expect(buyButton).toBeVisible();
|
||||
console.log('[TEST] Clicking Buy button...');
|
||||
console.log('[TEST] Clicking Buy KRK button...');
|
||||
await buyButton.click();
|
||||
|
||||
// Wait for button to show "Submitting..." then return to "Buy"
|
||||
// Wait for button to show "Submitting..." then return to "Buy KRK"
|
||||
console.log('[TEST] Waiting for swap to process...');
|
||||
try {
|
||||
await page.getByRole('button', { name: /Submitting/i }).waitFor({ state: 'visible', timeout: 5_000 });
|
||||
console.log('[TEST] Swap initiated, waiting for completion...');
|
||||
await page.getByRole('button', { name: 'Buy' }).last().waitFor({ state: 'visible', timeout: 60_000 });
|
||||
await page.getByRole('button', { name: 'Buy KRK' }).waitFor({ state: 'visible', timeout: 60_000 });
|
||||
console.log('[TEST] Swap completed!');
|
||||
} catch (e) {
|
||||
console.log('[TEST] No "Submitting" state detected, swap may have completed instantly');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue