add e2e tests

pull/5370/head
yann300 2 years ago
parent 0670478af8
commit 90a0c9f586
  1. 113559
      apps/remix-ide-e2e/src/helpers/hardhat_compilation.ts
  2. 13
      apps/remix-ide-e2e/src/tests/remixd.test.ts
  3. 2
      libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx

File diff suppressed because one or more lines are too long

@ -1,6 +1,7 @@
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import init from '../helpers/init'
import { hardhat_compilation } from '../helpers/hardhat_compilation'
const assetsTestContract = `import "./contract.sol";
contract Assets {
@ -112,8 +113,16 @@ module.exports = {
browser
.clickLaunchIcon('pluginManager')
.scrollAndClick('#pluginManager *[data-id="pluginManagerComponentDeactivateButtonremixd"]')
.end()
}
},
'Should listen on compilation result from hardhat #group4': function (browser: NightwatchBrowser) {
browser
.addFile('artifacts/build-info/c7062fdd360381a85af23eeef31c98f8.json', { content: hardhat_compilation }) // emulate hardhat emitting a compilation result
.waitForElementContainsText('*[data-id="terminalJournal"]', 'received compilation result from hardhat', 60000)
.clickLaunchIcon('udapp')
.assert.containsText('*[data-id="udappCompiledBy"]', 'Compiled by hardhat')
.verifyContracts(['Lock'])
}
}
function startRemixd (browser: NightwatchBrowser) {

@ -229,7 +229,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) {
<div className="udapp_container" data-id="contractDropdownContainer">
<div className='d-flex justify-content-between'>
<label className="udapp_settingsLabel">Contract</label>
{ Object.keys(props.contracts.contractList).length > 0 && <label className='text-light'>Compiled by {compilationSource} </label> }
{ Object.keys(props.contracts.contractList).length > 0 && <label data-id="udappCompiledBy" className='text-light'>Compiled by {compilationSource} </label> }
</div>
<div className="udapp_subcontainer">
<select ref={contractsRef} value={currentContract} onChange={handleContractChange} className="udapp_contractNames custom-select" disabled={contractOptions.disabled} title={contractOptions.title} style={{ display: loadType === 'abi' && !isContractFile(currentFile) ? 'none' : 'block' }}>

Loading…
Cancel
Save