Metamask Shortcut Key

pull/5370/head
ioedeveloper 5 years ago committed by yann300
parent c92e8f5ad4
commit ec051ef48e
  1. 46
      test-browser/commands/setupMetamask.js
  2. 2
      test-browser/helpers/init.js
  3. 8
      test-browser/tests/runAndDeploy.js

@ -14,23 +14,35 @@ class MetaMask extends EventEmitter {
function setupMetaMask (browser, done) {
browser
.keys(browser.Keys.ALT).keys(browser.Keys.SHIFT).keys('M')
.pause(100000)
.waitForElementPresent('.first-time-flow__button')
.click('.first-time-flow__button')
.waitForElementPresent('.select-action__select-button:nth-of-type(1) > .first-time-flow__button')
.click('.select-action__select-button:nth-of-type(1) > .first-time-flow__button')
.waitForElementPresent('.page-container__footer-button:nth-of-type(2)')
.click('.page-container__footer-button:nth-of-type(2)')
.waitForElementPresent('.first-time-flow__textarea')
.setValue('.first-time-flow__textarea', 'explain uniform adapt basic blue onion rebel pull rice erase volcano couple')
.setValue('*[autocomplete="new-password"]', 'remix_is_cool')
.setValue('*[autocomplete="confirm-password"]', 'remix_is_cool')
.click('.first-time-flow__checkbox')
.pause(5000)
.click('.first-time-flow__button')
.perform(() => {
done()
.execute(() => {
var event = new KeyboardEvent('keydown', {
altKey: true,
shiftKey: true,
code: 'keyM',
})
console.log('event: ', event)
document.dispatchEvent(event)
}, [], () => {
browser.pause(100000)
.waitForElementPresent('.first-time-flow__button')
.click('.first-time-flow__button')
.waitForElementPresent('.select-action__select-button:nth-of-type(1) > .first-time-flow__button')
.click('.select-action__select-button:nth-of-type(1) > .first-time-flow__button')
.waitForElementPresent('.page-container__footer-button:nth-of-type(2)')
.click('.page-container__footer-button:nth-of-type(2)')
.waitForElementPresent('.first-time-flow__textarea')
.setValue('.first-time-flow__textarea', 'explain uniform adapt basic blue onion rebel pull rice erase volcano couple')
.setValue('*[autocomplete="new-password"]', 'remix_is_cool')
.setValue('*[autocomplete="confirm-password"]', 'remix_is_cool')
.click('.first-time-flow__checkbox')
.click('.first-time-flow__button')
.pause(5000)
.click('.first-time-flow__button')
.perform(() => {
done()
})
})
}

@ -3,6 +3,8 @@ require('dotenv').config()
module.exports = function (browser, callback, url, preloadPlugins = true) {
browser
.url(url || 'http://127.0.0.1:8080')
.pause(5000)
.switchBrowserTab(0)
.injectScript('test-browser/helpers/applytestmode.js', function () {
browser.resizeWindow(2560, 1440, () => {
if (preloadPlugins) {

@ -14,9 +14,7 @@ module.exports = {
'Should load run and deploy tab': function (browser) {
browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]')
.setupMetamask()
.pause(3000)
.pause(1000000)
.clickLaunchIcon('udapp')
.waitForElementPresent('*[data-id="sidePanelSwapitTitle"]')
.assert.containsText('*[data-id="sidePanelSwapitTitle"]', 'DEPLOY & RUN TRANSACTIONS')
@ -46,6 +44,7 @@ module.exports = {
.selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c')
.waitForElementPresent('*[data-id="Deploy - transact (not payable)"]')
.click('*[data-id="Deploy - transact (not payable)"]')
.pause(5000)
.testFunction('0xf887e3ac3143430b0c22d055eb25d234675e7f3246cb0824efc4c1437a1405d5', {
status: '0x1 Transaction mined and execution succeed',
'transaction hash': '0xf887e3ac3143430b0c22d055eb25d234675e7f3246cb0824efc4c1437a1405d5'
@ -58,10 +57,15 @@ module.exports = {
.click('*[data-id="universalDappUiTitleExpander"]')
.waitForElementPresent('*[data-id="pluginManagerSettingsDeployAndRunLLTxSendTransaction"]')
.click('*[data-id="pluginManagerSettingsDeployAndRunLLTxSendTransaction"]')
.pause(5000)
.testFunction('0xfe718871ee0b4d03cdcac0e12e5b164efaf7e23ba952c07db76e62692867019b', {
status: '0x1 Transaction mined and execution succeed',
'transaction hash': '0xfe718871ee0b4d03cdcac0e12e5b164efaf7e23ba952c07db76e62692867019b'
})
},
'Should': function (browser) {
browser.setupMetamask()
.end()
},

Loading…
Cancel
Save