From b1a9b046e0b5743c8329e9f5dcae611ff8547259 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 3 Apr 2024 19:17:01 +0530 Subject: [PATCH] unpin & interact --- .../src/tests/pinned_contracts.test.ts | 79 +++++++++++++------ 1 file changed, 53 insertions(+), 26 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/pinned_contracts.test.ts b/apps/remix-ide-e2e/src/tests/pinned_contracts.test.ts index e13b482e4e..7d61d86178 100644 --- a/apps/remix-ide-e2e/src/tests/pinned_contracts.test.ts +++ b/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" } + }) + }, } \ No newline at end of file