e2e test: running static analysis with remixd and hardhat

pull/1484/head^2
yann300 3 years ago committed by Aniket
parent e873dac6af
commit 91932c2aec
  1. 22
      apps/remix-ide-e2e/src/tests/remixd.test.ts
  2. 2
      libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx

@ -34,6 +34,13 @@ const sources = [
},
{
'test_import_node_modules_with_github_import.sol': { content: 'import "openzeppelin-solidity/contracts/sample.sol";' }
},
{
'test_static_analysis_with_remixd_and_hardhat.sol': {
content: `
import "hardhat/console.sol";
contract test5 { function get () public returns (uint) { return 8; }}`
}
}
]
@ -71,6 +78,21 @@ module.exports = {
.setSolidityCompilerVersion('soljson-v0.8.0+commit.c7dfd78e.js') // open-zeppelin moved to pragma ^0.8.0
.testContracts('test_import_node_modules_with_github_import.sol', sources[4]['test_import_node_modules_with_github_import.sol'], ['ERC20', 'test11'])
},
'Static Analysis run with remixd': function (browser) {
browser.testContracts('Untitled.sol', sources[5]['test_static_analysis_with_remixd_and_hardhat'], ['test5'])
.clickLaunchIcon('solidityStaticAnalysis')
.click('#staticanalysisButton button')
.waitForElementPresent('#staticanalysisresult .warning', 2000, true, function () {
browser
.click('[data-id="staticAnalysisModuleMiscellaneous1"')
.click('[data-id="staticAnalysisModuleMiscellaneous1"')
.getEditorValue((content) => {
browser.assert.ok(content.indexOf(
'function _sendLogPayload(bytes memory payload) private view {') !== -1,
'code has not been loaded')
})
})
},
'Run git status': '' + function (browser) {
browser

@ -471,7 +471,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
<span className="text-dark h6">{element[0]}</span>
{element[1]['map']((x, i) => ( // eslint-disable-line dot-notation
x.hasWarning ? ( // eslint-disable-next-line dot-notation
<div id={`staticAnalysisModule${element[1]['warningModuleName']}`} key={i}>
<div data-id={`staticAnalysisModule${x.warningModuleName}${i}`} id={`staticAnalysisModule${x.warningModuleName}${i}`} key={i}>
<ErrorRenderer message={x.msg} opt={x.options} warningErrors={ x.warningErrors} editor={props.analysisModule}/>
</div>

Loading…
Cancel
Save