Skip to content

Commit 7d0b5ff

Browse files
author
ci-bot
committed
Fixed low level interaction e2e
1 parent b571cbd commit 7d0b5ff

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

apps/remix-ide-e2e/src/commands/sendLowLevelTx.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ import EventEmitter from 'events'
44
class sendLowLevelTx extends EventEmitter {
55
command (this: NightwatchBrowser, index: number, value: string, callData: string): NightwatchBrowser {
66
this.api.waitForElementPresent(`[data-id="fallbackExecute-${index}"]`)
7-
.execute(function () {
7+
.execute(function (index) {
88
const executeButton = document.querySelector(`[data-id="fallbackExecute-${index}"]`) as HTMLElement
99
if (executeButton) {
1010
executeButton.scrollIntoView({ behavior: 'auto', block: 'center' })
1111
}
12-
})
12+
}, [index])
1313
.clearValue(`[data-id="fallbackInput-${index}"]`)
1414
.sendKeys(`[data-id="fallbackInput-${index}"]`, ['_', this.api.Keys.BACK_SPACE, callData])
1515
.waitForElementVisible(`[data-id="contractItem-sendValue-${index}"]`)
16-
.clearValue('[data-id="contractItem-sendValue-${index}"]')
17-
.sendKeys('[data-id="contractItem-sendValue-${index}"]', value)
16+
.clearValue(`[data-id="contractItem-sendValue-${index}"]`)
17+
.setValue(`[data-id="contractItem-sendValue-${index}"]`, value)
1818
.pause(2000)
1919
.scrollAndClick(`[data-id="fallbackExecute-${index}"]`)
2020
.perform(() => {

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ module.exports = {
4343
browser.getAddressAtPosition(0, (address) => {
4444
browser.sendLowLevelTx(0, '0', '0xa')
4545
.pause(1000)
46-
.waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`)
47-
.assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, 'The calldata should be a valid hexadecimal value with size of at least one byte.')
46+
.waitForElementVisible(`#instance${address} [data-id="deployAndRunLLTxError"]`)
47+
.assert.containsText(`#instance${address} [data-id="deployAndRunLLTxError"]`, 'The calldata should be a valid hexadecimal value with size of at least one byte.')
4848
.perform(done())
4949
})
5050
})
@@ -55,8 +55,8 @@ module.exports = {
5555
browser.getAddressAtPosition(0, (address) => {
5656
browser.sendLowLevelTx(0, '0', '0x1aa')
5757
.pause(1000)
58-
.waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`)
59-
.assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, 'The calldata should be a valid hexadecimal value.')
58+
.waitForElementVisible(`#instance${address} [data-id="deployAndRunLLTxError"]`)
59+
.assert.containsText(`#instance${address} [data-id="deployAndRunLLTxError"]`, 'The calldata should be a valid hexadecimal value.')
6060
.perform(done())
6161
})
6262
})
@@ -106,8 +106,8 @@ module.exports = {
106106
browser.perform((done) => {
107107
browser.getAddressAtPosition(0, (address) => {
108108
browser.sendLowLevelTx(0, '0', '0xaa')
109-
.waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`)
110-
.assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, '\'Fallback\' function is not defined')
109+
.waitForElementVisible(`#instance${address} [data-id="deployAndRunLLTxError"]`)
110+
.assert.containsText(`#instance${address} [data-id="deployAndRunLLTxError"]`, '\'Fallback\' function is not defined')
111111
.perform(done())
112112
})
113113
})
@@ -121,7 +121,7 @@ module.exports = {
121121
.clickInstance(0)
122122
.perform((done) => {
123123
browser.getAddressAtPosition(0, (address) => {
124-
browser.sendLowLevelTx(address, '1', '')
124+
browser.sendLowLevelTx(0, '1', '')
125125
.journalLastChildIncludes('to: CheckSpecials.(fallback)')
126126
.journalLastChildIncludes('value: 1 wei')
127127
.journalLastChildIncludes('data: 0x')
@@ -133,7 +133,7 @@ module.exports = {
133133
// don't need to redeploy it, same contract
134134
browser.perform((done) => {
135135
browser.getAddressAtPosition(0, (address) => {
136-
browser.sendLowLevelTx(address, '1', '0xaa')
136+
browser.sendLowLevelTx(0, '1', '0xaa')
137137
.journalLastChildIncludes('to: CheckSpecials.(fallback)')
138138
.journalLastChildIncludes('value: 1 wei')
139139
.journalLastChildIncludes('data: 0xaa')
@@ -150,10 +150,10 @@ module.exports = {
150150
.clickInstance(0)
151151
.perform((done) => {
152152
browser.getAddressAtPosition(0, (address) => {
153-
browser.sendLowLevelTx(address, '1', '')
153+
browser.sendLowLevelTx(0, '1', '')
154154
.pause(1000)
155-
.waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`)
156-
.assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, 'should have either \'receive\' or payable \'fallback\'')
155+
.waitForElementVisible(`#instance${address} [data-id="deployAndRunLLTxError"]`)
156+
.assert.containsText(`#instance${address} [data-id="deployAndRunLLTxError"]`, 'should have either \'receive\' or payable \'fallback\'')
157157
.perform(done())
158158
})
159159
})
@@ -172,7 +172,7 @@ module.exports = {
172172
.clickInstance(0).pause(1000)
173173
.perform((done) => {
174174
browser.getAddressAtPosition(0, (address) => {
175-
browser.sendLowLevelTx(address, '999999998765257135', '0xaa')
175+
browser.sendLowLevelTx(0, '999999998765257135', '0xaa')
176176
.journalLastChildIncludes('to: CheckSpecials.(fallback)')
177177
.journalLastChildIncludes('value: 999999998765257135 wei')
178178
.journalLastChildIncludes('data: 0xaa')
@@ -183,7 +183,7 @@ module.exports = {
183183
'Use special functions receive/fallback - receive and fallback are declared and payable, sending wei #group6': '' + function (browser: NightwatchBrowser) {
184184
browser.perform((done) => {
185185
browser.getAddressAtPosition(0, (address) => {
186-
browser.sendLowLevelTx(address, '1', '')
186+
browser.sendLowLevelTx(0, '1', '')
187187
.pause(1000)
188188
.journalLastChildIncludes('to: CheckSpecials.(receive)')
189189
.journalLastChildIncludes('value: 1 wei')
@@ -205,10 +205,10 @@ module.exports = {
205205
.pause(1000)
206206
.perform((done) => {
207207
browser.getAddressAtPosition(0, (address) => {
208-
browser.sendLowLevelTx(address, '0', '')
208+
browser.sendLowLevelTx(0, '0', '')
209209
.pause(1000)
210-
.waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`)
211-
.assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, 'Both \'receive\' and \'fallback\' functions are not defined')
210+
.waitForElementVisible(`#instance${address} [data-id="deployAndRunLLTxError"]`)
211+
.assert.containsText(`#instance${address} [data-id="deployAndRunLLTxError"]`, 'Both \'receive\' and \'fallback\' functions are not defined')
212212
.perform(done())
213213
})
214214
})

apps/remix-ide-e2e/src/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ declare module 'nightwatch' {
5858
setSolidityCompilerVersion(version: string): NightwatchBrowser
5959
clickElementAtPosition(cssSelector: string, index: number, opt?: {forceSelectIfUnselected: boolean}): NightwatchBrowser
6060
notContainsText(cssSelector: string, text: string): NightwatchBrowser
61-
sendLowLevelTx(address: string, value: string, callData: string): NightwatchBrowser
61+
sendLowLevelTx(index: number, value: string, callData: string): NightwatchBrowser
6262
journalLastChild(val: string): NightwatchBrowser
6363
checkTerminalFilter(filter: string, test: string, notContain: boolean): NightwatchBrowser
6464
noWorkerErrorFor(version: string): NightwatchBrowser

libs/remix-ui/run-tab-deployed-contracts/src/lib/components/DeployedContractItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export function DeployedContractItem({ contract, index }: DeployedContractItemPr
208208
index,
209209
false,
210210
funcABI,
211-
'',
211+
calldata,
212212
contract,
213213
-1, // Use -1 for low level interactions
214214
{ value: sendValue, gasLimit: gasLimitValue }
@@ -605,7 +605,7 @@ export function DeployedContractItem({ contract, index }: DeployedContractItemPr
605605
</button>
606606
</div>
607607
{llIError && (
608-
<div className="alert alert-danger mt-2 p-2" role="alert" style={{ fontSize: '0.75rem', wordWrap: 'break-word', overflowWrap: 'break-word' }}>
608+
<div data-id="deployAndRunLLTxError" className="alert alert-danger mt-2 p-2" role="alert" style={{ fontSize: '0.75rem', wordWrap: 'break-word', overflowWrap: 'break-word' }}>
609609
{llIError}
610610
</div>
611611
)}

0 commit comments

Comments
 (0)