How to use driver.click method in Appium Android Driver

Best JavaScript code snippet using appium-android-driver

metamask-ui.spec.js

Source:metamask-ui.spec.js Github

copy

Full Screen

1const { strict: assert } = require('assert');2const path = require('path');3const enLocaleMessages = require('../../app/_locales/en/messages.json');4const createStaticServer = require('../../development/create-static-server');5const {6 tinyDelayMs,7 regularDelayMs,8 largeDelayMs,9 veryLargeDelayMs,10} = require('./helpers');11const { buildWebDriver } = require('./webdriver');12const Ganache = require('./ganache');13const { ensureXServerIsRunning } = require('./x-server');14const ganacheServer = new Ganache();15const dappPort = 8080;16describe('MetaMask', function () {17 let driver;18 let dappServer;19 let tokenAddress;20 const testSeedPhrase =21 'phrase upgrade clock rough situate wedding elder clever doctor stamp excess tent';22 this.bail(true);23 let failed = false;24 before(async function () {25 await ganacheServer.start();26 const dappDirectory = path.resolve(27 __dirname,28 '..',29 '..',30 'node_modules',31 '@metamask',32 'test-dapp',33 'dist',34 );35 dappServer = createStaticServer(dappDirectory);36 dappServer.listen(dappPort);37 await new Promise((resolve, reject) => {38 dappServer.on('listening', resolve);39 dappServer.on('error', reject);40 });41 if (42 process.env.SELENIUM_BROWSER === 'chrome' &&43 process.env.CI === 'true'44 ) {45 await ensureXServerIsRunning();46 }47 const result = await buildWebDriver();48 driver = result.driver;49 await driver.navigate();50 });51 afterEach(async function () {52 if (process.env.SELENIUM_BROWSER === 'chrome') {53 const errors = await driver.checkBrowserForConsoleErrors(driver);54 if (errors.length) {55 const errorReports = errors.map((err) => err.message);56 const errorMessage = `Errors found in browser console:\n${errorReports.join(57 '\n',58 )}`;59 console.error(new Error(errorMessage));60 }61 }62 if (this.currentTest.state === 'failed') {63 failed = true;64 await driver.verboseReportOnFailure(this.currentTest.title);65 }66 });67 after(async function () {68 if (process.env.E2E_LEAVE_RUNNING === 'true' && failed) {69 return;70 }71 await ganacheServer.quit();72 await driver.quit();73 await new Promise((resolve, reject) => {74 dappServer.close((error) => {75 if (error) {76 return reject(error);77 }78 return resolve();79 });80 });81 });82 describe('Going through the first time flow', function () {83 it('clicks the continue button on the welcome screen', async function () {84 await driver.findElement('.welcome-page__header');85 await driver.clickElement({86 text: enLocaleMessages.getStarted.message,87 tag: 'button',88 });89 await driver.delay(largeDelayMs);90 });91 it('clicks the "Create New Wallet" option', async function () {92 await driver.clickElement({ text: 'Create a Wallet', tag: 'button' });93 await driver.delay(largeDelayMs);94 });95 it('clicks the "No thanks" option on the metametrics opt-in screen', async function () {96 await driver.clickElement('.btn-secondary');97 await driver.delay(largeDelayMs);98 });99 it('accepts a secure password', async function () {100 await driver.fill(101 '.first-time-flow__form #create-password',102 'correct horse battery staple',103 );104 await driver.fill(105 '.first-time-flow__form #confirm-password',106 'correct horse battery staple',107 );108 await driver.clickElement('.first-time-flow__checkbox');109 await driver.clickElement('.first-time-flow__form button');110 await driver.delay(regularDelayMs);111 });112 let seedPhrase;113 it('renders the Secret Recovery Phrase intro screen', async function () {114 await driver.clickElement('.seed-phrase-intro__left button');115 await driver.delay(regularDelayMs);116 });117 it('reveals the Secret Recovery Phrase', async function () {118 const byRevealButton =119 '.reveal-seed-phrase__secret-blocker .reveal-seed-phrase__reveal-button';120 await driver.findElement(byRevealButton);121 await driver.clickElement(byRevealButton);122 await driver.delay(regularDelayMs);123 const revealedSeedPhrase = await driver.findElement(124 '.reveal-seed-phrase__secret-words',125 );126 seedPhrase = await revealedSeedPhrase.getText();127 assert.equal(seedPhrase.split(' ').length, 12);128 await driver.delay(regularDelayMs);129 await driver.clickElement({130 text: enLocaleMessages.next.message,131 tag: 'button',132 });133 await driver.delay(regularDelayMs);134 });135 async function clickWordAndWait(word) {136 await driver.clickElement(137 `[data-testid="seed-phrase-sorted"] [data-testid="draggable-seed-${word}"]`,138 );139 await driver.delay(tinyDelayMs);140 }141 it('can retype the Secret Recovery Phrase', async function () {142 const words = seedPhrase.split(' ');143 for (const word of words) {144 await clickWordAndWait(word);145 }146 await driver.clickElement({ text: 'Confirm', tag: 'button' });147 await driver.delay(regularDelayMs);148 });149 it('clicks through the success screen', async function () {150 await driver.findElement({ text: 'Congratulations', tag: 'div' });151 await driver.clickElement({152 text: enLocaleMessages.endOfFlowMessage10.message,153 tag: 'button',154 });155 await driver.delay(regularDelayMs);156 });157 });158 describe('Import Secret Recovery Phrase', function () {159 it('logs out of the vault', async function () {160 await driver.clickElement('.account-menu__icon');161 await driver.delay(regularDelayMs);162 const lockButton = await driver.findClickableElement(163 '.account-menu__lock-button',164 );165 assert.equal(await lockButton.getText(), 'Lock');166 await lockButton.click();167 await driver.delay(regularDelayMs);168 });169 it('imports Secret Recovery Phrase', async function () {170 const restoreSeedLink = await driver.findClickableElement(171 '.unlock-page__link',172 );173 assert.equal(await restoreSeedLink.getText(), 'Forgot password?');174 await restoreSeedLink.click();175 await driver.delay(regularDelayMs);176 await driver.pasteIntoField(177 '[data-testid="import-srp__srp-word-0"]',178 testSeedPhrase,179 );180 await driver.fill('#password', 'correct horse battery staple');181 await driver.fill('#confirm-password', 'correct horse battery staple');182 await driver.clickElement({183 text: enLocaleMessages.restore.message,184 tag: 'button',185 });186 await driver.delay(regularDelayMs);187 });188 it('balance renders', async function () {189 await driver.waitForSelector({190 css: '[data-testid="wallet-balance"] .list-item__heading',191 text: '1000',192 });193 await driver.delay(regularDelayMs);194 });195 });196 describe('Add a custom token from a dapp', function () {197 let windowHandles;198 let extension;199 let popup;200 let dapp;201 it('connects the dapp', async function () {202 await driver.openNewPage('http://127.0.0.1:8080/');203 await driver.delay(regularDelayMs);204 await driver.clickElement({ text: 'Connect', tag: 'button' });205 await driver.delay(regularDelayMs);206 await driver.waitUntilXWindowHandles(3);207 windowHandles = await driver.getAllWindowHandles();208 extension = windowHandles[0];209 dapp = await driver.switchToWindowWithTitle(210 'E2E Test Dapp',211 windowHandles,212 );213 popup = windowHandles.find(214 (handle) => handle !== extension && handle !== dapp,215 );216 await driver.switchToWindow(popup);217 await driver.delay(regularDelayMs);218 await driver.clickElement({ text: 'Next', tag: 'button' });219 await driver.clickElement({ text: 'Connect', tag: 'button' });220 await driver.waitUntilXWindowHandles(2);221 await driver.switchToWindow(dapp);222 await driver.delay(regularDelayMs);223 });224 it('creates a new token', async function () {225 await driver.clickElement({ text: 'Create Token', tag: 'button' });226 windowHandles = await driver.waitUntilXWindowHandles(3);227 popup = windowHandles[2];228 await driver.switchToWindow(popup);229 await driver.delay(regularDelayMs);230 await driver.clickElement({ text: 'Edit', tag: 'button' });231 const inputs = await driver.findElements('input[type="number"]');232 const gasLimitInput = inputs[0];233 const gasPriceInput = inputs[1];234 await gasLimitInput.fill('4700000');235 await gasPriceInput.fill('20');236 await driver.delay(veryLargeDelayMs);237 await driver.clickElement({ text: 'Save', tag: 'button' });238 await driver.clickElement({ text: 'Confirm', tag: 'button' });239 await driver.delay(regularDelayMs);240 await driver.switchToWindow(dapp);241 await driver.delay(tinyDelayMs);242 const tokenContractAddress = await driver.waitForSelector({243 css: '#tokenAddress',244 text: '0x',245 });246 tokenAddress = await tokenContractAddress.getText();247 await driver.delay(regularDelayMs);248 await driver.closeAllWindowHandlesExcept([extension, dapp]);249 await driver.delay(regularDelayMs);250 await driver.switchToWindow(extension);251 await driver.delay(largeDelayMs);252 });253 it('clicks on the import tokens button', async function () {254 await driver.clickElement(`[data-testid="home__asset-tab"]`);255 await driver.clickElement({ text: 'import tokens', tag: 'a' });256 await driver.delay(regularDelayMs);257 });258 it('picks the newly created Test token', async function () {259 await driver.clickElement({260 text: 'Custom Token',261 tag: 'button',262 });263 await driver.delay(regularDelayMs);264 await driver.fill('#custom-address', tokenAddress);265 await driver.delay(regularDelayMs);266 await driver.clickElement({ text: 'Add Custom Token', tag: 'button' });267 await driver.delay(regularDelayMs);268 await driver.clickElement({ text: 'Import Tokens', tag: 'button' });269 await driver.delay(regularDelayMs);270 });271 it('renders the balance for the new token', async function () {272 await driver.waitForSelector({273 css: '.wallet-overview .token-overview__primary-balance',274 text: '10 TST',275 });276 await driver.delay(regularDelayMs);277 });278 });279 describe('Send token from inside MetaMask', function () {280 it('starts to send a transaction', async function () {281 await driver.clickElement('[data-testid="eth-overview-send"]');282 await driver.delay(regularDelayMs);283 await driver.fill(284 'input[placeholder="Search, public address (0x), or ENS"]',285 '0x2f318C334780961FB129D2a6c30D0763d9a5C970',286 );287 driver.fill('.unit-input__input', '1');288 });289 it('transitions to the confirm screen', async function () {290 // Continue to next screen291 await driver.delay(largeDelayMs);292 await driver.clickElement({ text: 'Next', tag: 'button' });293 await driver.delay(largeDelayMs);294 });295 it('displays the token transfer data', async function () {296 await driver.delay(largeDelayMs);297 await driver.clickElement({ text: 'Hex', tag: 'button' });298 await driver.delay(regularDelayMs);299 const functionType = await driver.findElement(300 '.confirm-page-container-content__function-type',301 );302 const functionTypeText = await functionType.getText();303 assert(functionTypeText.match('Transfer'));304 const tokenAmount = await driver.findElement(305 '.confirm-page-container-summary__title-text',306 );307 const tokenAmountText = await tokenAmount.getText();308 assert.equal(tokenAmountText, '1 TST');309 const confirmDataDiv = await driver.findElement(310 '.confirm-page-container-content__data-box',311 );312 const confirmDataText = await confirmDataDiv.getText();313 await driver.delay(regularDelayMs);314 assert(315 confirmDataText.match(316 /0xa9059cbb0000000000000000000000002f318c334780961fb129d2a6c30d0763d9a5c97/u,317 ),318 );319 await driver.clickElement({ text: 'Details', tag: 'button' });320 await driver.delay(regularDelayMs);321 });322 it('customizes gas', async function () {323 await driver.clickElement({ text: 'Edit', tag: 'button' });324 await driver.delay(largeDelayMs);325 const inputs = await driver.findElements('input[type="number"]');326 const gasLimitInput = inputs[0];327 const gasPriceInput = inputs[1];328 await gasLimitInput.fill('100000');329 await gasPriceInput.fill('100');330 await driver.delay(veryLargeDelayMs);331 await driver.clickElement({ text: 'Save', tag: 'button' });332 });333 it('submits the transaction', async function () {334 await driver.clickElement({ text: 'Confirm', tag: 'button' });335 await driver.delay(regularDelayMs);336 });337 it('finds the transaction in the transactions list', async function () {338 await driver.waitForSelector(339 {340 css:341 '.transaction-list__completed-transactions .transaction-list-item__primary-currency',342 text: '-1 TST',343 },344 { timeout: 10000 },345 );346 await driver.waitForSelector({347 css: '.list-item__heading',348 text: 'Send TST',349 });350 });351 });352 describe('Send a custom token from dapp', function () {353 it('sends an already created token', async function () {354 const windowHandles = await driver.getAllWindowHandles();355 const extension = windowHandles[0];356 const dapp = await driver.switchToWindowWithTitle(357 'E2E Test Dapp',358 windowHandles,359 );360 await driver.delay(regularDelayMs);361 await driver.switchToWindow(dapp);362 await driver.delay(tinyDelayMs);363 await driver.clickElement({ text: 'Transfer Tokens', tag: 'button' });364 await driver.switchToWindow(extension);365 await driver.delay(largeDelayMs);366 await driver.findElements('.transaction-list__pending-transactions');367 await driver.waitForSelector(368 {369 css: '.transaction-list-item__primary-currency',370 text: '-1.5 TST',371 },372 { timeout: 10000 },373 );374 await driver.clickElement('.transaction-list-item__primary-currency');375 await driver.delay(regularDelayMs);376 const transactionAmounts = await driver.findElements(377 '.currency-display-component__text',378 );379 const transactionAmount = transactionAmounts[0];380 assert(await transactionAmount.getText(), '1.5 TST');381 });382 it('customizes gas', async function () {383 await driver.delay(veryLargeDelayMs);384 await driver.clickElement({ text: 'Edit', tag: 'button' });385 await driver.delay(veryLargeDelayMs);386 await driver.clickElement(387 { text: 'Edit suggested gas fee', tag: 'button' },388 10000,389 );390 await driver.delay(veryLargeDelayMs);391 const inputs = await driver.findElements('input[type="number"]');392 const gasLimitInput = inputs[0];393 const gasPriceInput = inputs[1];394 await gasLimitInput.fill('60000');395 await gasPriceInput.fill('10');396 await driver.delay(veryLargeDelayMs);397 await driver.clickElement({ text: 'Save', tag: 'button' });398 await driver.findElement({ tag: 'span', text: '0.0006' });399 });400 it('submits the transaction', async function () {401 const tokenAmount = await driver.findElement(402 '.confirm-page-container-summary__title-text',403 );404 const tokenAmountText = await tokenAmount.getText();405 assert.equal(tokenAmountText, '1.5 TST');406 await driver.clickElement({ text: 'Confirm', tag: 'button' });407 await driver.delay(regularDelayMs);408 });409 it('finds the transaction in the transactions list', async function () {410 await driver.waitForSelector({411 css:412 '.transaction-list__completed-transactions .transaction-list-item__primary-currency',413 text: '-1.5 TST',414 });415 await driver.waitForSelector({416 css: '.list-item__heading',417 text: 'Send TST',418 });419 });420 it('checks balance', async function () {421 await driver.clickElement({422 text: 'Assets',423 tag: 'button',424 });425 await driver.waitForSelector({426 css: '.asset-list-item__token-button',427 text: '7.5 TST',428 });429 await driver.clickElement({430 text: 'Activity',431 tag: 'button',432 });433 });434 });435 describe('Approves a custom token from dapp', function () {436 it('approves an already created token', async function () {437 const windowHandles = await driver.getAllWindowHandles();438 const extension = windowHandles[0];439 const dapp = await driver.switchToWindowWithTitle(440 'E2E Test Dapp',441 windowHandles,442 );443 await driver.closeAllWindowHandlesExcept([extension, dapp]);444 await driver.delay(regularDelayMs);445 await driver.switchToWindow(dapp);446 await driver.delay(tinyDelayMs);447 await driver.clickElement({ text: 'Approve Tokens', tag: 'button' });448 await driver.switchToWindow(extension);449 await driver.delay(regularDelayMs);450 await driver.wait(async () => {451 const pendingTxes = await driver.findElements(452 '.transaction-list__pending-transactions .transaction-list-item',453 );454 return pendingTxes.length === 1;455 }, 10000);456 await driver.waitForSelector({457 // Selects only the very first transaction list item immediately following the 'Pending' header458 css:459 '.transaction-list__pending-transactions .transaction-list__header + .transaction-list-item .list-item__heading',460 text: 'Approve TST spend limit',461 });462 await driver.clickElement('.transaction-list-item');463 await driver.delay(regularDelayMs);464 });465 it('displays the token approval data', async function () {466 await driver.clickElement(467 '.confirm-approve-content__view-full-tx-button',468 );469 await driver.delay(regularDelayMs);470 const functionType = await driver.findElement(471 '.confirm-approve-content__data .confirm-approve-content__small-text',472 );473 const functionTypeText = await functionType.getText();474 assert.equal(functionTypeText, 'Function: Approve');475 const confirmDataDiv = await driver.findElement(476 '.confirm-approve-content__data__data-block',477 );478 const confirmDataText = await confirmDataDiv.getText();479 assert(480 confirmDataText.match(481 /0x095ea7b30000000000000000000000009bc5baf874d2da8d216ae9f137804184ee5afef4/u,482 ),483 );484 });485 it('customizes gas', async function () {486 await driver.clickElement('.confirm-approve-content__small-blue-text');487 await driver.delay(regularDelayMs);488 await driver.clickElement(489 { text: 'Edit suggested gas fee', tag: 'button' },490 10000,491 );492 await driver.delay(regularDelayMs);493 const [gasLimitInput, gasPriceInput] = await driver.findElements(494 'input[type="number"]',495 );496 await gasPriceInput.fill('10');497 await driver.delay(50);498 await gasLimitInput.fill('60001');499 await driver.delay(veryLargeDelayMs);500 await driver.clickElement({ text: 'Save', tag: 'button' });501 const gasFeeInEth = await driver.findElement(502 '.confirm-approve-content__transaction-details-content__secondary-fee',503 );504 assert.equal(await gasFeeInEth.getText(), '0.0006 ETH');505 });506 it('edits the permission', async function () {507 const editButtons = await driver.findClickableElements(508 '.confirm-approve-content__small-blue-text',509 );510 await editButtons[2].click();511 // wait for permission modal to be visible512 const permissionModal = await driver.findVisibleElement('span .modal');513 const radioButtons = await driver.findClickableElements(514 '.edit-approval-permission__edit-section__radio-button',515 );516 await radioButtons[1].click();517 await driver.fill('input', '5');518 await driver.delay(regularDelayMs);519 await driver.clickElement({ text: 'Save', tag: 'button' });520 // wait for permission modal to be removed from DOM.521 await permissionModal.waitForElementState('hidden');522 const permissionInfo = await driver.findElements(523 '.confirm-approve-content__medium-text',524 );525 const amountDiv = permissionInfo[0];526 assert.equal(await amountDiv.getText(), '5 TST');527 });528 it('submits the transaction', async function () {529 await driver.clickElement({ text: 'Confirm', tag: 'button' });530 await driver.delay(regularDelayMs);531 });532 it('finds the transaction in the transactions list', async function () {533 await driver.waitForSelector({534 // Select only the heading of the first entry in the transaction list.535 css:536 '.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading',537 text: 'Approve TST spend limit',538 });539 });540 });541 describe('Transfers a custom token from dapp when no gas value is specified', function () {542 it('transfers an already created token, without specifying gas', async function () {543 const windowHandles = await driver.getAllWindowHandles();544 const extension = windowHandles[0];545 const dapp = await driver.switchToWindowWithTitle(546 'E2E Test Dapp',547 windowHandles,548 );549 await driver.closeAllWindowHandlesExcept([extension, dapp]);550 await driver.delay(regularDelayMs);551 await driver.switchToWindow(dapp);552 await driver.clickElement({553 text: 'Transfer Tokens Without Gas',554 tag: 'button',555 });556 await driver.switchToWindow(extension);557 await driver.delay(regularDelayMs);558 await driver.wait(async () => {559 const pendingTxes = await driver.findElements(560 '.transaction-list__pending-transactions .transaction-list-item',561 );562 return pendingTxes.length === 1;563 }, 10000);564 await driver.waitForSelector({565 css: '.transaction-list-item__primary-currency',566 text: '-1.5 TST',567 });568 await driver.clickElement('.transaction-list-item');569 await driver.delay(regularDelayMs);570 });571 it('submits the transaction', async function () {572 await driver.delay(largeDelayMs * 2);573 await driver.clickElement({ text: 'Confirm', tag: 'button' });574 await driver.delay(largeDelayMs * 2);575 });576 it('finds the transaction in the transactions list', async function () {577 await driver.waitForSelector({578 // Select the heading of the first transaction list item in the579 // completed transaction list with text matching Send TST580 css:581 '.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading',582 text: 'Send TST',583 });584 await driver.waitForSelector({585 css:586 '.transaction-list__completed-transactions .transaction-list-item:first-child .transaction-list-item__primary-currency',587 text: '-1.5 TST',588 });589 });590 });591 describe('Approves a custom token from dapp when no gas value is specified', function () {592 it('approves an already created token', async function () {593 const windowHandles = await driver.getAllWindowHandles();594 const extension = windowHandles[0];595 const dapp = await driver.switchToWindowWithTitle(596 'E2E Test Dapp',597 windowHandles,598 );599 await driver.closeAllWindowHandlesExcept([extension, dapp]);600 await driver.delay(regularDelayMs);601 await driver.switchToWindow(dapp);602 await driver.delay(tinyDelayMs);603 await driver.clickElement({604 text: 'Approve Tokens Without Gas',605 tag: 'button',606 });607 await driver.switchToWindow(extension);608 await driver.delay(regularDelayMs);609 await driver.wait(async () => {610 const pendingTxes = await driver.findElements(611 '.transaction-list__pending-transactions .transaction-list-item',612 );613 return pendingTxes.length === 1;614 }, 10000);615 await driver.waitForSelector({616 // Selects only the very first transaction list item immediately following the 'Pending' header617 css:618 '.transaction-list__pending-transactions .transaction-list__header + .transaction-list-item .list-item__heading',619 text: 'Approve TST spend limit',620 });621 await driver.clickElement('.transaction-list-item');622 await driver.delay(regularDelayMs);623 });624 it('shows the correct recipient', async function () {625 await driver.clickElement(626 '.confirm-approve-content__view-full-tx-button',627 );628 await driver.delay(regularDelayMs);629 const permissionInfo = await driver.findElements(630 '.confirm-approve-content__medium-text',631 );632 const recipientDiv = permissionInfo[1];633 assert.equal(await recipientDiv.getText(), '0x2f318C33...C970');634 });635 it('submits the transaction', async function () {636 await driver.delay(veryLargeDelayMs);637 await driver.clickElement({ text: 'Confirm', tag: 'button' });638 await driver.delay(regularDelayMs);639 });640 it('finds the transaction in the transactions list', async function () {641 await driver.waitForSelector({642 css:643 '.transaction-list__completed-transactions .transaction-list-item:first-child .list-item__heading',644 text: 'Approve TST spend limit',645 });646 });647 });...

Full Screen

Full Screen

from-import-ui.spec.js

Source:from-import-ui.spec.js Github

copy

Full Screen

1const { strict: assert } = require('assert');2const {3 convertToHexValue,4 withFixtures,5 regularDelayMs,6 largeDelayMs,7 completeImportSRPOnboardingFlow,8} = require('../helpers');9describe('Metamask Import UI', function () {10 it('Importing wallet using Secret Recovery Phrase', async function () {11 const ganacheOptions = {12 accounts: [13 {14 secretKey:15 '0x53CB0AB5226EEBF4D872113D98332C1555DC304443BEE1CF759D15798D3C55A9',16 balance: convertToHexValue(25000000000000000000),17 },18 ],19 };20 const testSeedPhrase =21 'forum vessel pink push lonely enact gentle tail admit parrot grunt dress';22 const testPassword = 'correct horse battery staple';23 const testAddress = '0x0Cc5261AB8cE458dc977078A3623E2BaDD27afD3';24 await withFixtures(25 {26 fixtures: 'onboarding',27 ganacheOptions,28 title: this.test.title,29 failOnConsoleError: false,30 },31 async ({ driver }) => {32 await driver.navigate();33 await completeImportSRPOnboardingFlow(34 driver,35 testSeedPhrase,36 testPassword,37 );38 // Show account information39 await driver.clickElement(40 '[data-testid="account-options-menu-button"]',41 );42 await driver.clickElement(43 '[data-testid="account-options-menu__account-details"]',44 );45 await driver.findVisibleElement('.qr-code__wrapper');46 // shows a QR code for the account47 const detailsModal = await driver.findVisibleElement('span .modal');48 // shows the correct account address49 const address = await driver.findElement('.qr-code__address');50 assert.equal(await address.getText(), testAddress);51 await driver.clickElement('.account-modal__close');52 await detailsModal.waitForElementState('hidden');53 // logs out of the account54 await driver.clickElement('.account-menu__icon .identicon');55 const lockButton = await driver.findClickableElement(56 '.account-menu__lock-button',57 );58 assert.equal(await lockButton.getText(), 'Lock');59 await lockButton.click();60 // accepts the account password after lock61 await driver.fill('#password', 'correct horse battery staple');62 await driver.press('#password', driver.Key.ENTER);63 // Create a new account64 // switches to locakhost65 await driver.clickElement('.network-display');66 await driver.clickElement({ text: 'Localhost', tag: 'span' });67 // choose Create Account from the account menu68 await driver.clickElement('.account-menu__icon');69 await driver.clickElement({ text: 'Create Account', tag: 'div' });70 // set account name71 await driver.fill('.new-account-create-form input', '2nd account');72 await driver.delay(regularDelayMs);73 await driver.clickElement({ text: 'Create', tag: 'button' });74 // should show the correct account name75 const accountName = await driver.findElement('.selected-account__name');76 assert.equal(await accountName.getText(), '2nd account');77 // Switch back to original account78 // chooses the original account from the account menu79 await driver.clickElement('.account-menu__icon');80 await driver.clickElement('.account-menu__name');81 // Send ETH from inside MetaMask82 // starts a send transaction83 await driver.clickElement('[data-testid="eth-overview-send"]');84 await driver.fill(85 'input[placeholder="Search, public address (0x), or ENS"]',86 '0x2f318C334780961FB129D2a6c30D0763d9a5C970',87 );88 await driver.fill('.unit-input__input', '1');89 // Continue to next screen90 await driver.clickElement({ text: 'Next', tag: 'button' });91 // confirms the transaction92 await driver.clickElement({ text: 'Confirm', tag: 'button' });93 // finds the transaction in the transactions list94 await driver.clickElement('[data-testid="home__activity-tab"]');95 await driver.wait(async () => {96 const confirmedTxes = await driver.findElements(97 '.transaction-list__completed-transactions .transaction-list-item',98 );99 return confirmedTxes.length === 1;100 }, 10000);101 const txValues = await driver.findElements(102 '.transaction-list-item__primary-currency',103 );104 assert.equal(txValues.length, 1);105 assert.ok(/-1\s*ETH/u.test(await txValues[0].getText()));106 },107 );108 });109 it('Import Account using private key', async function () {110 const ganacheOptions = {111 accounts: [112 {113 secretKey:114 '0x53CB0AB5226EEBF4D872113D98332C1555DC304443BEE1CF759D15798D3C55A9',115 balance: convertToHexValue(25000000000000000000),116 },117 ],118 };119 const testPrivateKey1 =120 '14abe6f4aab7f9f626fe981c864d0adeb5685f289ac9270c27b8fd790b4235d6';121 const testPrivateKey2 =122 'F4EC2590A0C10DE95FBF4547845178910E40F5035320C516A18C117DE02B5669';123 await withFixtures(124 {125 fixtures: 'import-ui',126 ganacheOptions,127 title: this.test.title,128 },129 async ({ driver }) => {130 await driver.navigate();131 await driver.fill('#password', 'correct horse battery staple');132 await driver.press('#password', driver.Key.ENTER);133 // Imports an account with private key134 // choose Create Account from the account menu135 await driver.clickElement('.account-menu__icon');136 await driver.clickElement({ text: 'Import Account', tag: 'div' });137 // enter private key',138 await driver.fill('#private-key-box', testPrivateKey1);139 await driver.clickElement({ text: 'Import', tag: 'button' });140 // should show the correct account name141 const importedAccountName = await driver.findElement(142 '.selected-account__name',143 );144 assert.equal(await importedAccountName.getText(), 'Account 4');145 // should show the imported label146 await driver.clickElement('.account-menu__icon');147 // confirm 4th account is account 4, as expected148 const accountMenuItemSelector = '.account-menu__account:nth-child(4)';149 const fourthAccountName = await driver.findElement(150 `${accountMenuItemSelector} .account-menu__name`,151 );152 assert.equal(await fourthAccountName.getText(), 'Account 4');153 // confirm label is present on the same menu item154 const importedLabel = await driver.findElement(155 `${accountMenuItemSelector} .keyring-label`,156 );157 assert.equal(await importedLabel.getText(), 'IMPORTED');158 // Imports and removes an account159 // choose Create Account from the account menu160 await driver.clickElement({ text: 'Import Account', tag: 'div' });161 // enter private key162 await driver.fill('#private-key-box', testPrivateKey2);163 await driver.clickElement({ text: 'Import', tag: 'button' });164 // should see new account in account menu165 const importedAccount2Name = await driver.findElement(166 '.selected-account__name',167 );168 assert.equal(await importedAccount2Name.getText(), 'Account 5');169 await driver.clickElement('.account-menu__icon');170 const accountListItems = await driver.findElements(171 '.account-menu__account',172 );173 assert.equal(accountListItems.length, 5);174 await driver.clickPoint('.account-menu__icon', 0, 0);175 // should open the remove account modal176 await driver.clickElement(177 '[data-testid="account-options-menu-button"]',178 );179 await driver.clickElement(180 '[data-testid="account-options-menu__remove-account"]',181 );182 await driver.findElement('.confirm-remove-account__account');183 // should remove the account184 await driver.clickElement({ text: 'Remove', tag: 'button' });185 // Wait until selected account switches away from removed account to first account186 await driver.waitForSelector(187 {188 css: '.selected-account__name',189 text: 'Account 1',190 },191 { timeout: 10000 },192 );193 await driver.delay(regularDelayMs);194 await driver.clickElement('.account-menu__icon');195 const accountListItemsAfterRemoval = await driver.findElements(196 '.account-menu__account',197 );198 assert.equal(accountListItemsAfterRemoval.length, 4);199 },200 );201 });202 it('Import Account using private key of an already active account should result in an error', async function () {203 const testPrivateKey =204 '0x53CB0AB5226EEBF4D872113D98332C1555DC304443BEE1CF759D15798D3C55A9';205 const ganacheOptions = {206 accounts: [207 {208 secretKey: testPrivateKey,209 balance: convertToHexValue(25000000000000000000),210 },211 ],212 };213 await withFixtures(214 {215 fixtures: 'import-ui',216 ganacheOptions,217 title: this.test.title,218 },219 async ({ driver }) => {220 await driver.navigate();221 await driver.fill('#password', 'correct horse battery staple');222 await driver.press('#password', driver.Key.ENTER);223 // choose Import Account from the account menu224 await driver.clickElement('.account-menu__icon');225 await driver.clickElement({ text: 'Import Account', tag: 'div' });226 // enter private key',227 await driver.fill('#private-key-box', testPrivateKey);228 await driver.clickElement({ text: 'Import', tag: 'button' });229 // error should occur230 await driver.waitForSelector({231 css: '.error',232 text: "The account you're are trying to import is a duplicate",233 });234 },235 );236 });237 it('Connects to a Hardware wallet', async function () {238 const ganacheOptions = {239 accounts: [240 {241 secretKey:242 '0x53CB0AB5226EEBF4D872113D98332C1555DC304443BEE1CF759D15798D3C55A9',243 balance: convertToHexValue(25000000000000000000),244 },245 ],246 };247 await withFixtures(248 {249 fixtures: 'import-ui',250 ganacheOptions,251 title: this.test.title,252 },253 async ({ driver }) => {254 await driver.navigate();255 await driver.fill('#password', 'correct horse battery staple');256 await driver.press('#password', driver.Key.ENTER);257 // choose Connect Hardware Wallet from the account menu258 await driver.clickElement('.account-menu__icon');259 await driver.clickElement({260 text: 'Connect Hardware Wallet',261 tag: 'div',262 });263 await driver.delay(regularDelayMs);264 // should open the TREZOR Connect popup265 await driver.clickElement('.hw-connect__btn:nth-of-type(2)');266 await driver.delay(largeDelayMs * 2);267 await driver.clickElement({ text: 'Continue', tag: 'button' });268 await driver.waitUntilXWindowHandles(2);269 const allWindows = await driver.getAllWindowHandles();270 assert.equal(allWindows.length, 2);271 },272 );273 });...

Full Screen

Full Screen

send-eth.spec.js

Source:send-eth.spec.js Github

copy

Full Screen

1const { strict: assert } = require('assert');2const {3 convertToHexValue,4 withFixtures,5 regularDelayMs,6} = require('../helpers');7describe('Send ETH from inside MetaMask using default gas', function () {8 const ganacheOptions = {9 accounts: [10 {11 secretKey:12 '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC',13 balance: convertToHexValue(25000000000000000000),14 },15 ],16 };17 it('finds the transaction in the transactions list', async function () {18 await withFixtures(19 {20 fixtures: 'imported-account',21 ganacheOptions,22 title: this.test.title,23 },24 async ({ driver }) => {25 await driver.navigate();26 await driver.fill('#password', 'correct horse battery staple');27 await driver.press('#password', driver.Key.ENTER);28 await driver.clickElement('[data-testid="eth-overview-send"]');29 await driver.fill(30 'input[placeholder="Search, public address (0x), or ENS"]',31 '0x2f318C334780961FB129D2a6c30D0763d9a5C970',32 );33 const inputAmount = await driver.findElement('.unit-input__input');34 await inputAmount.fill('1000');35 const errorAmount = await driver.findElement('.send-v2__error-amount');36 assert.equal(37 await errorAmount.getText(),38 'Insufficient funds.',39 'send screen should render an insufficient fund error message',40 );41 await inputAmount.press(driver.Key.BACK_SPACE);42 await inputAmount.press(driver.Key.BACK_SPACE);43 await inputAmount.press(driver.Key.BACK_SPACE);44 await driver.delay(regularDelayMs);45 await driver.assertElementNotPresent('.send-v2__error-amount');46 const amountMax = await driver.findClickableElement(47 '.send-v2__amount-max',48 );49 await amountMax.click();50 let inputValue = await inputAmount.getProperty('value');51 assert(Number(inputValue) > 24);52 await amountMax.click();53 assert.equal(await inputAmount.isEnabled(), true);54 await inputAmount.fill('1');55 inputValue = await inputAmount.getProperty('value');56 assert.equal(inputValue, '1');57 // Continue to next screen58 await driver.clickElement({ text: 'Next', tag: 'button' });59 await driver.clickElement({ text: 'Confirm', tag: 'button' });60 await driver.clickElement('[data-testid="home__activity-tab"]');61 await driver.wait(async () => {62 const confirmedTxes = await driver.findElements(63 '.transaction-list__completed-transactions .transaction-list-item',64 );65 return confirmedTxes.length === 1;66 }, 10000);67 await driver.waitForSelector({68 css: '.transaction-list-item__primary-currency',69 text: '-1 ETH',70 });71 },72 );73 });74});75/* eslint-disable-next-line mocha/max-top-level-suites */76describe('Send ETH from inside MetaMask using advanced gas modal', function () {77 const ganacheOptions = {78 accounts: [79 {80 secretKey:81 '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC',82 balance: convertToHexValue(25000000000000000000),83 },84 ],85 };86 it('finds the transaction in the transactions list', async function () {87 await withFixtures(88 {89 fixtures: 'imported-account',90 ganacheOptions,91 title: this.test.title,92 },93 async ({ driver }) => {94 await driver.navigate();95 await driver.fill('#password', 'correct horse battery staple');96 await driver.press('#password', driver.Key.ENTER);97 await driver.clickElement('[data-testid="eth-overview-send"]');98 await driver.fill(99 'input[placeholder="Search, public address (0x), or ENS"]',100 '0x2f318C334780961FB129D2a6c30D0763d9a5C970',101 );102 const inputAmount = await driver.findElement('.unit-input__input');103 await inputAmount.fill('1');104 const inputValue = await inputAmount.getProperty('value');105 assert.equal(inputValue, '1');106 // Continue to next screen107 await driver.clickElement({ text: 'Next', tag: 'button' });108 const transactionAmounts = await driver.findElements(109 '.currency-display-component__text',110 );111 const transactionAmount = transactionAmounts[0];112 assert.equal(await transactionAmount.getText(), '1');113 await driver.clickElement({ text: 'Confirm', tag: 'button' });114 await driver.wait(async () => {115 const confirmedTxes = await driver.findElements(116 '.transaction-list__completed-transactions .transaction-list-item',117 );118 return confirmedTxes.length === 1;119 }, 10000);120 await driver.waitForSelector(121 {122 css: '.transaction-list-item__primary-currency',123 text: '-1 ETH',124 },125 { timeout: 10000 },126 );127 },128 );129 });130});131describe('Send ETH from dapp using advanced gas controls', function () {132 let windowHandles;133 let extension;134 let popup;135 let dapp;136 const ganacheOptions = {137 accounts: [138 {139 secretKey:140 '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC',141 balance: convertToHexValue(25000000000000000000),142 },143 ],144 };145 it('should display the correct gas price on the transaction', async function () {146 await withFixtures(147 {148 dapp: true,149 fixtures: 'imported-account',150 ganacheOptions,151 title: this.test.title,152 },153 async ({ driver }) => {154 await driver.navigate();155 await driver.fill('#password', 'correct horse battery staple');156 await driver.press('#password', driver.Key.ENTER);157 // goes to the settings screen158 await driver.clickElement('.account-menu__icon');159 await driver.clickElement({ text: 'Settings', tag: 'div' });160 await driver.clickElement({ text: 'Advanced', tag: 'div' });161 await driver.clickElement(162 '[data-testid="advanced-setting-show-testnet-conversion"] .settings-page__content-item-col > div > div',163 );164 const advancedGasTitle = await driver.findElement({165 text: 'Advanced gas controls',166 tag: 'span',167 });168 await driver.scrollToElement(advancedGasTitle);169 await driver.clickElement(170 '[data-testid="advanced-setting-advanced-gas-inline"] .settings-page__content-item-col > div > div',171 );172 windowHandles = await driver.getAllWindowHandles();173 extension = windowHandles[0];174 await driver.closeAllWindowHandlesExcept([extension]);175 await driver.clickElement('.app-header__logo-container');176 // connects the dapp177 await driver.openNewPage('http://127.0.0.1:8080/');178 await driver.clickElement({ text: 'Connect', tag: 'button' });179 await driver.waitUntilXWindowHandles(3);180 windowHandles = await driver.getAllWindowHandles();181 extension = windowHandles[0];182 dapp = await driver.switchToWindowWithTitle(183 'E2E Test Dapp',184 windowHandles,185 );186 popup = windowHandles.find(187 (handle) => handle !== extension && handle !== dapp,188 );189 await driver.switchToWindow(popup);190 await driver.clickElement({ text: 'Next', tag: 'button' });191 await driver.clickElement({ text: 'Connect', tag: 'button' });192 await driver.waitUntilXWindowHandles(2);193 await driver.switchToWindow(dapp);194 // initiates a send from the dapp195 await driver.clickElement({ text: 'Send', tag: 'button' });196 await driver.delay(2000);197 windowHandles = await driver.getAllWindowHandles();198 await driver.switchToWindowWithTitle(199 'MetaMask Notification',200 windowHandles,201 );202 await driver.assertElementNotPresent({ text: 'Data', tag: 'li' });203 await driver.clickElement({ text: 'Edit', tag: 'button' });204 await driver.delay(1000);205 await driver.clickElement(206 { text: 'Edit suggested gas fee', tag: 'button' },207 10000,208 );209 await driver.delay(1000);210 const inputs = await driver.findElements('input[type="number"]');211 const gasPriceInput = inputs[1];212 await gasPriceInput.fill('100');213 await driver.delay(1000);214 await driver.clickElement({ text: 'Save', tag: 'button' });215 await driver.clickElement({ text: 'Confirm', tag: 'button' });216 await driver.waitUntilXWindowHandles(2);217 await driver.switchToWindow(extension);218 // finds the transaction in the transactions list219 await driver.clickElement('[data-testid="home__activity-tab"]');220 await driver.waitForSelector(221 '.transaction-list__completed-transactions .transaction-list-item:nth-of-type(1)',222 { timeout: 10000 },223 );224 await driver.waitForSelector({225 css: '.transaction-list-item__primary-currency',226 text: '-0 ETH',227 });228 // the transaction has the expected gas price229 const txValue = await driver.findClickableElement(230 '.transaction-list-item__primary-currency',231 );232 await txValue.click();233 const gasPrice = await driver.waitForSelector({234 css: '[data-testid="transaction-breakdown__gas-price"]',235 text: '100',236 });237 assert.equal(await gasPrice.getText(), '100');238 },239 );240 });...

Full Screen

Full Screen

add-account.spec.js

Source:add-account.spec.js Github

copy

Full Screen

1const { strict: assert } = require('assert');2const {3 convertToHexValue,4 withFixtures,5 regularDelayMs,6 completeImportSRPOnboardingFlow,7} = require('../helpers');8const enLocaleMessages = require('../../../app/_locales/en/messages.json');9describe('Add account', function () {10 const testSeedPhrase =11 'forum vessel pink push lonely enact gentle tail admit parrot grunt dress';12 const testPassword = 'correct horse battery staple';13 const ganacheOptions = {14 accounts: [15 {16 secretKey:17 '0x53CB0AB5226EEBF4D872113D98332C1555DC304443BEE1CF759D15798D3C55A9',18 balance: convertToHexValue(25000000000000000000),19 },20 ],21 };22 it('should display correct new account name after create', async function () {23 await withFixtures(24 {25 fixtures: 'imported-account',26 ganacheOptions,27 title: this.test.title,28 },29 async ({ driver }) => {30 await driver.navigate();31 await driver.fill('#password', 'correct horse battery staple');32 await driver.press('#password', driver.Key.ENTER);33 await driver.clickElement('.account-menu__icon');34 await driver.clickElement({ text: 'Create Account', tag: 'div' });35 await driver.fill('.new-account-create-form input', '2nd account');36 await driver.clickElement({ text: 'Create', tag: 'button' });37 const accountName = await driver.waitForSelector({38 css: '.selected-account__name',39 text: '2nd',40 });41 assert.equal(await accountName.getText(), '2nd account');42 },43 );44 });45 it('should add the same account addresses when a secret recovery phrase is imported, the account is locked, and the same secret recovery phrase is imported again', async function () {46 await withFixtures(47 {48 fixtures: 'onboarding',49 ganacheOptions,50 title: this.test.title,51 failOnConsoleError: false,52 },53 async ({ driver }) => {54 await driver.navigate();55 await completeImportSRPOnboardingFlow(56 driver,57 testSeedPhrase,58 testPassword,59 );60 await driver.clickElement('.account-menu__icon');61 await driver.clickElement({ text: 'Create Account', tag: 'div' });62 await driver.fill('.new-account-create-form input', '2nd account');63 await driver.clickElement({ text: 'Create', tag: 'button' });64 await driver.clickElement(65 '[data-testid="account-options-menu-button"]',66 );67 await driver.clickElement(68 '[data-testid="account-options-menu__account-details"]',69 );70 const detailsModal = await driver.findVisibleElement('span .modal');71 // get the public address for the "second account"72 await driver.waitForSelector('.qr-code__address');73 const secondAccountAddress = await driver.findElement(74 '.qr-code__address',75 );76 const secondAccountPublicAddress = await secondAccountAddress.getText();77 await driver.clickElement('.account-modal__close');78 await detailsModal.waitForElementState('hidden');79 // generate a third accound80 await driver.clickElement('.account-menu__icon');81 await driver.clickElement({ text: 'Create Account', tag: 'div' });82 await driver.fill('.new-account-create-form input', '3rd account');83 await driver.clickElement({ text: 'Create', tag: 'button' });84 await driver.clickElement(85 '[data-testid="account-options-menu-button"]',86 );87 await driver.clickElement(88 '[data-testid="account-options-menu__account-details"]',89 );90 // get the public address for the "third account"91 const secondDetailsModal = await driver.findVisibleElement(92 'span .modal',93 );94 await driver.waitForSelector('.qr-code__address');95 const thirdAccountAddress = await driver.findElement(96 '.qr-code__address',97 );98 const thirdAccountPublicAddress = await thirdAccountAddress.getText();99 await driver.clickElement('.account-modal__close');100 await secondDetailsModal.waitForElementState('hidden');101 // lock account102 await driver.clickElement('.account-menu__icon');103 await driver.delay(regularDelayMs);104 const lockButton = await driver.findClickableElement(105 '.account-menu__lock-button',106 );107 await lockButton.click();108 await driver.delay(regularDelayMs);109 // restore same seed phrase110 const restoreSeedLink = await driver.findClickableElement(111 '.unlock-page__link',112 );113 await restoreSeedLink.click();114 await driver.delay(regularDelayMs);115 await driver.pasteIntoField(116 '[data-testid="import-srp__srp-word-0"]',117 testSeedPhrase,118 );119 await driver.delay(regularDelayMs);120 await driver.fill('#password', 'correct horse battery staple');121 await driver.fill('#confirm-password', 'correct horse battery staple');122 await driver.clickElement({123 text: enLocaleMessages.restore.message,124 tag: 'button',125 });126 await driver.delay(regularDelayMs);127 // recreate a "2nd account"128 await driver.clickElement('.account-menu__icon');129 await driver.clickElement({ text: 'Create Account', tag: 'div' });130 await driver.fill('.new-account-create-form input', '2nd account');131 await driver.clickElement({ text: 'Create', tag: 'button' });132 await driver.clickElement(133 '[data-testid="account-options-menu-button"]',134 );135 await driver.clickElement(136 '[data-testid="account-options-menu__account-details"]',137 );138 const thirdDetailsModal = await driver.findVisibleElement(139 'span .modal',140 );141 // get the public address for the "second account"142 await driver.waitForSelector('.qr-code__address');143 const recreatedSecondAccountAddress = await driver.findElement(144 '.qr-code__address',145 );146 assert.equal(147 await recreatedSecondAccountAddress.getText(),148 secondAccountPublicAddress,149 );150 await driver.clickElement('.account-modal__close');151 await thirdDetailsModal.waitForElementState('hidden');152 // re-generate a third accound153 await driver.clickElement('.account-menu__icon');154 await driver.clickElement({ text: 'Create Account', tag: 'div' });155 await driver.fill('.new-account-create-form input', '3rd account');156 await driver.clickElement({ text: 'Create', tag: 'button' });157 await driver.clickElement(158 '[data-testid="account-options-menu-button"]',159 );160 await driver.clickElement(161 '[data-testid="account-options-menu__account-details"]',162 );163 // get the public address for the "third account"164 await driver.waitForSelector('.qr-code__address');165 const recreatedThirdAccountAddress = await driver.findElement(166 '.qr-code__address',167 );168 assert.strictEqual(169 await recreatedThirdAccountAddress.getText(),170 thirdAccountPublicAddress,171 );172 },173 );174 });175 it('It should be possible to remove an account imported with a private key, but should not be possible to remove an account generated from the SRP imported in onboarding', async function () {176 const testPrivateKey =177 '14abe6f4aab7f9f626fe981c864d0adeb5685f289ac9270c27b8fd790b4235d6';178 await withFixtures(179 {180 fixtures: 'imported-account',181 ganacheOptions,182 title: this.test.title,183 },184 async ({ driver }) => {185 await driver.navigate();186 await driver.fill('#password', 'correct horse battery staple');187 await driver.press('#password', driver.Key.ENTER);188 await driver.delay(regularDelayMs);189 await driver.clickElement('.account-menu__icon');190 await driver.clickElement({ text: 'Create Account', tag: 'div' });191 await driver.fill('.new-account-create-form input', '2nd account');192 await driver.clickElement({ text: 'Create', tag: 'button' });193 await driver.clickElement(194 '[data-testid="account-options-menu-button"]',195 );196 const menuItems = await driver.findElements('.menu-item');197 assert.equal(menuItems.length, 3);198 // click out of menu199 await driver.clickElement('.menu__background');200 // import with private key201 await driver.clickElement('.account-menu__icon');202 await driver.clickElement({ text: 'Import Account', tag: 'div' });203 // enter private key',204 await driver.fill('#private-key-box', testPrivateKey);205 await driver.clickElement({ text: 'Import', tag: 'button' });206 // should show the correct account name207 const importedAccountName = await driver.findElement(208 '.selected-account__name',209 );210 assert.equal(await importedAccountName.getText(), 'Account 3');211 await driver.clickElement(212 '[data-testid="account-options-menu-button"]',213 );214 const menuItems2 = await driver.findElements('.menu-item');215 assert.equal(menuItems2.length, 4);216 await driver.findElement(217 '[data-testid="account-options-menu__remove-account"]',218 );219 },220 );221 });...

Full Screen

Full Screen

metamask-responsive-ui.spec.js

Source:metamask-responsive-ui.spec.js Github

copy

Full Screen

1const { strict: assert } = require('assert');2const { convertToHexValue, withFixtures, tinyDelayMs } = require('../helpers');3const enLocaleMessages = require('../../../app/_locales/en/messages.json');4describe('Metamask Responsive UI', function () {5 it('Creating a new wallet', async function () {6 const driverOptions = { responsive: true };7 await withFixtures(8 {9 fixtures: 'onboarding',10 driverOptions,11 title: this.test.title,12 failOnConsoleError: false,13 },14 async ({ driver }) => {15 await driver.navigate();16 async function clickWordAndWait(word) {17 await driver.clickElement(18 `[data-testid="seed-phrase-sorted"] [data-testid="draggable-seed-${word}"]`,19 );20 await driver.delay(tinyDelayMs);21 }22 if (process.env.ONBOARDING_V2 === '1') {23 // welcome24 await driver.clickElement('[data-testid="onboarding-create-wallet"]');25 // metrics26 await driver.clickElement('[data-testid="metametrics-no-thanks"]');27 // create password28 await driver.fill(29 '[data-testid="create-password-new"]',30 'correct horse battery staple',31 );32 await driver.fill(33 '[data-testid="create-password-confirm"]',34 'correct horse battery staple',35 );36 await driver.clickElement('[data-testid="create-password-terms"]');37 await driver.clickElement('[data-testid="create-password-wallet"]');38 // secure wallet39 await driver.clickElement(40 '[data-testid="secure-wallet-recommended"]',41 );42 // review43 await driver.clickElement('[data-testid="recovery-phrase-reveal"]');44 const chipTwo = await (45 await driver.findElement('[data-testid="recovery-phrase-chip-2"]')46 ).getText();47 const chipThree = await (48 await driver.findElement('[data-testid="recovery-phrase-chip-3"]')49 ).getText();50 const chipSeven = await (51 await driver.findElement('[data-testid="recovery-phrase-chip-7"]')52 ).getText();53 await driver.clickElement('[data-testid="recovery-phrase-next"]');54 // confirm55 await driver.fill('[data-testid="recovery-phrase-input-2"]', chipTwo);56 await driver.fill(57 '[data-testid="recovery-phrase-input-3"]',58 chipThree,59 );60 await driver.fill(61 '[data-testid="recovery-phrase-input-7"]',62 chipSeven,63 );64 await driver.clickElement('[data-testid="recovery-phrase-confirm"]');65 // complete66 await driver.clickElement('[data-testid="onboarding-complete-done"]');67 // pin extension68 await driver.clickElement('[data-testid="pin-extension-next"]');69 await driver.clickElement('[data-testid="pin-extension-done"]');70 } else {71 // clicks the continue button on the welcome screen72 await driver.findElement('.welcome-page__header');73 await driver.clickElement({74 text: enLocaleMessages.getStarted.message,75 tag: 'button',76 });77 await driver.delay(tinyDelayMs);78 // clicks the "Create New Wallet" option79 await driver.clickElement({ text: 'Create a Wallet', tag: 'button' });80 // clicks the "I Agree" option on the metametrics opt-in screen81 await driver.clickElement('.btn-primary');82 // accepts a secure password83 await driver.fill(84 '.first-time-flow__form #create-password',85 'correct horse battery staple',86 );87 await driver.fill(88 '.first-time-flow__form #confirm-password',89 'correct horse battery staple',90 );91 await driver.clickElement('.first-time-flow__checkbox');92 await driver.clickElement('.first-time-flow__form button');93 // renders the Secret Recovery Phrase intro screen94 await driver.clickElement('.seed-phrase-intro__left button');95 // reveals the Secret Recovery Phrase96 await driver.clickElement(97 '.reveal-seed-phrase__secret-blocker .reveal-seed-phrase__reveal-button',98 );99 const revealedSeedPhrase = await driver.findElement(100 '.reveal-seed-phrase__secret-words',101 );102 const seedPhrase = await revealedSeedPhrase.getText();103 assert.equal(seedPhrase.split(' ').length, 12);104 await driver.clickElement({105 text: enLocaleMessages.next.message,106 tag: 'button',107 });108 // can retype the Secret Recovery Phrase109 const words = seedPhrase.split(' ');110 for (const word of words) {111 await clickWordAndWait(word);112 }113 await driver.clickElement({ text: 'Confirm', tag: 'button' });114 // clicks through the success screen115 await driver.findElement({ text: 'Congratulations', tag: 'div' });116 await driver.clickElement({117 text: enLocaleMessages.endOfFlowMessage10.message,118 tag: 'button',119 });120 }121 // assert balance122 const balance = await driver.findElement(123 '[data-testid="wallet-balance"]',124 );125 assert.ok(/^0\sETH$/u.test(await balance.getText()));126 },127 );128 });129 it('Importing existing wallet from lock page', async function () {130 const driverOptions = { responsive: true };131 const testSeedPhrase =132 'phrase upgrade clock rough situate wedding elder clever doctor stamp excess tent';133 await withFixtures(134 {135 fixtures: 'imported-account',136 driverOptions,137 title: this.test.title,138 failOnConsoleError: false,139 },140 async ({ driver }) => {141 await driver.navigate();142 // Import Secret Recovery Phrase143 const restoreSeedLink = await driver.findClickableElement(144 '.unlock-page__link',145 );146 assert.equal(await restoreSeedLink.getText(), 'Forgot password?');147 await restoreSeedLink.click();148 await driver.pasteIntoField(149 '[data-testid="import-srp__srp-word-0"]',150 testSeedPhrase,151 );152 await driver.fill('#password', 'correct horse battery staple');153 await driver.fill('#confirm-password', 'correct horse battery staple');154 await driver.press('#confirm-password', driver.Key.ENTER);155 // balance renders156 await driver.waitForSelector({157 css: '[data-testid="eth-overview__primary-currency"]',158 text: '1000 ETH',159 });160 },161 );162 });163 it('Send Transaction from responsive window', async function () {164 const driverOptions = { responsive: true };165 const ganacheOptions = {166 accounts: [167 {168 secretKey:169 '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC',170 balance: convertToHexValue(25000000000000000000),171 },172 ],173 };174 await withFixtures(175 {176 fixtures: 'imported-account',177 driverOptions,178 ganacheOptions,179 title: this.test.title,180 },181 async ({ driver }) => {182 await driver.navigate();183 await driver.fill('#password', 'correct horse battery staple');184 await driver.press('#password', driver.Key.ENTER);185 // Send ETH from inside MetaMask186 // starts to send a transaction187 await driver.clickElement('[data-testid="eth-overview-send"]');188 await driver.fill(189 'input[placeholder="Search, public address (0x), or ENS"]',190 '0x2f318C334780961FB129D2a6c30D0763d9a5C970',191 );192 const inputAmount = await driver.fill('.unit-input__input', '1');193 const inputValue = await inputAmount.getProperty('value');194 assert.equal(inputValue, '1');195 // confirming transcation196 await driver.clickElement({ text: 'Next', tag: 'button' });197 await driver.clickElement({ text: 'Confirm', tag: 'button' });198 // finds the transaction in the transactions list199 await driver.clickElement('[data-testid="home__activity-tab"]');200 await driver.wait(async () => {201 const confirmedTxes = await driver.findElements(202 '.transaction-list__completed-transactions .transaction-list-item',203 );204 return confirmedTxes.length === 1;205 }, 10000);206 await driver.waitForSelector(207 {208 css: '.transaction-list-item__primary-currency',209 text: '-1 ETH',210 },211 { timeout: 10000 },212 );213 },214 );215 });...

Full Screen

Full Screen

incremental-security.spec.js

Source:incremental-security.spec.js Github

copy

Full Screen

1const { strict: assert } = require('assert');2const { convertToHexValue, withFixtures, tinyDelayMs } = require('../helpers');3const enLocaleMessages = require('../../../app/_locales/en/messages.json');4describe('Incremental Security', function () {5 const ganacheOptions = {6 accounts: [7 {8 secretKey:9 '0x250F458997A364988956409A164BA4E16F0F99F916ACDD73ADCD3A1DE30CF8D1',10 balance: convertToHexValue(0),11 },12 {13 secretKey:14 '0x53CB0AB5226EEBF4D872113D98332C1555DC304443BEE1CF759D15798D3C55A9',15 balance: convertToHexValue(25000000000000000000),16 },17 ],18 };19 it('Back up Secret Recovery Phrase from backup reminder', async function () {20 await withFixtures(21 {22 dapp: true,23 fixtures: 'onboarding',24 ganacheOptions,25 title: this.test.title,26 failOnConsoleError: false,27 dappPath: 'send-eth-with-private-key-test',28 },29 async ({ driver }) => {30 await driver.navigate();31 await driver.delay(tinyDelayMs);32 // clicks the continue button on the welcome screen33 await driver.findElement('.welcome-page__header');34 await driver.clickElement({35 text: enLocaleMessages.getStarted.message,36 tag: 'button',37 });38 // clicks the "Create New Wallet" option39 await driver.clickElement({ text: 'Create a Wallet', tag: 'button' });40 // clicks the "No thanks" option on the metametrics opt-in screen41 await driver.clickElement('.btn-secondary');42 // accepts a secure password43 await driver.fill(44 '.first-time-flow__form #create-password',45 'correct horse battery staple',46 );47 await driver.fill(48 '.first-time-flow__form #confirm-password',49 'correct horse battery staple',50 );51 await driver.clickElement('.first-time-flow__checkbox');52 await driver.clickElement('.first-time-flow__form button');53 // renders the Secret Recovery Phrase intro screen'54 await driver.clickElement('.seed-phrase-intro__left button');55 // skips the Secret Recovery Phrase challenge56 await driver.clickElement({57 text: enLocaleMessages.remindMeLater.message,58 tag: 'button',59 });60 await driver.clickElement(61 '[data-testid="account-options-menu-button"]',62 );63 await driver.clickElement(64 '[data-testid="account-options-menu__account-details"]',65 );66 // gets the current accounts address67 const address = await driver.findElement('.qr-code__address');68 const publicAddress = await address.getText();69 // wait for account modal to be visible70 const accountModal = await driver.findVisibleElement('span .modal');71 await driver.clickElement('.account-modal__close');72 // wait for account modal to be removed from DOM73 await accountModal.waitForElementState('hidden');74 // send to current account from dapp with different provider75 const windowHandles = await driver.getAllWindowHandles();76 const extension = windowHandles[0];77 // switched to Dapp78 await driver.openNewPage('http://127.0.0.1:8080/');79 // sends eth to the current account80 await driver.fill('#address', publicAddress);81 await driver.clickElement('#send');82 await driver.waitForSelector(83 { css: '#success', text: 'Success' },84 { timeout: 15000 },85 );86 // switch to extension87 await driver.switchToWindow(extension);88 // should have the correct amount of eth89 let currencyDisplay = await driver.waitForSelector({90 css: '.currency-display-component__text',91 text: '1',92 });93 let balance = await currencyDisplay.getText();94 assert.strictEqual(balance, '1');95 // backs up the Secret Recovery Phrase96 // should show a backup reminder97 const backupReminder = await driver.findElements({98 xpath:99 "//div[contains(@class, 'home-notification__text') and contains(text(), 'Backup your Secret Recovery Phrase to keep your wallet and funds secure')]",100 });101 assert.equal(backupReminder.length, 1);102 // should take the user to the seedphrase backup screen103 await driver.clickElement('.home-notification__accept-button');104 // reveals the Secret Recovery Phrase105 await driver.clickElement(106 '.reveal-seed-phrase__secret-blocker .reveal-seed-phrase__reveal-button',107 );108 const revealedSeedPhrase = await driver.findElement(109 '.reveal-seed-phrase__secret-words',110 );111 const seedPhrase = await revealedSeedPhrase.getText();112 assert.equal(seedPhrase.split(' ').length, 12);113 await driver.clickElement({114 text: enLocaleMessages.next.message,115 tag: 'button',116 });117 // selecting the words from seedphrase118 async function clickWordAndWait(word) {119 await driver.clickElement(120 `[data-testid="seed-phrase-sorted"] [data-testid="draggable-seed-${word}"]`,121 );122 await driver.delay(tinyDelayMs);123 }124 // can retype the Secret Recovery Phrase125 const words = seedPhrase.split(' ');126 for (const word of words) {127 await clickWordAndWait(word);128 }129 await driver.clickElement({ text: 'Confirm', tag: 'button' });130 // can click through the success screen131 await driver.clickElement({ text: 'All Done', tag: 'button' });132 // should have the correct amount of eth133 currencyDisplay = await driver.waitForSelector({134 css: '.currency-display-component__text',135 text: '1',136 });137 balance = await currencyDisplay.getText();138 assert.strictEqual(balance, '1');139 // should not show a backup reminder140 await driver.assertElementNotPresent('.backup-notification');141 },142 );143 });...

Full Screen

Full Screen

address-book.spec.js

Source:address-book.spec.js Github

copy

Full Screen

1const { strict: assert } = require('assert');2const { convertToHexValue, withFixtures } = require('../helpers');3describe('Address Book', function () {4 const ganacheOptions = {5 accounts: [6 {7 secretKey:8 '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC',9 balance: convertToHexValue(25000000000000000000),10 },11 ],12 };13 it('Adds an entry to the address book and sends eth to that address', async function () {14 await withFixtures(15 {16 dapp: true,17 fixtures: 'imported-account',18 ganacheOptions,19 title: this.test.title,20 },21 async ({ driver }) => {22 await driver.navigate();23 await driver.fill('#password', 'correct horse battery staple');24 await driver.press('#password', driver.Key.ENTER);25 await driver.clickElement('[data-testid="eth-overview-send"]');26 await driver.fill(27 'input[placeholder="Search, public address (0x), or ENS"]',28 '0x2f318C334780961FB129D2a6c30D0763d9a5C970',29 );30 await driver.clickElement('.dialog.send__dialog.dialog--message');31 // wait for address book modal to be visible32 const addressModal = await driver.findElement('.nickname-popover');33 await driver.clickElement('.nickname-popover__footer-button');34 await driver.findElement('.update-nickname__wrapper');35 await driver.fill(36 '.update-nickname__content__text-field input',37 'Test Name 1',38 );39 await driver.clickElement('.update-nickname__save');40 // wait for address book modal to be removed from DOM41 await addressModal.waitForElementState('hidden');42 const inputAmount = await driver.findElement('.unit-input__input');43 await inputAmount.fill('1');44 const inputValue = await inputAmount.getProperty('value');45 assert.equal(inputValue, '1');46 await driver.clickElement({ text: 'Next', tag: 'button' });47 await driver.clickElement({ text: 'Confirm', tag: 'button' });48 await driver.clickElement('[data-testid="home__activity-tab"]');49 await driver.wait(async () => {50 const confirmedTxes = await driver.findElements(51 '.transaction-list__completed-transactions .transaction-list-item',52 );53 return confirmedTxes.length === 1;54 }, 10000);55 await driver.waitForSelector(56 {57 css: '.transaction-list-item__primary-currency',58 text: '-1 ETH',59 },60 { timeout: 10000 },61 );62 },63 );64 });65 it('Sends to an address book entry', async function () {66 await withFixtures(67 {68 fixtures: 'address-entry',69 ganacheOptions,70 title: this.test.title,71 },72 async ({ driver }) => {73 await driver.navigate();74 await driver.fill('#password', 'correct horse battery staple');75 await driver.press('#password', driver.Key.ENTER);76 await driver.clickElement('[data-testid="eth-overview-send"]');77 const recipientRowTitle = await driver.findElement(78 '.send__select-recipient-wrapper__group-item__title',79 );80 const recipientRowTitleString = await recipientRowTitle.getText();81 assert.equal(recipientRowTitleString, 'Test Name 1');82 await driver.clickElement(83 '.send__select-recipient-wrapper__group-item',84 );85 await driver.fill('.unit-input__input', '2');86 await driver.clickElement({ text: 'Next', tag: 'button' });87 await driver.clickElement({ text: 'Confirm', tag: 'button' });88 await driver.clickElement('[data-testid="home__activity-tab"]');89 await driver.wait(async () => {90 const confirmedTxes = await driver.findElements(91 '.transaction-list__completed-transactions .transaction-list-item',92 );93 return confirmedTxes.length === 1;94 }, 10000);95 await driver.waitForSelector(96 {97 css: '.transaction-list-item__primary-currency',98 text: '-2 ETH',99 },100 { timeout: 10000 },101 );102 },103 );104 });...

Full Screen

Full Screen

threebox.spec.js

Source:threebox.spec.js Github

copy

Full Screen

1const { convertToHexValue, withFixtures, largeDelayMs } = require('../helpers');2const ThreeboxMockServer = require('../mock-3box/threebox-mock-server');3describe('Threebox', function () {4 const ganacheOptions = {5 accounts: [6 {7 secretKey:8 '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC',9 balance: convertToHexValue(25000000000000000000),10 },11 ],12 };13 let threeboxServer;14 before(async function () {15 threeboxServer = new ThreeboxMockServer();16 await threeboxServer.start();17 });18 after(async function () {19 await threeboxServer.stop();20 });21 it('Set up data to be restored by 3box', async function () {22 await withFixtures(23 {24 fixtures: 'imported-account',25 ganacheOptions,26 title: this.test.title,27 },28 async ({ driver }) => {29 await driver.navigate();30 await driver.fill('#password', 'correct horse battery staple');31 await driver.press('#password', driver.Key.ENTER);32 // turns on threebox syncing33 await driver.clickElement('.account-menu__icon');34 await driver.clickElement({ text: 'Settings', tag: 'div' });35 // turns on threebox syncing36 await driver.clickElement({ text: 'Advanced', tag: 'div' });37 await driver.clickElement(38 '[data-testid="advanced-setting-3box"] .toggle-button div',39 );40 // updates settings and address book41 // navigates to General settings42 await driver.clickElement({ text: 'General', tag: 'div' });43 // turns on use of blockies44 await driver.clickElement('.toggle-button > div');45 // adds an address to the contact list46 await driver.clickElement({ text: 'Contacts', tag: 'div' });47 await driver.clickElement('.address-book__link');48 await driver.fill('#nickname', 'Test User Name 11');49 await driver.fill(50 'input[placeholder="Search, public address (0x), or ENS"]',51 '0x2f318C334780961FB129D2a6c30D0763d9a5C970',52 );53 await driver.delay(largeDelayMs * 2);54 await driver.clickElement({ text: 'Save', tag: 'button' });55 await driver.findElement({ text: 'Test User Name 11', tag: 'div' });56 },57 );58 });59 it('Restore from 3box', async function () {60 await withFixtures(61 {62 fixtures: 'threebox-enabled',63 ganacheOptions,64 title: this.test.title,65 },66 async ({ driver }) => {67 await driver.navigate();68 await driver.fill('#password', 'correct horse battery staple');69 await driver.press('#password', driver.Key.ENTER);70 // confirms the 3box restore notification71 await driver.clickElement('.home-notification__accept-button');72 // goes to the settings screen73 await driver.clickElement('.account-menu__icon');74 await driver.clickElement({ text: 'Settings', tag: 'div' });75 // finds the restored address in the contact list76 await driver.clickElement({ text: 'Contacts', tag: 'div' });77 await driver.findElement({ text: 'Test User Name 11', tag: 'div' });78 },79 );80 });...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var webdriver = require('selenium-webdriver'),2 until = webdriver.until;3var driver = new webdriver.Builder()4 .forBrowser('chrome')5 .build();6driver.findElement(By.name('q')).sendKeys('webdriver');7driver.findElement(By.name('btnG')).click();8driver.wait(until.titleIs('webdriver - Google Search'), 1000);9driver.quit();10var webdriver = require('selenium-webdriver'),11 until = webdriver.until;12var driver = new webdriver.Builder()13 .forBrowser('chrome')14 .build();15driver.findElement(By.name('q')).sendKeys('webdriver');16driver.findElement(By.name('btnG')).click();17driver.wait(until.titleIs('webdriver - Google Search'), 1000);18driver.quit();19[debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"name","selector":"q","context":"","multiple":false}}20[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"name","selector":"q","context":"","multiple":false}}21[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":7,"value":"No element found"}

Full Screen

Using AI Code Generation

copy

Full Screen

1var webdriver = require('selenium-webdriver');2var By = webdriver.By;3var until = webdriver.until;4var driver = new webdriver.Builder()5 .forBrowser('chrome')6 .build();7driver.findElement(By.name('q')).sendKeys('webdriver');8driver.findElement(By.name('btnG')).click();9driver.wait(until.titleIs('webdriver - Google Search'), 1000);10driver.quit();11var webdriver = require('selenium-webdriver');12var By = webdriver.By;13var until = webdriver.until;14var driver = new webdriver.Builder()15 .forBrowser('chrome')16 .build();17driver.findElement(By.name('q')).sendKeys('webdriver');18driver.findElement(By.name('btnG')).click();19driver.wait(until.titleIs('webdriver - Google Search'), 1000);20driver.quit();21var webdriver = require('selenium-webdriver');22var By = webdriver.By;23var until = webdriver.until;24var driver = new webdriver.Builder()25 .forBrowser('chrome')26 .build();27driver.findElement(By.name('q')).sendKeys('webdriver');28driver.findElement(By.name('btnG')).click();29driver.wait(until.titleIs('webdriver - Google Search'), 1000);30driver.quit();

Full Screen

Using AI Code Generation

copy

Full Screen

1var wd = require('wd');2var assert = require('assert');3var path = require('path');4var fs = require('fs');5var desired = {6 app: path.resolve(__dirname, 'app-debug.apk'),7};8driver.init(desired).then(function () {9 return driver.click("id", "button1");10}).then(function () {11 console.log("Button clicked");12}).fin(function () {13 driver.quit();14}).done();15return driver.click("id", "button2");16return driver.click("text", "Button 1");17return driver.click("content-desc", "Button 1");18return driver.click("class name", "android.widget.Button");19return driver.click("x", 300, "y", 300);

Full Screen

Using AI Code Generation

copy

Full Screen

1driver.findElement(By.id("com.android.calculator2:id/digit_1")).click();2driver.findElement(By.id("digit_1")).click();3driver.findElement(By.id("num1Button")).click();4driver.findElement(By.id("btn1")).click();5driver.findElement(By.id("num_1")).click();6driver.findElement(By.id("num_1")).click();7driver.findElement(By.id("num_1")).click();8driver.findElement(By.id("num_1")).click();9driver.findElement(By.id("btn1")).click();10driver.findElement(By.id("btn1")).click();11driver.findElement(By.id("btn1")).click();12driver.findElement(By.id("btn1")).click();13driver.findElement(By.id("btn1")).click();14driver.findElement(By.id("btn1")).click();15driver.findElement(By.id("btn1")).click();16driver.findElement(By.id("btn1")).click();17driver.findElement(By.id("btn1")).click();18driver.findElement(By.id("btn1")).click();19driver.findElement(By.id("btn1")).click();20driver.findElement(By.id("btn1")).click();21driver.findElement(By.id("btn

Full Screen

Using AI Code Generation

copy

Full Screen

1driver.click(‘com.example.test:id/elementId’);2driver.click(‘elementId’);3driver.click(‘elementId’);4driver.click(‘elementId’);5driver.click(‘elementId’);6driver.click(‘elementId’);7driver.click(‘elementId’);8driver.click(‘elementId’);9driver.click(‘elementId’);10driver.click(‘elementId’);11driver.click(‘elementId’, ‘elementId’);12driver.click(‘elementId’, ‘elementId’);13driver.click(‘elementId’, ‘elementId’);14driver.click(‘elementId’, ‘elementId’);15driver.click(‘elementId’, ‘elementId’);16driver.click(‘elementId’, ‘elementId’);17driver.click(‘elementId’, ‘elementId’);

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Appium Android Driver automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful