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
cc760bf3
Commit
cc760bf3
authored
Apr 06, 2020
by
ioedeveloper
Committed by
yann300
Apr 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Metamask Shortcut Key
parent
420e2eb9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
19 deletions
+37
-19
setupMetamask.js
test-browser/commands/setupMetamask.js
+29
-17
init.js
test-browser/helpers/init.js
+2
-0
runAndDeploy.js
test-browser/tests/runAndDeploy.js
+6
-2
No files found.
test-browser/commands/setupMetamask.js
View file @
cc760bf3
...
@@ -14,23 +14,35 @@ class MetaMask extends EventEmitter {
...
@@ -14,23 +14,35 @@ 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'
,
{
.
waitForElementPresent
(
'.first-time-flow__button'
)
altKey
:
true
,
.
click
(
'.first-time-flow__button'
)
shiftKey
:
true
,
.
waitForElementPresent
(
'.select-action__select-button:nth-of-type(1) > .first-time-flow__button'
)
code
:
'keyM'
,
.
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)'
)
console
.
log
(
'event: '
,
event
)
.
waitForElementPresent
(
'.first-time-flow__textarea'
)
.
setValue
(
'.first-time-flow__textarea'
,
'explain uniform adapt basic blue onion rebel pull rice erase volcano couple'
)
document
.
dispatchEvent
(
event
)
.
setValue
(
'*[autocomplete="new-password"]'
,
'remix_is_cool'
)
},
[],
()
=>
{
.
setValue
(
'*[autocomplete="confirm-password"]'
,
'remix_is_cool'
)
browser
.
pause
(
100000
)
.
click
(
'.first-time-flow__checkbox'
)
.
waitForElementPresent
(
'.first-time-flow__button'
)
.
pause
(
5000
)
.
click
(
'.first-time-flow__button'
)
.
click
(
'.first-time-flow__button'
)
.
waitForElementPresent
(
'.select-action__select-button:nth-of-type(1) > .first-time-flow__button'
)
.
perform
(()
=>
{
.
click
(
'.select-action__select-button:nth-of-type(1) > .first-time-flow__button'
)
done
()
.
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
()
})
})
})
}
}
...
...
test-browser/helpers/init.js
View file @
cc760bf3
...
@@ -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
)
{
...
...
test-browser/tests/runAndDeploy.js
View file @
cc760bf3
...
@@ -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
()
},
},
...
...
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