|
|
|
@ -196,7 +196,7 @@ module.exports = { |
|
|
|
|
'Should run a script right after compilation #group5': function (browser: NightwatchBrowser) { |
|
|
|
|
browser |
|
|
|
|
.addFile('storage.sol', { content: scriptAutoExec.contract } ) |
|
|
|
|
.addFile('autoExec.js', { content: scriptAutoExec.script } ) |
|
|
|
|
.addFile('scripts/deploy_storage.js', { content: scriptAutoExec.script } ) |
|
|
|
|
.openFile('storage.sol') |
|
|
|
|
.sendKeys('body', [browser.Keys.CONTROL, 'e']) |
|
|
|
|
.journalChildIncludes('147', { shouldHaveOnlyOneOccurence: true }) |
|
|
|
@ -495,20 +495,21 @@ contract OwnerTest { |
|
|
|
|
}` |
|
|
|
|
|
|
|
|
|
const scriptAutoExec = { |
|
|
|
|
contract: ` |
|
|
|
|
|
|
|
|
|
// SPDX-License-Identifier: GPL-3.0
|
|
|
|
|
contract: `// SPDX-License-Identifier: GPL-3.0
|
|
|
|
|
|
|
|
|
|
pragma solidity >=0.7.0 <0.9.0; |
|
|
|
|
|
|
|
|
|
library lib { |
|
|
|
|
function test () public view returns (uint) { |
|
|
|
|
|
|
|
|
|
return 147; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @title Storage |
|
|
|
|
* @dev Store & retrieve value inr a variable |
|
|
|
|
* @custom:dev-run-script ./scripts/deploy_storage.js |
|
|
|
|
*/ |
|
|
|
|
contract Storage { |
|
|
|
|
|
|
|
|
@ -533,7 +534,8 @@ contract Storage { |
|
|
|
|
function getFromLib() public view returns (uint) { |
|
|
|
|
return lib.test(); |
|
|
|
|
} |
|
|
|
|
}`,
|
|
|
|
|
} |
|
|
|
|
`,
|
|
|
|
|
script: ` |
|
|
|
|
// Right click on the script name and hit "Run" to execute
|
|
|
|
|
const { expect } = require("chai"); |
|
|
|
|