added e2e to verify remappings

pull/4267/head
aniket-engg 12 months ago committed by yann300
parent ce52ebfdce
commit fbc8784a8c
  1. 45
      apps/remix-ide-e2e/src/tests/ballot.test.ts

@ -92,6 +92,25 @@ module.exports = {
})
},
'Compile Ballot with remappings set in remappings.txt file #group1': function (browser: NightwatchBrowser) {
browser
.clickLaunchIcon('filePanel')
.click('*[data-id="workspacesMenuDropdown"]')
.click('*[data-id="workspacecreate"]')
.waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]')
.waitForElementVisible('[data-id="fileSystemModalDialogModalFooter-react"] > button')
// eslint-disable-next-line dot-notation
.execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_remix_default' })
.waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok')
.execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() })
.pause(1000)
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]')
.addFile('contracts/lib/storage/src/Storage.sol', { content: retrieverContract })
.addFile('remappings.txt', { content: 'storage=contracts/lib/storage/src' })
.addFile('contracts/Retreiver.sol', { content: storageContract })
.verifyContracts(['Retreiver', 'Storage'])
},
'Deploy and use Ballot using external web3 #group2': function (browser: NightwatchBrowser) {
browser
.openFile('Untitled.sol')
@ -510,4 +529,30 @@ object "Contract" {
}
}
}
`
const storageContract = `
pragma solidity >=0.8.2 <0.9.0;
contract Storage {
uint256 public number;
function store(uint256 num) public {
number = num;
}
}
`
const retrieverContract = `
pragma solidity >=0.8.2 <0.9.0;
import "storage/store.sol";
contract Retriever is Storage {
function retrieve() public view returns (uint256){
return number;
}
}
`
Loading…
Cancel
Save