Skip to content

Commit 68b798c

Browse files
authored
Merge pull request #6175 from ethereum/feature/new-code-editor-ux
Add editor UI with compile/run actions, and AI assistant controls
2 parents 51d9f0d + 6f123d1 commit 68b798c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1253
-292
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
'use strict'
2+
3+
import { NightwatchBrowser } from 'nightwatch'
4+
import init from '../helpers/init'
5+
6+
module.exports = {
7+
'@disabled': true,
8+
before: function (browser: NightwatchBrowser, done: VoidFunction) {
9+
init(browser, done)
10+
},
11+
'@sources': function () {
12+
return []
13+
},
14+
15+
'Should toggle AI Copilot status in the bottom bar (Simplified)': function (browser: NightwatchBrowser) {
16+
const statusTextSelector = '[data-id="remixui_status_bottom_bar"] span.small';
17+
const toggleInputSelector = '[data-id="copilot_toggle"]';
18+
19+
browser
20+
.waitForElementVisible('[data-id="remixui_status_bottom_bar"]', 5000)
21+
.waitForElementContainsText(statusTextSelector, 'RemixAI Copilot', 1000)
22+
.perform((done) => {
23+
browser.getText(statusTextSelector, (result) => {
24+
const currentStatusText = result.value as string
25+
const isCurrentlyDisabled = currentStatusText.includes('(disabled)')
26+
const expectedStatusAfterToggle = isCurrentlyDisabled ? '(enabled)' : '(disabled)'
27+
browser.click(toggleInputSelector)
28+
.waitForElementContainsText(statusTextSelector, expectedStatusAfterToggle, 10000)
29+
done()
30+
});
31+
});
32+
}
33+
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module.exports = {
3737
.waitForElementVisible('[data-path="Semaphore - 1/circuits/simple.circom"]')
3838
.waitForElementPresent('[data-id="verticalIconsKindcircuit-compiler"]')
3939
.waitForElementVisible('[data-id="verticalIconsKindcircuit-compiler"]')
40-
.click('[data-id="play-editor"]')
40+
.click('[data-id="compile-action"]')
4141
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Everything went okay')
4242
.waitForElementPresent('[data-id="treeViewLitreeViewItemcircuits/.bin/simple_js"]')
4343
.openFile('circuits/.bin/simple_js')
@@ -204,7 +204,7 @@ module.exports = {
204204
.waitForElementVisible('[data-path="Hash Checker - 1/scripts/groth16/groth16_trusted_setup.ts"]')
205205
.waitForElementPresent('[data-id="verticalIconsKindcircuit-compiler"]')
206206
.waitForElementVisible('[data-id="verticalIconsKindcircuit-compiler"]')
207-
.click('[data-id="play-editor"]')
207+
.click('[data-id="compile-action"]')
208208
.pause(10000)
209209
.journalLastChildIncludes('newZkey')
210210
.pause(25000)
@@ -218,7 +218,7 @@ module.exports = {
218218
.waitForElementVisible('[data-path="Hash Checker - 1/scripts/groth16/groth16_zkproof.ts"]')
219219
.waitForElementPresent('[data-id="verticalIconsKindcircuit-compiler"]')
220220
.waitForElementVisible('[data-id="verticalIconsKindcircuit-compiler"]')
221-
.click('[data-id="play-editor"]')
221+
.click('[data-id="compile-action"]')
222222
.pause(2000)
223223
.journalLastChildIncludes('Compiling circuits/calculate_hash.circom')
224224
.pause(5000)
@@ -238,7 +238,7 @@ module.exports = {
238238
.waitForElementVisible('[data-path="Hash Checker - 1/scripts/plonk/plonk_trusted_setup.ts"]')
239239
.waitForElementPresent('[data-id="verticalIconsKindcircuit-compiler"]')
240240
.waitForElementVisible('[data-id="verticalIconsKindcircuit-compiler"]')
241-
.click('[data-id="play-editor"]')
241+
.click('[data-id="compile-action"]')
242242
.pause(7000)
243243
.journalLastChildIncludes('plonk setup')
244244
.pause(10000)
@@ -252,7 +252,7 @@ module.exports = {
252252
.waitForElementVisible('[data-path="Hash Checker - 1/scripts/plonk/plonk_zkproof.ts"]')
253253
.waitForElementPresent('[data-id="verticalIconsKindcircuit-compiler"]')
254254
.waitForElementVisible('[data-id="verticalIconsKindcircuit-compiler"]')
255-
.click('[data-id="play-editor"]')
255+
.click('[data-id="compile-action"]')
256256
.pause(2000)
257257
.journalLastChildIncludes('Compiling circuits/calculate_hash.circom')
258258
.pause(5000)
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
'use strict'
2+
3+
import { NightwatchBrowser } from 'nightwatch'
4+
import init from '../helpers/init'
5+
6+
module.exports = {
7+
'@disabled': true,
8+
before: function (browser: NightwatchBrowser, done: VoidFunction) {
9+
init(browser, done)
10+
},
11+
'@sources': function () {
12+
return []
13+
},
14+
15+
'Compile using the widget #group1': function (browser: NightwatchBrowser) {
16+
browser
17+
.openFile('contracts/3_Ballot.sol')
18+
.click('[data-id="compile-action"]')
19+
.waitForElementVisible('[data-id="compile_group"] i.fa-check', 10000)
20+
.verifyContracts(['Ballot'])
21+
},
22+
23+
'Run script using the widget #group2': function (browser: NightwatchBrowser) {
24+
browser
25+
.openFile('scripts/deploy_with_web3.ts')
26+
.click('[data-id="compile-action"]')
27+
.waitForElementVisible('[data-id="compile_group"] i.fa-check', 10000)
28+
},
29+
30+
'Should activate Solidity Static Analysis and show "Solidity Analyzers" title from compile dropdown #group3': function (browser: NightwatchBrowser) {
31+
browser
32+
.openFile('contracts/3_Ballot.sol')
33+
.click('[data-id="compile-dropdown-trigger"]')
34+
.waitForElementVisible('[data-id="compile-dropdown-panel"]', 5000)
35+
.click('[data-id="compile-run-analysis-menu-item"]')
36+
.waitForElementVisible('[data-id="compile-run-analysis-menu-item-panel"]', 5000)
37+
.click('[data-id="run-remix-analysis-submenu-item"]')
38+
.waitForElementVisible('#icon-panel div[plugin="solidityStaticAnalysis"]', 10000)
39+
.waitForElementVisible('[data-id="sidePanelSwapitTitle"]', 5000)
40+
.assert.textContains('[data-id="sidePanelSwapitTitle"]', 'SOLIDITY ANALYZERS', 'Solidity Analyzers title should be visible.')
41+
.waitForElementVisible('#side-panel', 5000)
42+
.verifyContracts(['Ballot'])
43+
},
44+
45+
'Should run Solidity Scan and display results in terminal #group4': function (browser: NightwatchBrowser) {
46+
browser
47+
.openFile('contracts/3_Ballot.sol')
48+
.click('[data-id="compile-dropdown-trigger"]')
49+
.waitForElementVisible('[data-id="compile-dropdown-panel"]', 5000)
50+
.click('[data-id="compile-run-analysis-menu-item"]')
51+
.waitForElementVisible('[data-id="compile-run-analysis-menu-item-panel"]', 5000)
52+
.click('[data-id="run-solidity-scan-submenu-item"]')
53+
.waitForElementVisible('[data-id="SolidityScanPermissionHandlerModalDialogModalTitle-react"]', 10000)
54+
.waitForElementVisible('[data-id="SolidityScanPermissionHandler-modal-footer-ok-react"]', 5000)
55+
.click('[data-id="SolidityScanPermissionHandler-modal-footer-ok-react"]')
56+
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Scan Summary:', 30000)
57+
.verifyContracts(['Ballot'])
58+
}
59+
60+
61+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const tests = {
5353
.frameParent()
5454
.clickLaunchIcon('filePanel')
5555
.addFile('receiptStatusScript.ts', { content: receiptStatusScript })
56-
.click('*[data-id="play-editor"]') // run the script
56+
.click('*[data-id="compile-action"]') // run the script
5757
.waitForElementContainsText('*[data-id="terminalJournal"]', 'Already Verified', 60000)
5858
}
5959
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = {
1616
.openFile('contracts/3_Ballot.sol')
1717
.addFile('scripts/decorators.ts', { content: testScriptSet })
1818
.pause(2000)
19-
.click('[data-id="play-editor"]')
19+
.click('[data-id="compile-action"]')
2020
.pause(4000)
2121
.useXpath()
2222
.waitForElementContainsText('//*[@id="fileExplorerView"]//*[@data-id="file-decoration-error-contracts/2_Owner.sol"]', '2')
@@ -37,15 +37,15 @@ module.exports = {
3737
.useCss()
3838
.addFile('scripts/clearballot.ts', { content: testScriptClearBallot })
3939
.pause(2000)
40-
.click('[data-id="play-editor"]')
40+
.click('[data-id="compile-action"]')
4141
.pause(4000)
4242
.waitForElementNotPresent('[data-id="file-decoration-custom-contracts/3_Ballot.sol"]', 10000)
4343
},
4444
'clear all decorators': function (browser: NightwatchBrowser) {
4545
browser
4646
.addFile('scripts/clearall.ts', { content: testScriptClear })
4747
.pause(2000)
48-
.click('[data-id="play-editor"]')
48+
.click('[data-id="compile-action"]')
4949
.pause(4000)
5050
.waitForElementNotPresent('[data-id="file-decoration-error-contracts/2_Owner.sol"]', 10000)
5151
.waitForElementNotPresent('[data-id="file-decoration-warning-contracts/1_Storage.sol"]', 10000)

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { NightwatchBrowser } from 'nightwatch'
33

44

5-
module.exports = {
5+
const tests = {
66
'@disabled': true,
77
'Should load the testmigration url #group1': function (browser: NightwatchBrowser) {
88
browser.url('http://127.0.0.1:8080?e2e_testmigration=true')
@@ -137,3 +137,11 @@ module.exports = {
137137
},
138138

139139
}
140+
141+
const isFirefox = browser.options.desiredCapabilities?.browserName === 'firefox'
142+
143+
if (isFirefox) {
144+
module.exports = tests
145+
} else {
146+
module.exports = {}
147+
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = {
2525
'Should compile a simple circuit using editor play button #group1': '' + function (browser: NightwatchBrowser) {
2626
browser
2727
.openFile('src/main.nr')
28-
.click('[data-id="play-editor"]')
28+
.click('[data-id="compile-action"]')
2929
.clickLaunchIcon('noir-compiler')
3030
.waitForElementPresent('[data-id="view-noir-compilation-result"]')
3131
.click('[data-id="view-noir-compilation-result"]')
@@ -37,7 +37,7 @@ module.exports = {
3737
browser
3838
.clickLaunchIcon('filePanel')
3939
.openFile('tests/multiplier.test.ts')
40-
.click('[data-id="play-editor"]')
40+
.click('[data-id="compile-action"]')
4141
.waitForElementContainsText('*[data-id="terminalJournal"]', ' CHECK PROOF ', 60000)
4242
}
4343
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ module.exports = {
8181
.addFile('testScript.ts', { content: testScript })
8282
.clearConsole()
8383
.pause(10000)
84-
.waitForElementVisible('*[data-id="play-editor"]')
85-
.click('*[data-id="play-editor"]')
84+
.waitForElementVisible('*[data-id="compile-action"]')
85+
.click('*[data-id="compile-action"]')
8686
.waitForElementVisible({
8787
locateStrategy: 'xpath',
8888
selector: "//span[@class='text-danger' and contains(., 'exceed maximum block range')]"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ module.exports = {
168168
.click('*[data-id="treeViewLitreeViewItemscripts"]')
169169
.waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/deploy_with_web3.ts"]')
170170
.openFile('scripts/deploy_with_web3.ts')
171-
.click('[data-id="play-editor"]')
171+
.click('[data-id="compile-action"]')
172172
.waitForElementContainsText('*[data-id="terminalJournal"]', 'address:')
173173
.openFile('.states/vm-london/state.json')
174174
.waitForElementPresent('[data-id="treeViewDivDraggableItem.states/vm-london/state.json"]')

apps/remix-ide-e2e/src/tests/script-runner.test.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ const tests = {
2424
.click('*[data-id="treeViewDivtreeViewItemscripts"]')
2525
.waitForElementVisible('*[data-id="treeViewDivtreeViewItemscripts/deploy_with_ethers.ts"]')
2626
.click('*[data-id="treeViewDivtreeViewItemscripts/deploy_with_ethers.ts"]')
27-
.waitForElementVisible('button[data-id="script-config"]')
28-
.click('button[data-id="script-config"]')
27+
.waitForElementVisible('*[data-id="run-script-dropdown-trigger"]')
28+
.click('*[data-id="run-script-dropdown-trigger"]')
29+
.click('*[data-id="open-script-configuration-menu-item"]')
2930
.waitForElementVisible('[data-id="sr-loaded-default"]')
3031
.waitForElementVisible('[data-id="dependency-ethers-^5"]')
3132
.waitForElementVisible('[data-id="sr-notloaded-ethers6"]')
@@ -110,8 +111,10 @@ const tests = {
110111
'reset to default after template': function (browser: NightwatchBrowser) {
111112
browser
112113
.refreshPage()
113-
.waitForElementVisible('button[data-id="script-config"]')
114-
.click('button[data-id="script-config"]')
114+
.openFile('scripts/deploy.ts')
115+
.waitForElementVisible('*[data-id="run-script-dropdown-trigger"]')
116+
.click('*[data-id="run-script-dropdown-trigger"]')
117+
.click('*[data-id="open-script-configuration-menu-item"]')
115118
.waitForElementVisible('[data-id="sr-notloaded-default"]')
116119
.waitForElementVisible('[data-id="sr-loaded-ethers6"]')
117120
},

0 commit comments

Comments
 (0)