Matrix / Swap confirmation shows the typed amount
Swap confirmation shows the typed amount
After typing 0.5 into the You pay field and clicking Review swap, the confirmation line reads "You pay 0.5 ETH". The broken page divides the typed amount by ten, so the confirmation reads "You pay 0.05 ETH".
What your agent will do with Beam installed
Use
Assert the confirmation shows You pay 0.5 ETH.Results
Before each check, Kane does: Type 0.5 into the "You pay" field and click "Review swap".
| Wording | Kane | Correct page | Broken page | Result |
|---|---|---|---|---|
Assert the confirmation shows You pay 0.5 ETH.From the Kane issue | 0.10.9 | passed | failed | Balanced |
| 0.10.8 | passed | failed | Balanced | |
Verify the exact visible text of the confirmation line is "You pay 0.5 ETH".Baseline | 0.10.9 | passed | failed | Balanced |
| 0.10.8 | passed | failed | Balanced |
How Kane read the page
Kane turns each wording into code that reads the page. This is the code it recorded:
Assert the confirmation shows You pay 0.5 ETH. Balanced
el(5).innerText.trim() === 'You pay 0.5 ETH'Verify the exact visible text of the confirmation line is "You pay 0.5 ETH". Balanced
el(5).innerText.trim()The two pages
These are live. To see the difference, do what Kane does: Type 0.5 into the "You pay" field and click "Review swap".
Source
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Swap</title><style>body{font:18px system-ui,sans-serif;margin:24px}input,button{font-size:18px;padding:8px}</style></head><body>
<h1>Swap</h1>
<label for="pay">You pay</label>
<input id="pay" type="text" inputmode="decimal">
<button id="review">Review swap</button>
<p id="confirm" role="status"></p>
<script>
document.getElementById('review').addEventListener('click', () => {
const v = document.getElementById('pay').value.trim();
document.getElementById('confirm').textContent = 'You pay ' + v + ' ETH';
});
</script></body></html>
Source
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Swap</title><style>body{font:18px system-ui,sans-serif;margin:24px}input,button{font-size:18px;padding:8px}</style></head><body>
<h1>Swap</h1>
<label for="pay">You pay</label>
<input id="pay" type="text" inputmode="decimal">
<button id="review">Review swap</button>
<p id="confirm" role="status"></p>
<script>
document.getElementById('review').addEventListener('click', () => {
const v = document.getElementById('pay').value.trim();
document.getElementById('confirm').textContent = 'You pay ' + (parseFloat(v) / 10) + ' ETH';
});
</script></body></html>
Reproduce it
Clone the repo, then run this behavior on your own Kane:
npm run suite -- confirm-amount