diff --git a/.woodpecker/e2e.yml b/.woodpecker/e2e.yml index 3cce421..8b07670 100644 --- a/.woodpecker/e2e.yml +++ b/.woodpecker/e2e.yml @@ -160,6 +160,7 @@ services: export VITE_LOCAL_RPC_PROXY_TARGET=http://anvil:8545 export VITE_LOCAL_GRAPHQL_PROXY_TARGET=http://ponder:42069 export VITE_SWAP_ROUTER=0x94cC0AaC535CCDB3C01d6787D6413C739ae12bc4 + export VITE_ENABLE_LOCAL_SWAP=true export VITE_BASE_PATH=/app/ # Overlay kraiken-lib from workspace (may be newer than baked-in image) diff --git a/tests/e2e/02-max-stake-all-tax-rates.spec.ts b/tests/e2e/02-max-stake-all-tax-rates.spec.ts index 412eb34..427de6f 100644 --- a/tests/e2e/02-max-stake-all-tax-rates.spec.ts +++ b/tests/e2e/02-max-stake-all-tax-rates.spec.ts @@ -175,12 +175,17 @@ test.describe('Max Stake All Tax Rates', () => { await mintButton.click(); await page.waitForTimeout(3_000); - // Step 2: Buy a large amount of KRK tokens + // Step 2: Buy a large amount of KRK tokens via the get-krk page + 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 }); + console.log('[TEST] Buying KRK tokens (swapping 5 ETH)...'); const ethToSpendInput = page.getByLabel('ETH to spend'); + await expect(ethToSpendInput).toBeVisible({ timeout: 15_000 }); await ethToSpendInput.fill('5'); - const buyButton = page.getByRole('button', { name: 'Buy' }).last(); + const buyButton = page.getByRole('button', { name: 'Buy KRK' }); await expect(buyButton).toBeVisible(); await buyButton.click(); @@ -188,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.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] Swap may have completed instantly');