Skip to content

Commit 13db056

Browse files
authored
Merge pull request #4267 from ethereum/remapE2e
added e2e to verify remappings
2 parents ce52ebf + 161c326 commit 13db056

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

apps/remix-ide-e2e/src/tests/ballot.test.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,25 @@ module.exports = {
9292
})
9393
},
9494

95+
'Compile with remappings set in remappings.txt file #group1': function (browser: NightwatchBrowser) {
96+
browser
97+
.clickLaunchIcon('filePanel')
98+
.click('*[data-id="workspacesMenuDropdown"]')
99+
.click('*[data-id="workspacecreate"]')
100+
.waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]')
101+
.waitForElementVisible('[data-id="fileSystemModalDialogModalFooter-react"] > button')
102+
// eslint-disable-next-line dot-notation
103+
.execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_remix_default' })
104+
.waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok')
105+
.execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() })
106+
.pause(1000)
107+
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]')
108+
.addFile('contracts/lib/storage/src/Storage.sol', { content: storageContract})
109+
.addFile('remappings.txt', { content: 'storage=contracts/lib/storage/src' })
110+
.addFile('contracts/Retriever.sol', { content: retrieverContract })
111+
.verifyContracts(['Retriever', 'Storage'])
112+
},
113+
95114
'Deploy and use Ballot using external web3 #group2': function (browser: NightwatchBrowser) {
96115
browser
97116
.openFile('Untitled.sol')
@@ -510,4 +529,30 @@ object "Contract" {
510529
}
511530
}
512531
}
532+
`
533+
534+
const storageContract = `
535+
pragma solidity >=0.8.2 <0.9.0;
536+
537+
contract Storage {
538+
539+
uint256 public number;
540+
541+
function store(uint256 num) public {
542+
number = num;
543+
}
544+
}
545+
`
546+
547+
const retrieverContract = `
548+
pragma solidity >=0.8.2 <0.9.0;
549+
550+
import "storage/Storage.sol";
551+
552+
contract Retriever is Storage {
553+
554+
function retrieve() public view returns (uint256){
555+
return number;
556+
}
557+
}
513558
`

0 commit comments

Comments
 (0)