diff options
Diffstat (limited to 'test/e2e/metamask-ui.spec.js')
-rw-r--r-- | test/e2e/metamask-ui.spec.js | 65 |
1 files changed, 56 insertions, 9 deletions
diff --git a/test/e2e/metamask-ui.spec.js b/test/e2e/metamask-ui.spec.js index f9f52670b..006d8af60 100644 --- a/test/e2e/metamask-ui.spec.js +++ b/test/e2e/metamask-ui.spec.js @@ -322,12 +322,44 @@ describe('MetaMask', function () { await sendButton.click() await delay(regularDelayMs) - const inputAddress = await findElement(driver, By.css('input[placeholder="Recipient Address"]')) - const inputAmount = await findElement(driver, By.css('.unit-input__input')) + const inputAddress = await findElement(driver, By.css('input[placeholder="Search, public address (0x), or ENS"]')) await inputAddress.sendKeys('0x2f318C334780961FB129D2a6c30D0763d9a5C970') + + const recipientRow = await findElement(driver, By.css('.send__select-recipient-wrapper__group-item')) + await recipientRow.click() + await delay(regularDelayMs) + + const inputAmount = await findElement(driver, By.css('.unit-input__input')) + await inputAmount.sendKeys('1000') + + const errorAmount = await findElement(driver, By.css('.send-v2__error-amount')) + assert.equal(await errorAmount.getText(), 'Insufficient funds.', 'send screen should render an insufficient fund error message') + + await inputAmount.sendKeys(Key.BACK_SPACE) + await delay(50) + await inputAmount.sendKeys(Key.BACK_SPACE) + await delay(50) + await inputAmount.sendKeys(Key.BACK_SPACE) + await delay(tinyDelayMs) + + await assertElementNotPresent(webdriver, driver, By.css('.send-v2__error-amount')) + + const amountMax = await findElement(driver, By.css('.send-v2__amount-max')) + await amountMax.click() + + assert.equal(await inputAmount.isEnabled(), false) + + let inputValue = await inputAmount.getAttribute('value') + + assert(Number(inputValue) > 99) + + await amountMax.click() + + assert.equal(await inputAmount.isEnabled(), true) + await inputAmount.sendKeys('1') - const inputValue = await inputAmount.getAttribute('value') + inputValue = await inputAmount.getAttribute('value') assert.equal(inputValue, '1') await delay(regularDelayMs) @@ -360,9 +392,14 @@ describe('MetaMask', function () { await sendButton.click() await delay(regularDelayMs) - const inputAddress = await findElement(driver, By.css('input[placeholder="Recipient Address"]')) - const inputAmount = await findElement(driver, By.css('.unit-input__input')) + const inputAddress = await findElement(driver, By.css('input[placeholder="Search, public address (0x), or ENS"]')) await inputAddress.sendKeys('0x2f318C334780961FB129D2a6c30D0763d9a5C970') + + const recipientRow = await findElement(driver, By.css('.send__select-recipient-wrapper__group-item')) + await recipientRow.click() + await delay(regularDelayMs) + + const inputAmount = await findElement(driver, By.css('.unit-input__input')) await inputAmount.sendKeys('1') const inputValue = await inputAmount.getAttribute('value') @@ -402,9 +439,14 @@ describe('MetaMask', function () { await sendButton.click() await delay(regularDelayMs) - const inputAddress = await findElement(driver, By.css('input[placeholder="Recipient Address"]')) - const inputAmount = await findElement(driver, By.css('.unit-input__input')) + const inputAddress = await findElement(driver, By.css('input[placeholder="Search, public address (0x), or ENS"]')) await inputAddress.sendKeys('0x2f318C334780961FB129D2a6c30D0763d9a5C970') + + const recipientRow = await findElement(driver, By.css('.send__select-recipient-wrapper__group-item')) + await recipientRow.click() + await delay(regularDelayMs) + + const inputAmount = await findElement(driver, By.css('.unit-input__input')) await inputAmount.sendKeys('1') const inputValue = await inputAmount.getAttribute('value') @@ -1005,9 +1047,14 @@ describe('MetaMask', function () { await sendButton.click() await delay(regularDelayMs) - const inputAddress = await findElement(driver, By.css('input[placeholder="Recipient Address"]')) - const inputAmount = await findElement(driver, By.css('.unit-input__input')) + const inputAddress = await findElement(driver, By.css('input[placeholder="Search, public address (0x), or ENS"]')) await inputAddress.sendKeys('0x2f318C334780961FB129D2a6c30D0763d9a5C970') + + const recipientRow = await findElement(driver, By.css('.send__select-recipient-wrapper__group-item')) + await recipientRow.click() + await delay(regularDelayMs) + + const inputAmount = await findElement(driver, By.css('.unit-input__input')) await inputAmount.sendKeys('1') // Set the gas limit |