Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
420e2eb9
Commit
420e2eb9
authored
Apr 03, 2020
by
ioedeveloper
Committed by
yann300
Apr 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Setuetup MetaMask
parent
efd06a86
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
5 deletions
+48
-5
nightwatch.js
nightwatch.js
+6
-2
setupMetamask.js
test-browser/commands/setupMetamask.js
+37
-0
metamask.crx
test-browser/extensions/chrome/metamask.crx
+0
-0
init.js
test-browser/helpers/init.js
+1
-1
runAndDeploy.js
test-browser/tests/runAndDeploy.js
+4
-2
No files found.
nightwatch.js
View file @
420e2eb9
'use strict'
require
(
'@babel/register'
)()
const
crxFile
=
require
(
'fs'
).
readFileSync
(
'./test-browser/extensions/chrome/metamask.crx'
)
const
metamaskExtension
=
new
Buffer
.
from
(
crxFile
).
toString
(
'base64'
)
module
.
exports
=
{
'src_folders'
:
[
'test-browser/tests'
],
'output_folder'
:
'reports'
,
...
...
@@ -35,8 +38,9 @@ module.exports = {
'browserName'
:
'chrome'
,
'javascriptEnabled'
:
true
,
'acceptSslCerts'
:
true
,
'chromeOptions'
:
{
'args'
:
[
'window-size=2560,1440'
,
'start-fullscreen'
]
'goog:chromeOptions'
:
{
'args'
:
[
'window-size=2560,1440'
,
'start-fullscreen'
],
'extensions'
:
[
metamaskExtension
]
}
}
},
...
...
test-browser/commands/setupMetamask.js
0 → 100644
View file @
420e2eb9
const
EventEmitter
=
require
(
'events'
)
class
MetaMask
extends
EventEmitter
{
command
()
{
this
.
api
.
perform
((
done
)
=>
{
setupMetaMask
(
this
.
api
,
()
=>
{
done
()
this
.
emit
(
'complete'
)
})
})
return
this
}
}
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
()
})
}
module
.
exports
=
MetaMask
test-browser/extensions/chrome/metamask.crx
0 → 100644
View file @
420e2eb9
File added
test-browser/helpers/init.js
View file @
420e2eb9
...
...
@@ -22,7 +22,7 @@ module.exports = function (browser, callback, url, preloadPlugins = true) {
}
function
initModules
(
browser
,
callback
)
{
browser
.
pause
(
20
000
)
browser
.
pause
(
5
000
)
.
click
(
'#icon-panel div[plugin="pluginManager"]'
)
.
scrollAndClick
(
'#pluginManager article[id="remixPluginManagerListItem_solidity"] button'
)
.
pause
(
5000
)
...
...
test-browser/tests/runAndDeploy.js
View file @
420e2eb9
...
...
@@ -14,7 +14,9 @@ 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'
)
...
...
@@ -56,9 +58,9 @@ module.exports = {
.
click
(
'*[data-id="universalDappUiTitleExpander"]'
)
.
waitForElementPresent
(
'*[data-id="pluginManagerSettingsDeployAndRunLLTxSendTransaction"]'
)
.
click
(
'*[data-id="pluginManagerSettingsDeployAndRunLLTxSendTransaction"]'
)
.
testFunction
(
'0xf
887e3ac3143430b0c22d055eb25d234675e7f3246cb0824efc4c1437a1405d5
'
,
{
.
testFunction
(
'0xf
e718871ee0b4d03cdcac0e12e5b164efaf7e23ba952c07db76e62692867019b
'
,
{
status
:
'0x1 Transaction mined and execution succeed'
,
'transaction hash'
:
'0xf
887e3ac3143430b0c22d055eb25d234675e7f3246cb0824efc4c1437a1405d5
'
'transaction hash'
:
'0xf
e718871ee0b4d03cdcac0e12e5b164efaf7e23ba952c07db76e62692867019b
'
})
.
end
()
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment