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
2c8e4416
Commit
2c8e4416
authored
Jul 24, 2020
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tryout advance custom commands
parent
696e5d0f
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
358 additions
and
11 deletions
+358
-11
nightwatch.ts
apps/remix-ide-e2e/nightwatch.ts
+5
-5
CHROME_84.0.4147.89_Mac_OS_X_sample.test.xml
.../src/reports/CHROME_84.0.4147.89_Mac_OS_X_sample.test.xml
+20
-0
ballot.test.ts
apps/remix-ide-e2e/src/tests/ballot.test.ts
+316
-0
sample.test.js
apps/remix-ide-e2e/src/tests/sample.test.js
+0
-0
sample.test.ts
apps/remix-ide-e2e/src/tests/sample.test.ts
+10
-0
tsconfig.e2e.json
apps/remix-ide-e2e/tsconfig.e2e.json
+3
-2
workspace.json
workspace.json
+4
-4
No files found.
apps/remix-ide-e2e/nightwatch.ts
View file @
2c8e4416
...
...
@@ -4,9 +4,9 @@ const crxFile = fs.readFileSync('apps/remix-ide/test-browser/extensions/chrome/m
const
metamaskExtension
=
Buffer
.
from
(
crxFile
).
toString
(
'base64'
)
module
.
exports
=
{
'src_folders'
:
[
'apps/remix-ide-e2e/src/tests'
],
'output_folder'
:
'apps/remix-ide-e2e/src/reports'
,
'custom_commands_path'
:
[
'apps/remix-ide-e2e/src/commands'
],
'src_folders'
:
[
'
dist/
apps/remix-ide-e2e/src/tests'
],
'output_folder'
:
'
dist/
apps/remix-ide-e2e/src/reports'
,
'custom_commands_path'
:
[
'
dist/
apps/remix-ide-e2e/src/commands'
],
'custom_assertions_path'
:
''
,
'page_objects_path'
:
''
,
'globals_path'
:
''
,
...
...
@@ -21,7 +21,7 @@ module.exports = {
},
'screenshots'
:
{
'enabled'
:
true
,
'path'
:
'apps/remix-ide-e2e/reports/screenshots'
,
'path'
:
'
dist/
apps/remix-ide-e2e/reports/screenshots'
,
'on_failure'
:
true
,
'on_error'
:
true
},
...
...
@@ -30,7 +30,7 @@ module.exports = {
'javascriptEnabled'
:
true
,
'acceptSslCerts'
:
true
},
'exclude'
:
[
'apps/remix-ide-e2e/test-browser/tests/runAndDeploy.js'
]
'exclude'
:
[
'
dist/
apps/remix-ide-e2e/test-browser/tests/runAndDeploy.js'
]
},
'chrome'
:
{
...
...
apps/remix-ide-e2e/src/reports/CHROME_84.0.4147.89_Mac_OS_X_sample.test.xml
0 → 100644
View file @
2c8e4416
<?xml version="1.0" encoding="UTF-8" ?>
<testsuites
errors=
"0"
failures=
"0"
tests=
"1"
>
<testsuite
name=
"sample.test"
errors=
"0"
failures=
"0"
hostname=
""
id=
""
package=
"sample.test"
skipped=
"0"
tests=
"1"
time=
"3.065"
timestamp=
""
>
<testcase
name=
"Test Computation"
classname=
"sample.test"
time=
"3.065"
assertions=
"0"
>
</testcase>
</testsuite>
</testsuites>
apps/remix-ide-e2e/src/tests/ballot.test.ts
0 → 100644
View file @
2c8e4416
'use strict'
var
examples
=
require
(
'../../src/app/editor/example-contracts'
)
var
init
=
require
(
'../helpers/init'
)
var
sauce
=
require
(
'./sauce'
)
var
sources
=
[
{
'browser/Untitled.sol'
:
{
content
:
examples
.
ballot
.
content
}}
]
module
.
exports
=
{
before
:
function
(
browser
,
done
)
{
init
(
browser
,
done
)
},
'@sources'
:
function
()
{
return
sources
},
'Deploy Ballot'
:
function
(
browser
)
{
browser
.
waitForElementVisible
(
'*[data-id="remixIdeIconPanel"]'
,
10000
)
.
clickLaunchIcon
(
'solidity'
)
.
testContracts
(
'Untitled.sol'
,
sources
[
0
][
'browser/Untitled.sol'
],
[
'Ballot'
])
.
clickLaunchIcon
(
'udapp'
)
.
selectAccount
(
'0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c'
)
.
setValue
(
'input[placeholder="bytes32[] proposalNames"]'
,
'["0x48656c6c6f20576f726c64210000000000000000000000000000000000000000"]'
)
.
click
(
'*[data-id="Deploy - transact (not payable)"]'
)
.
waitForElementPresent
(
'*[data-id="universalDappUiContractActionWrapper"]'
)
.
click
(
'*[data-id="universalDappUiTitleExpander"]'
)
.
clickFunction
(
'delegate - transact (not payable)'
,
{
types
:
'address to'
,
values
:
'"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"'
})
.
testFunction
(
'0x41fab8ea5b1d9fba5e0a6545ca1a2d62fff518578802c033c2b9a031a01c31b3'
,
{
status
:
'0x1 Transaction mined and execution succeed'
,
'transaction hash'
:
'0x41fab8ea5b1d9fba5e0a6545ca1a2d62fff518578802c033c2b9a031a01c31b3'
,
'decoded input'
:
{
'address to'
:
'0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB'
}
})
},
'Debug Ballot / delegate'
:
function
(
browser
)
{
browser
.
pause
(
500
)
.
click
(
'*[data-id="txLoggerDebugButton0x41fab8ea5b1d9fba5e0a6545ca1a2d62fff518578802c033c2b9a031a01c31b3"]'
)
.
pause
(
2000
)
// .clickLaunchIcon('debugger')
.
click
(
'*[data-id="buttonNavigatorJumpPreviousBreakpoint"]'
)
.
pause
(
2000
)
.
goToVMTraceStep
(
79
)
.
pause
(
1000
)
.
checkVariableDebug
(
'soliditystate'
,
stateCheck
)
.
checkVariableDebug
(
'soliditylocals'
,
localsCheck
)
},
'Access Ballot via at address'
:
function
(
browser
)
{
browser
.
clickLaunchIcon
(
'udapp'
)
.
click
(
'*[data-id="universalDappUiUdappClose"]'
)
.
addFile
(
'ballot.abi'
,
{
content
:
ballotABI
})
.
addAtAddressInstance
(
'0x692a70D2e424a56D2C6C27aA97D1a86395877b3B'
,
true
,
false
)
.
clickLaunchIcon
(
'fileExplorers'
)
.
addAtAddressInstance
(
'0x692a70D2e424a56D2C6C27aA97D1a86395877b3A'
,
true
,
true
)
.
pause
(
500
)
.
waitForElementPresent
(
'*[data-id="universalDappUiContractActionWrapper"]'
)
.
click
(
'*[data-id="universalDappUiTitleExpander"]'
)
.
clickFunction
(
'delegate - transact (not payable)'
,
{
types
:
'address to'
,
values
:
'"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"'
})
.
testFunction
(
'0xca58080c8099429caeeffe43b8104df919c2c543dceb9edf9242fa55f045c803'
,
{
status
:
'0x0 Transaction mined but execution failed'
,
'transaction hash'
:
'0xca58080c8099429caeeffe43b8104df919c2c543dceb9edf9242fa55f045c803'
,
'decoded input'
:
{
'address to'
:
'0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB'
}
})
},
'Deploy and use Ballot using external web3'
:
function
(
browser
)
{
browser
.
click
(
'*[data-id="settingsWeb3Mode"]'
)
.
modalFooterOKClick
()
.
clickLaunchIcon
(
'solidity'
)
.
testContracts
(
'Untitled.sol'
,
sources
[
0
][
'browser/Untitled.sol'
],
[
'Ballot'
])
.
clickLaunchIcon
(
'udapp'
)
.
setValue
(
'input[placeholder="bytes32[] proposalNames"]'
,
'["0x48656c6c6f20576f726c64210000000000000000000000000000000000000000"]'
)
.
click
(
'*[data-id="Deploy - transact (not payable)"]'
)
.
clickInstance
(
0
)
.
click
(
'*[data-id="terminalClearConsole"]'
)
.
clickFunction
(
'delegate - transact (not payable)'
,
{
types
:
'address to'
,
values
:
'0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c'
})
.
journalLastChildIncludes
(
'Ballot.delegate(address)'
)
.
journalLastChildIncludes
(
'data: 0x5c1...a733c'
)
.
end
()
},
tearDown
:
sauce
}
var
localsCheck
=
{
'to'
:
{
'value'
:
'0x4B0897B0513FDC7C541B6D9D7E929C4E5364D2DB'
,
'type'
:
'address'
}
}
var
stateCheck
=
{
'chairperson'
:
{
'value'
:
'0xCA35B7D915458EF540ADE6068DFE2F44E8FA733C'
,
'type'
:
'address'
,
'constant'
:
false
},
'voters'
:
{
'value'
:
{
'000000000000000000000000ca35b7d915458ef540ade6068dfe2f44e8fa733c'
:
{
'value'
:
{
'weight'
:
{
'value'
:
'1'
,
'type'
:
'uint256'
},
'voted'
:
{
'value'
:
false
,
'type'
:
'bool'
},
'delegate'
:
{
'value'
:
'0x0000000000000000000000000000000000000000'
,
'type'
:
'address'
},
'vote'
:
{
'value'
:
'0'
,
'type'
:
'uint256'
}
},
'type'
:
'struct Ballot.Voter'
}
},
'type'
:
'mapping(address => struct Ballot.Voter)'
,
'constant'
:
false
},
'proposals'
:
{
'value'
:
[
{
'value'
:
{
'name'
:
{
'value'
:
'0x48656C6C6F20576F726C64210000000000000000000000000000000000000000'
,
'type'
:
'bytes32'
},
'voteCount'
:
{
'value'
:
'0'
,
'type'
:
'uint256'
}
},
'type'
:
'struct Ballot.Proposal'
}
],
'length'
:
'0x1'
,
'type'
:
'struct Ballot.Proposal[]'
,
'constant'
:
false
}
}
var
ballotABI
=
`[
{
"inputs": [
{
"internalType": "bytes32[]",
"name": "proposalNames",
"type": "bytes32[]"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"constant": true,
"inputs": [],
"name": "chairperson",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
}
],
"name": "delegate",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "voter",
"type": "address"
}
],
"name": "giveRightToVote",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "proposals",
"outputs": [
{
"internalType": "bytes32",
"name": "name",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "voteCount",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "uint256",
"name": "proposal",
"type": "uint256"
}
],
"name": "vote",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "voters",
"outputs": [
{
"internalType": "uint256",
"name": "weight",
"type": "uint256"
},
{
"internalType": "bool",
"name": "voted",
"type": "bool"
},
{
"internalType": "address",
"name": "delegate",
"type": "address"
},
{
"internalType": "uint256",
"name": "vote",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "winnerName",
"outputs": [
{
"internalType": "bytes32",
"name": "winnerName_",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "winningProposal",
"outputs": [
{
"internalType": "uint256",
"name": "winningProposal_",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
]`
apps/remix-ide-e2e/src/tests/sample.test.js
deleted
100644 → 0
View file @
696e5d0f
apps/remix-ide-e2e/src/tests/sample.test.ts
0 → 100644
View file @
2c8e4416
module
.
exports
=
{
before
:
function
(
browser
,
done
)
{
done
()
},
'Test Computation'
:
function
(
browser
)
{
browser
.
url
(
'https://google.com'
)
}
}
\ No newline at end of file
apps/remix-ide-e2e/tsconfig.e2e.json
View file @
2c8e4416
...
...
@@ -2,8 +2,8 @@
"extends"
:
"./tsconfig.json"
,
"compilerOptions"
:
{
"sourceMap"
:
false
,
"outDir"
:
"../../dist
/out-tsc
"
,
"outDir"
:
"../../dist"
,
"allowJs"
:
true
},
"include"
:
[
"
src/**/*.ts"
,
"src/
**/*.js"
]
"include"
:
[
"
**/*.ts"
,
"
**/*.js"
]
}
\ No newline at end of file
workspace.json
View file @
2c8e4416
...
...
@@ -100,10 +100,10 @@
"builder"
:
"@nrwl/workspace:run-commands"
,
"options"
:
{
"commands"
:
[
{
"command"
:
"node_modules/.bin/ts-node node_modules/.bin/nightwatch --config apps/remix-ide-e2e/nightwatch.ts apps/remix-ide-e2e/src/tests/sample.test.js --env chrome"
}
]
"tsc -p apps/remix-ide-e2e/tsconfig.e2e.json"
],
"cwd"
:
"."
,
"parallel"
:
false
}
},
"lint"
:
{
...
...
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