pull/2470/head
lianahus 2 years ago committed by yann300
parent 3967b6afab
commit ebc40039be
  1. 1
      apps/remix-ide-e2e/src/commands/verifyContracts.ts
  2. 36
      apps/remix-ide-e2e/src/tests/ballot.test.ts
  3. 6
      apps/remix-ide-e2e/src/tests/plugin_api.ts
  4. 3
      apps/remix-ide-e2e/src/tests/workspace.test.ts
  5. 4
      libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx

@ -48,7 +48,6 @@ function verifyContracts (browser: NightwatchBrowser, compiledContractNames: str
.waitForElementVisible('*[data-id="treeViewDivtreeViewItemoptimizer"]')
.click('*[data-id="treeViewDivtreeViewItemoptimizer"]')
.waitForElementVisible('*[data-id="treeViewDivruns"]')
.assert.containsText('*[data-id="treeViewDivruns"]', `${opts.runs}`)
.click('[data-id="workspacesModalDialog-modal-footer-ok-react"]')
.perform(() => {

@ -111,33 +111,39 @@ module.exports = {
.journalLastChildIncludes('data: 0x5c1...a733c')
},
'Call method from Ballot to check return value using external web3': function (browser: NightwatchBrowser) {
browser
.clickFunction('winnerName - call')
// Test in terminal
.journalLastChildIncludes('Ballot.winnerName()')
.testFunction('last',
{
'decoded output': { 0: 'bytes32: winnerName_ 0x48656c6c6f20576f726c64210000000000000000000000000000000000000000' }
})
// Test in Udapp UI , treeViewDiv0 shows returned value on method click
.assert.containsText('*[data-id="treeViewDiv0"]', 'bytes32: winnerName_ 0x48656c6c6f20576f726c64210000000000000000000000000000000000000000')
.end()
},
'Compile Ballot using config file': function (browser: NightwatchBrowser) {
browser
.addFile('cf.json', {content: configFile})
.clickLaunchIcon('solidity')
.waitForElementVisible('*[data-id="scConfigExpander"]')
.click('*[data-id="scConfigExpander"]')
.waitForElementVisible('*[data-id="scFileConfiguration"]', 10000)
.click('*[data-id="scFileConfiguration"]')
.waitForElementVisible('*[data-id="scConfigChangeFilePath"]', 10000)
.click('*[data-id="scConfigChangeFilePath"]')
.pause(10000)
.waitForElementVisible('*[data-id="scConfigFilePathInput"]', 10000)
.click('*[data-id="scConfigFilePathInput]')
.clearValue('*[data-id="scConfigFilePathInput"]')
.setValue('*[data-id="scConfigFilePathInput"]', 'cf.json')
.sendKeys('*[data-id$="scConfigFilePathInput"]', browser.Keys.ENTER)
.openFile('Untitled.sol')
.pause(5000)
.pause(20000)
.verifyContracts(['Ballot'], {wait: 2000, runs: '300'})
},
'Call method from Ballot to check return value using external web3': function (browser: NightwatchBrowser) {
browser
.clickFunction('winnerName - call')
// Test in terminal
.journalLastChildIncludes('Ballot.winnerName()')
.testFunction('last',
{
'decoded output': { 0: 'bytes32: winnerName_ 0x48656c6c6f20576f726c64210000000000000000000000000000000000000000' }
})
// Test in Udapp UI , treeViewDiv0 shows returned value on method click
.assert.containsText('*[data-id="treeViewDiv0"]', 'bytes32: winnerName_ 0x48656c6c6f20576f726c64210000000000000000000000000000000000000000')
.end()
}
}

@ -231,7 +231,6 @@ module.exports = {
'Should get current files #group7': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'fileManager:readdir', {
'compiler_config.json': { isDirectory: false },
contracts: { isDirectory: true },
scripts: { isDirectory: true },
tests: { isDirectory: true },
@ -286,15 +285,12 @@ module.exports = {
'Should create empty workspace #group2': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'filePanel:createWorkspace', null, null, ['emptyworkspace', true])
await clickAndCheckLog(browser, 'filePanel:getCurrentWorkspace', { name: 'emptyworkspace', isLocalhost: false, absolutePath: '.workspaces/emptyworkspace' }, null, null)
await clickAndCheckLog(browser, 'fileManager:readdir', {
'compiler_config.json': { isDirectory: false }
}, null, '/')
await clickAndCheckLog(browser, 'fileManager:readdir', {}, null, '/')
},
'Should create workspace #group2': async function (browser: NightwatchBrowser) {
await clickAndCheckLog(browser, 'filePanel:createWorkspace', null, null, 'testspace')
await clickAndCheckLog(browser, 'filePanel:getCurrentWorkspace', { name: 'testspace', isLocalhost: false, absolutePath: '.workspaces/testspace' }, null, null)
await clickAndCheckLog(browser, 'fileManager:readdir', {
'compiler_config.json': { isDirectory: false },
contracts: { isDirectory: true },
scripts: { isDirectory: true },
tests: { isDirectory: true },

@ -107,8 +107,7 @@ module.exports = {
const fileList = document.querySelector('*[data-id="treeViewUltreeViewMenu"]')
return fileList.getElementsByTagName('li').length;
}, [], function(result){
// check there are no files in FE except config file
browser.assert.equal(result.value, 1, 'Incorrect number of files');
browser.assert.equal(result.value, 0, 'Incorrect number of files');
});
},

@ -784,8 +784,8 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
</div>
</div>
<div className="d-flex pb-1 remixui_compilerConfig custom-control custom-radio">
<input className="custom-control-input" type="radio" name="configradio" value="file" onChange={toggleConfigType} checked={state.useFileConfiguration} id="scFileConfig" data-id="scFileConfiguration"/>
<label className="form-check-label custom-control-label" htmlFor="scFileConfig">Use configuration file</label>
<input className="custom-control-input" type="radio" name="configradio" value="file" onChange={toggleConfigType} checked={state.useFileConfiguration} id="scFileConfig" />
<label className="form-check-label custom-control-label" htmlFor="scFileConfig" data-id="scFileConfiguration">Use configuration file</label>
</div>
<div className={`pt-2 ml-4 ml-2 align-items-start justify-content-between d-flex`}>
{ (!showFilePathInput && state.useFileConfiguration) && <span

Loading…
Cancel
Save