unpin & interact

flakycookbook
aniket-engg 7 months ago committed by Aniket
parent 9dbfc43bfe
commit c478b0a3df
  1. 79
      apps/remix-ide-e2e/src/tests/pinned_contracts.test.ts

@ -32,30 +32,57 @@ module.exports = {
.assert.elementPresent('*[data-id="pinnedInstance0xd9145CCE52D386f254917e481eB44e9943F39138"]')
.assert.hasClass('*[data-id="universalDappUiUdappUnpin"]', 'text-success')
},
'Interact with pinned contract #group1': function (browser: NightwatchBrowser) {
browser
.click('*[data-id="universalDappUiTitleExpander0"]')
.assert.elementPresent('*[data-id="instanceContractBal"]')
.assert.elementPresent('*[data-id="instanceContractPinnedAt"]')
.assert.elementPresent('*[data-id="instanceContractFilePath"]')
.assert.textContains('*[data-id="instanceContractFilePath"]', 'default_workspace/contracts/1_Storage.sol')
.clickFunction('retrieve - call')
.testFunction('last',
{
to: 'Storage.retrieve() 0xd9145CCE52D386f254917e481eB44e9943F39138',
'decoded output': { "0": "uint256: 0" }
})
.clickFunction('store - transact (not payable)', { types: 'uint256 num', values: '35' })
.testFunction('last',
{
status: '0x1 Transaction mined and execution succeed',
'decoded input': { "uint256 num": "35" }
})
.clickFunction('retrieve - call')
.testFunction('last',
{
to: 'Storage.retrieve() 0xd9145CCE52D386f254917e481eB44e9943F39138',
'decoded output': { "0": "uint256: 35" }
})
},
'Interact with pinned contract #group1': function (browser: NightwatchBrowser) {
browser
.click('*[data-id="universalDappUiTitleExpander0"]')
.assert.elementPresent('*[data-id="instanceContractBal"]')
.assert.elementPresent('*[data-id="instanceContractPinnedAt"]')
.assert.elementPresent('*[data-id="instanceContractFilePath"]')
.assert.textContains('*[data-id="instanceContractFilePath"]', 'default_workspace/contracts/1_Storage.sol')
.clickFunction('retrieve - call')
.testFunction('last',
{
to: 'Storage.retrieve() 0xd9145CCE52D386f254917e481eB44e9943F39138',
'decoded output': { "0": "uint256: 0" }
})
.clickFunction('store - transact (not payable)', { types: 'uint256 num', values: '35' })
.testFunction('last',
{
status: '0x1 Transaction mined and execution succeed',
'decoded input': { "uint256 num": "35" }
})
.clickFunction('retrieve - call')
.testFunction('last',
{
to: 'Storage.retrieve() 0xd9145CCE52D386f254917e481eB44e9943F39138',
'decoded output': { "0": "uint256: 35" }
})
},
'Unpin & interact #group1': function (browser: NightwatchBrowser) {
browser
.click('*[data-id="universalDappUiUdappUnpin"]')
.assert.textContains('*[data-id="NoPinnedInstanceText"]', 'No pinned contracts found for selected workspace & network')
.assert.not.elementPresent('*[data-id="deployAndRunNoInstanceText"]')
.click('*[data-id="universalDappUiTitleExpander0"]')
.assert.not.elementPresent('*[data-id="instanceContractPinnedAt"]')
.assert.not.elementPresent('*[data-id="instanceContractFilePath"]')
.clickFunction('retrieve - call')
.testFunction('last',
{
to: 'Storage.retrieve() 0xd9145CCE52D386f254917e481eB44e9943F39138',
'decoded output': { "0": "uint256: 35" }
})
.clickFunction('store - transact (not payable)', { types: 'uint256 num', values: '55' })
.testFunction('last',
{
status: '0x1 Transaction mined and execution succeed',
'decoded input': { "uint256 num": "55" }
})
.clickFunction('retrieve - call')
.testFunction('last',
{
to: 'Storage.retrieve() 0xd9145CCE52D386f254917e481eB44e9943F39138',
'decoded output': { "0": "uint256: 55" }
})
},
}
Loading…
Cancel
Save