Commit cc760bf3 authored by ioedeveloper's avatar ioedeveloper Committed by yann300

Metamask Shortcut Key

parent 420e2eb9
...@@ -14,8 +14,18 @@ class MetaMask extends EventEmitter { ...@@ -14,8 +14,18 @@ class MetaMask extends EventEmitter {
function setupMetaMask (browser, done) { function setupMetaMask (browser, done) {
browser browser
.keys(browser.Keys.ALT).keys(browser.Keys.SHIFT).keys('M') .execute(() => {
.pause(100000) 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') .waitForElementPresent('.first-time-flow__button')
.click('.first-time-flow__button') .click('.first-time-flow__button')
.waitForElementPresent('.select-action__select-button:nth-of-type(1) > .first-time-flow__button') .waitForElementPresent('.select-action__select-button:nth-of-type(1) > .first-time-flow__button')
...@@ -27,11 +37,13 @@ function setupMetaMask (browser, done) { ...@@ -27,11 +37,13 @@ function setupMetaMask (browser, done) {
.setValue('*[autocomplete="new-password"]', 'remix_is_cool') .setValue('*[autocomplete="new-password"]', 'remix_is_cool')
.setValue('*[autocomplete="confirm-password"]', 'remix_is_cool') .setValue('*[autocomplete="confirm-password"]', 'remix_is_cool')
.click('.first-time-flow__checkbox') .click('.first-time-flow__checkbox')
.click('.first-time-flow__button')
.pause(5000) .pause(5000)
.click('.first-time-flow__button') .click('.first-time-flow__button')
.perform(() => { .perform(() => {
done() done()
}) })
})
} }
module.exports = MetaMask module.exports = MetaMask
...@@ -3,6 +3,8 @@ require('dotenv').config() ...@@ -3,6 +3,8 @@ require('dotenv').config()
module.exports = function (browser, callback, url, preloadPlugins = true) { module.exports = function (browser, callback, url, preloadPlugins = true) {
browser browser
.url(url || 'http://127.0.0.1:8080') .url(url || 'http://127.0.0.1:8080')
.pause(5000)
.switchBrowserTab(0)
.injectScript('test-browser/helpers/applytestmode.js', function () { .injectScript('test-browser/helpers/applytestmode.js', function () {
browser.resizeWindow(2560, 1440, () => { browser.resizeWindow(2560, 1440, () => {
if (preloadPlugins) { if (preloadPlugins) {
......
...@@ -14,9 +14,7 @@ module.exports = { ...@@ -14,9 +14,7 @@ module.exports = {
'Should load run and deploy tab': function (browser) { 'Should load run and deploy tab': function (browser) {
browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]') browser.waitForElementPresent('*[data-id="remixIdeSidePanel"]')
.setupMetamask()
.pause(3000) .pause(3000)
.pause(1000000)
.clickLaunchIcon('udapp') .clickLaunchIcon('udapp')
.waitForElementPresent('*[data-id="sidePanelSwapitTitle"]') .waitForElementPresent('*[data-id="sidePanelSwapitTitle"]')
.assert.containsText('*[data-id="sidePanelSwapitTitle"]', 'DEPLOY & RUN TRANSACTIONS') .assert.containsText('*[data-id="sidePanelSwapitTitle"]', 'DEPLOY & RUN TRANSACTIONS')
...@@ -46,6 +44,7 @@ module.exports = { ...@@ -46,6 +44,7 @@ module.exports = {
.selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') .selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c')
.waitForElementPresent('*[data-id="Deploy - transact (not payable)"]') .waitForElementPresent('*[data-id="Deploy - transact (not payable)"]')
.click('*[data-id="Deploy - transact (not payable)"]') .click('*[data-id="Deploy - transact (not payable)"]')
.pause(5000)
.testFunction('0xf887e3ac3143430b0c22d055eb25d234675e7f3246cb0824efc4c1437a1405d5', { .testFunction('0xf887e3ac3143430b0c22d055eb25d234675e7f3246cb0824efc4c1437a1405d5', {
status: '0x1 Transaction mined and execution succeed', status: '0x1 Transaction mined and execution succeed',
'transaction hash': '0xf887e3ac3143430b0c22d055eb25d234675e7f3246cb0824efc4c1437a1405d5' 'transaction hash': '0xf887e3ac3143430b0c22d055eb25d234675e7f3246cb0824efc4c1437a1405d5'
...@@ -58,10 +57,15 @@ module.exports = { ...@@ -58,10 +57,15 @@ module.exports = {
.click('*[data-id="universalDappUiTitleExpander"]') .click('*[data-id="universalDappUiTitleExpander"]')
.waitForElementPresent('*[data-id="pluginManagerSettingsDeployAndRunLLTxSendTransaction"]') .waitForElementPresent('*[data-id="pluginManagerSettingsDeployAndRunLLTxSendTransaction"]')
.click('*[data-id="pluginManagerSettingsDeployAndRunLLTxSendTransaction"]') .click('*[data-id="pluginManagerSettingsDeployAndRunLLTxSendTransaction"]')
.pause(5000)
.testFunction('0xfe718871ee0b4d03cdcac0e12e5b164efaf7e23ba952c07db76e62692867019b', { .testFunction('0xfe718871ee0b4d03cdcac0e12e5b164efaf7e23ba952c07db76e62692867019b', {
status: '0x1 Transaction mined and execution succeed', status: '0x1 Transaction mined and execution succeed',
'transaction hash': '0xfe718871ee0b4d03cdcac0e12e5b164efaf7e23ba952c07db76e62692867019b' 'transaction hash': '0xfe718871ee0b4d03cdcac0e12e5b164efaf7e23ba952c07db76e62692867019b'
}) })
},
'Should': function (browser) {
browser.setupMetamask()
.end() .end()
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment