Skip to content

Commit ac0a5fe

Browse files
authored
Merge pull request #6378 from remix-project-org/extend-modal
Template Explorer Modal
2 parents 8f2d761 + 8f9083e commit ac0a5fe

File tree

114 files changed

+13506
-1316
lines changed

Some content is hidden

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

114 files changed

+13506
-1316
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ parameters:
1414
default: ""
1515
run_file_tests_keyword:
1616
type: enum
17-
enum: ["", "ai_panel", "ballot", "ballot_0_4_14", "blockchain", "bottom-bar", "circom", "code_format", "compile_run_widget", "compiler_api", "contract_flattener", "contract_verification", "debugger", "defaultLayout", "deploy_vefiry", "dgit_github", "dgit_local", "editor", "editorHoverContext", "editorReferences", "editor_error_marker", "editor_line_text", "eip1153", "eip7702", "environment-account", "erc721", "etherscan_api", "expandAllFolders", "fileExplorer", "fileManager_api", "file_decorator", "file_explorer_context_menu", "file_explorer_dragdrop", "file_explorer_multiselect", "generalSettings", "gist", "homeTab", "importFromGithub", "layout", "learneth", "libraryDeployment", "matomo-bot-detection", "matomo-consent", "mcp_all_resources", "mcp_all_tools", "mcp_server_complete", "mcp_server_connection", "mcp_server_lifecycle", "mcp_workflow_integration", "metamask", "migrateFileSystem", "noir", "pinned_contracts", "pinned_plugin", "pluginManager", "plugin_api", "providers", "proxy_oz_v4", "proxy_oz_v5", "proxy_oz_v5_non_shanghai_runtime", "publishContract", "quickDapp_metamask", "recorder", "remixd", "runAndDeploy", "script-runner", "search", "signingMessage", "sol2uml", "solidityImport", "solidityUnittests", "specialFunctions", "staticAnalysis", "stressEditor", "templates", "terminal", "transactionExecution", "txListener", "uniswap_v4_core", "url", "usingWebWorker", "verticalIconsPanel", "vm_state", "vyper_api", "walkthrough", "workspace", "workspace_git"]
17+
enum: ["", "ai_panel", "ballot", "ballot_0_4_14", "blockchain", "bottom-bar", "circom", "code_format", "compile_run_widget", "compiler_api", "contract_flattener", "contract_verification", "debugger", "defaultLayout", "deploy_vefiry", "dgit_github", "dgit_local", "editor", "editorHoverContext", "editorReferences", "editor_error_marker", "editor_line_text", "eip1153", "eip7702", "environment-account", "erc721", "etherscan_api", "expandAllFolders", "fileExplorer", "fileManager_api", "file_decorator", "file_explorer_context_menu", "file_explorer_dragdrop", "file_explorer_multiselect", "generalSettings", "gist", "homeTab", "importFromGithub", "layout", "learneth", "libraryDeployment", "matomo-bot-detection", "matomo-consent", "mcp_all_resources", "mcp_all_tools", "mcp_server_complete", "mcp_server_connection", "mcp_server_lifecycle", "mcp_workflow_integration", "metamask", "migrateFileSystem", "noir", "pinned_contracts", "pinned_plugin", "pluginManager", "plugin_api", "providers", "proxy_oz_v4", "proxy_oz_v5", "proxy_oz_v5_non_shanghai_runtime", "publishContract", "quickDapp_metamask", "recorder", "remixd", "runAndDeploy", "script-runner", "search", "signingMessage", "sol2uml", "solidityImport", "solidityUnittests", "specialFunctions", "staticAnalysis", "stressEditor", "template_exp_modal", "terminal", "transactionExecution", "txListener", "uniswap_v4_core", "url", "usingWebWorker", "verticalIconsPanel", "vm_state", "vyper_api", "walkthrough", "workspace", "workspace_git"]
1818
default: ""
1919
run_flaky_tests:
2020
type: boolean

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

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,23 @@ module.exports = {
9696
browser
9797
.clickLaunchIcon('filePanel')
9898
.click('*[data-id="workspacesSelect"]')
99+
.pause(2000)
99100
.click('*[data-id="workspacecreate"]')
100-
.waitForElementPresent('*[data-id="create-remixDefault"]')
101-
.scrollAndClick('*[data-id="create-remixDefault"]')
102-
.waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]')
103-
.scrollAndClick('*[data-id="modalDialogCustomPromptTextCreate"]')
104-
.setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_remix_default')
105-
// eslint-disable-next-line dot-notation
106-
.execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_remix_default' })
107-
.modalFooterOKClick('TemplatesSelection')
101+
.waitForElementVisible('*[data-id="template-explorer-modal-react"]')
102+
.waitForElementVisible('*[data-id="template-explorer-template-container"]')
103+
.click('*[data-id="template-explorer-template-container"]')
104+
.waitForElementPresent('*[data-id="template-card-remixDefault-0"]')
105+
.click('*[data-id="template-card-remixDefault-0"]')
106+
.waitForElementVisible('*[data-id="workspace-details-section"]')
107+
.waitForElementVisible('*[data-id="default-workspace-name-edit-icon"]')
108+
.click('*[data-id="default-workspace-name-edit-icon"]')
109+
.waitForElementVisible('*[data-id="workspace-name-input"]')
110+
.setValue('*[data-id="workspace-name-input"]', 'workspace_remix_default')
111+
.click('*[data-id="default-workspace-name-edit-icon"]')
112+
.waitForElementVisible('*[data-id="default-workspace-name-span"]')
113+
.assert.textContains('*[data-id="default-workspace-name-span"]', 'WORKSPACE_REMIX_DEFAULT', 'Workspace name is correct')
108114
.pause(1000)
115+
.click('*[data-id="validateWorkspaceButton"]')
109116
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]')
110117
.addFile('contracts/lib/storage/src/Storage.sol', { content: storageContract})
111118
.addFile('remappings.txt', { content: 'storage=contracts/lib/storage/src' })

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

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,16 @@ module.exports = {
1313
browser
1414
.clickLaunchIcon('filePanel')
1515
.click('*[data-id="workspacesSelect"]')
16+
.pause(2000)
1617
.click('*[data-id="workspacecreate"]')
17-
.waitForElementPresent('*[data-id="create-semaphore"]')
18-
.scrollAndClick('*[data-id="create-semaphore"]')
19-
.modalFooterOKClick('TemplatesSelection')
18+
.waitForElementVisible('*[data-id="template-explorer-modal-react"]')
19+
.waitForElementVisible('*[data-id="template-explorer-template-container"]')
20+
.click('*[data-id="template-explorer-template-container"]')
21+
.waitForElementVisible('*[data-id="template-explorer-template-container"]')
22+
.scrollInto('*[data-id="template-category-Circom ZKP"]')
23+
.waitForElementVisible('*[data-id="template-card-semaphore-0"]')
24+
.click('*[data-id="template-card-semaphore-0"]')
25+
.click('*[data-id="validate-semaphoreworkspace-button"]')
2026
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcircuits"]')
2127
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcircuits/semaphore.circom"]')
2228
.waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts"]')
@@ -33,8 +39,8 @@ module.exports = {
3339
'Should compile a simple circuit using editor play button #group1': function (browser: NightwatchBrowser) {
3440
browser
3541
.click('[data-id="treeViewLitreeViewItemcircuits/simple.circom"]')
36-
.waitForElementPresent('[data-path="Semaphore - 1/circuits/simple.circom"]')
37-
.waitForElementVisible('[data-path="Semaphore - 1/circuits/simple.circom"]')
42+
.waitForElementPresent('[data-path="circuits/simple.circom"]')
43+
.waitForElementVisible('[data-path="circuits/simple.circom"]')
3844
.waitForElementPresent('[data-id="verticalIconsKindcircuit-compiler"]')
3945
.waitForElementVisible('[data-id="verticalIconsKindcircuit-compiler"]')
4046
.click('[data-id="compile-action"]')
@@ -65,8 +71,8 @@ module.exports = {
6571
'Should compile a simple circuit using compile button in circom plugin #group2': function (browser: NightwatchBrowser) {
6672
browser
6773
.click('[data-id="treeViewLitreeViewItemcircuits/simple.circom"]')
68-
.waitForElementPresent('[data-path="Semaphore - 1/circuits/simple.circom"]')
69-
.waitForElementVisible('[data-path="Semaphore - 1/circuits/simple.circom"]')
74+
.waitForElementPresent('[data-path="circuits/simple.circom"]')
75+
.waitForElementVisible('[data-path="circuits/simple.circom"]')
7076
.clickLaunchIcon('circuit-compiler')
7177
.frame(0)
7278
.waitForElementPresent('button[data-id="compile_circuit_btn"]')
@@ -114,8 +120,8 @@ module.exports = {
114120
'Should compile a simple circuit using CTRL + S from the editor #group3': function (browser: NightwatchBrowser) {
115121
browser
116122
.click('[data-id="treeViewLitreeViewItemcircuits/simple.circom"]')
117-
.waitForElementPresent('[data-path="Semaphore - 1/circuits/simple.circom"]')
118-
.waitForElementVisible('[data-path="Semaphore - 1/circuits/simple.circom"]')
123+
.waitForElementPresent('[data-path="circuits/simple.circom"]')
124+
.waitForElementVisible('[data-path="circuits/simple.circom"]')
119125
.waitForElementPresent('[data-id="verticalIconsKindcircuit-compiler"]')
120126
.waitForElementVisible('[data-id="verticalIconsKindcircuit-compiler"]')
121127
.perform(function () {
@@ -134,8 +140,8 @@ module.exports = {
134140
'Should display warnings for compiled circuit without pragma version #group4': function (browser: NightwatchBrowser) {
135141
browser
136142
.click('[data-id="treeViewLitreeViewItemcircuits/simple.circom"]')
137-
.waitForElementPresent('[data-path="Semaphore - 1/circuits/simple.circom"]')
138-
.waitForElementVisible('[data-path="Semaphore - 1/circuits/simple.circom"]')
143+
.waitForElementPresent('[data-path="circuits/simple.circom"]')
144+
.waitForElementVisible('[data-path="circuits/simple.circom"]')
139145
.setEditorValue(warningCircuit)
140146
.clickLaunchIcon('circuit-compiler')
141147
.frame(0)
@@ -184,9 +190,9 @@ module.exports = {
184190
.clickLaunchIcon('filePanel')
185191
.click('*[data-id="workspacesSelect"]')
186192
.click('*[data-id="workspacecreate"]')
187-
.waitForElementPresent('*[data-id="create-hashchecker"]')
188-
.scrollAndClick('*[data-id="create-hashchecker"]')
189-
.modalFooterOKClick('TemplatesSelection')
193+
.waitForElementPresent('*[data-id="template-card-hashchecker-1"]')
194+
.click('*[data-id="template-card-hashchecker-1"]')
195+
.click('*[data-id="validate-hashcheckerworkspace-button"]')
190196
.pause(100)
191197
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcircuits"]')
192198
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcircuits/calculate_hash.circom"]')
@@ -204,8 +210,8 @@ module.exports = {
204210
'Should run groth16 trusted setup script for hash checker #group5': function (browser: NightwatchBrowser) {
205211
browser
206212
.click('[data-id="treeViewLitreeViewItemscripts/groth16/groth16_trusted_setup.ts"]')
207-
.waitForElementPresent('[data-path="Hash Checker - 1/scripts/groth16/groth16_trusted_setup.ts"]')
208-
.waitForElementVisible('[data-path="Hash Checker - 1/scripts/groth16/groth16_trusted_setup.ts"]')
213+
.waitForElementPresent('[data-path="scripts/groth16/groth16_trusted_setup.ts"]')
214+
.waitForElementVisible('[data-path="scripts/groth16/groth16_trusted_setup.ts"]')
209215
.waitForElementPresent('[data-id="verticalIconsKindcircuit-compiler"]')
210216
.waitForElementVisible('[data-id="verticalIconsKindcircuit-compiler"]')
211217
.click('[data-id="compile-action"]')
@@ -218,8 +224,8 @@ module.exports = {
218224
'Should run groth16 zkproof script for hash checker #group5': function (browser: NightwatchBrowser) {
219225
browser
220226
.click('[data-id="treeViewLitreeViewItemscripts/groth16/groth16_zkproof.ts"]')
221-
.waitForElementPresent('[data-path="Hash Checker - 1/scripts/groth16/groth16_zkproof.ts"]')
222-
.waitForElementVisible('[data-path="Hash Checker - 1/scripts/groth16/groth16_zkproof.ts"]')
227+
.waitForElementPresent('[data-path="scripts/groth16/groth16_zkproof.ts"]')
228+
.waitForElementVisible('[data-path="scripts/groth16/groth16_zkproof.ts"]')
223229
.waitForElementPresent('[data-id="verticalIconsKindcircuit-compiler"]')
224230
.waitForElementVisible('[data-id="verticalIconsKindcircuit-compiler"]')
225231
.click('[data-id="compile-action"]')
@@ -238,8 +244,8 @@ module.exports = {
238244
'Should run plonk trusted setup script for hash checker #group6': function (browser: NightwatchBrowser) {
239245
browser
240246
.click('[data-id="treeViewLitreeViewItemscripts/plonk/plonk_trusted_setup.ts"]')
241-
.waitForElementPresent('[data-path="Hash Checker - 1/scripts/plonk/plonk_trusted_setup.ts"]')
242-
.waitForElementVisible('[data-path="Hash Checker - 1/scripts/plonk/plonk_trusted_setup.ts"]')
247+
.waitForElementPresent('[data-path="scripts/plonk/plonk_trusted_setup.ts"]')
248+
.waitForElementVisible('[data-path="scripts/plonk/plonk_trusted_setup.ts"]')
243249
.waitForElementPresent('[data-id="verticalIconsKindcircuit-compiler"]')
244250
.waitForElementVisible('[data-id="verticalIconsKindcircuit-compiler"]')
245251
.click('[data-id="compile-action"]')
@@ -252,8 +258,8 @@ module.exports = {
252258
'Should run plonk zkproof script for hash checker #group6': function (browser: NightwatchBrowser) {
253259
browser
254260
.click('[data-id="treeViewLitreeViewItemscripts/plonk/plonk_zkproof.ts"]')
255-
.waitForElementPresent('[data-path="Hash Checker - 1/scripts/plonk/plonk_zkproof.ts"]')
256-
.waitForElementVisible('[data-path="Hash Checker - 1/scripts/plonk/plonk_zkproof.ts"]')
261+
.waitForElementPresent('[data-path="scripts/plonk/plonk_zkproof.ts"]')
262+
.waitForElementVisible('[data-path="scripts/plonk/plonk_zkproof.ts"]')
257263
.waitForElementPresent('[data-id="verticalIconsKindcircuit-compiler"]')
258264
.waitForElementVisible('[data-id="verticalIconsKindcircuit-compiler"]')
259265
.click('[data-id="compile-action"]')

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@ module.exports = {
1515
'Deploy SampleERC721 whose bytecode is very similar to ERC721': function (browser: NightwatchBrowser) {
1616
browser.clickLaunchIcon('filePanel')
1717
.click('*[data-id="workspacesSelect"]')
18+
.pause(2000)
1819
.click('*[data-id="workspacecreate"]')
19-
// create contract
20-
.waitForElementPresent('*[data-id="create-hashchecker"]')
21-
.scrollAndClick('*[data-id="create-ozerc721"]')
22-
.waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]')
23-
.scrollAndClick('*[data-id="modalDialogCustomPromptTextCreate"]')
24-
.setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_erc721')
25-
// eslint-disable-next-line dot-notation
26-
.execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_erc721' })
27-
.modalFooterOKClick('TemplatesSelection')
20+
.waitForElementVisible('*[data-id="template-explorer-modal-react"]')
21+
.waitForElementVisible('*[data-id="template-explorer-template-container"]')
22+
.click('*[data-id="template-explorer-template-container"]')
23+
.waitForElementVisible('*[data-id="template-explorer-template-container"]')
24+
.waitForElementVisible('*[data-id="contract-wizard-topcard"]')
25+
.click('*[data-id="contract-wizard-topcard"]')
26+
.waitForElementVisible('*[data-id="contract-wizard-container"]')
27+
.click('*[data-id="contract-wizard-contract-type-dropdown"]')
28+
.click('*[data-id="contract-wizard-contract-type-dropdown-item-erc721"]')
29+
.click('*[data-id="contract-wizard-validate-workspace-button"]')
2830
.pause(100)
2931
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]')
3032
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts/MyToken.sol"]')

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ module.exports = {
1414
.clickLaunchIcon('filePanel')
1515
.click('*[data-id="workspacesSelect"]')
1616
.click('*[data-id="workspacecreate"]')
17-
.waitForElementPresent('*[data-id="create-multNr"]')
18-
.scrollAndClick('*[data-id="create-multNr"]')
19-
.modalFooterOKClick('TemplatesSelection')
17+
.waitForElementPresent('*[data-id="template-card-multNr-0"]')
18+
.scrollAndClick('*[data-id="template-card-multNr-0"]')
19+
.click('*[data-id="validate-multNrworkspace-button"]')
2020
.waitForElementVisible('*[data-id="treeViewLitreeViewItemsrc"]')
2121
.waitForElementVisible('*[data-id="treeViewLitreeViewItemsrc/main.nr"]')
2222
.waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]')

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,23 @@ module.exports = {
4343
browser
4444
.clickLaunchIcon('filePanel')
4545
.click('*[data-id="workspacesSelect"]')
46+
.pause(2000)
4647
.click('*[data-id="workspacecreate"]')
47-
.waitForElementPresent('*[data-id="create-remixDefault"]')
48-
.scrollAndClick('*[data-id="create-remixDefault"]')
49-
.waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]')
50-
.scrollAndClick('*[data-id="modalDialogCustomPromptTextCreate"]')
51-
.setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_remix_default')
52-
// eslint-disable-next-line dot-notation
53-
.execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_remix_default' })
54-
.modalFooterOKClick('TemplatesSelection')
48+
.waitForElementVisible('*[data-id="template-explorer-modal-react"]')
49+
.waitForElementVisible('*[data-id="template-explorer-template-container"]')
50+
.click('*[data-id="template-explorer-template-container"]')
51+
.waitForElementPresent('*[data-id="template-card-remixDefault-0"]')
52+
.click('*[data-id="template-card-remixDefault-0"]')
53+
.waitForElementVisible('*[data-id="workspace-details-section"]')
54+
.waitForElementVisible('*[data-id="default-workspace-name-edit-icon"]')
55+
.click('*[data-id="default-workspace-name-edit-icon"]')
56+
.waitForElementVisible('*[data-id="workspace-name-input"]')
57+
.setValue('*[data-id="workspace-name-input"]', 'workspace_remix_default')
58+
.click('*[data-id="default-workspace-name-edit-icon"]')
59+
.waitForElementVisible('*[data-id="default-workspace-name-span"]')
60+
.assert.textContains('*[data-id="default-workspace-name-span"]', 'WORKSPACE_REMIX_DEFAULT', 'Workspace name is correct')
61+
.pause(1000)
62+
.click('*[data-id="validateWorkspaceButton"]')
5563
.clickLaunchIcon('udapp')
5664
.assert.elementPresent('*[data-id="deployedContracts"]')
5765
.assert.textContains('*[data-id="deployedContractsBadge"]', '0')

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,16 @@ const tests = {
7272
.pause(2000)
7373
.waitForElementVisible('*[data-id="workspacesSelect"]')
7474
.click('*[data-id="workspacesSelect"]')
75+
.pause(2000)
7576
.click('*[data-id="workspacecreate"]')
76-
.waitForElementPresent('*[data-id="create-semaphore"]')
77-
.scrollAndClick('*[data-id="create-semaphore"]')
78-
.modalFooterOKClick('TemplatesSelection')
77+
.waitForElementVisible('*[data-id="template-explorer-modal-react"]')
78+
.waitForElementVisible('*[data-id="template-explorer-template-container"]')
79+
.click('*[data-id="template-explorer-template-container"]')
80+
.waitForElementVisible('*[data-id="template-explorer-template-container"]')
81+
.scrollInto('*[data-id="template-category-Circom ZKP"]')
82+
.waitForElementVisible('*[data-id="template-card-semaphore-0"]')
83+
.click('*[data-id="template-card-semaphore-0"]')
84+
.click('*[data-id="validate-semaphoreworkspace-button"]')
7985
// .waitForElementVisible('*[data-id="treeViewLitreeViewItemcircuits/semaphore.circom"]')
8086
.waitForElementVisible({
8187
locateStrategy: 'xpath',
@@ -95,9 +101,9 @@ const tests = {
95101
.click('*[data-id="workspacesSelect"]')
96102
.click('*[data-id="workspacecreate"]')
97103
// .click('*[data-id="workspacesSelect"]')
98-
.waitForElementVisible('*[data-id="create-introToEIP7702"]')
99-
.click('*[data-id="create-introToEIP7702"]')
100-
.modalFooterOKClick('TemplatesSelection')
104+
.waitForElementVisible('*[data-id="template-card-simpleEip7702-2"]')
105+
.click('*[data-id="template-card-simpleEip7702-2"]')
106+
.click('*[data-id="validate-simpleEip7702workspace-button"]')
101107
// .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts/Example7702.sol"]')
102108
.waitForElementVisible({
103109
locateStrategy: 'xpath',
@@ -107,8 +113,8 @@ const tests = {
107113
locateStrategy: 'xpath',
108114
selector: "//li[@data-id='UIScriptRunner' and @role='tab']"
109115
})
110-
.waitForElementVisible('[data-id="sr-notloaded-default"]')
111-
.waitForElementVisible('[data-id="sr-loaded-ethers6"]')
116+
.scrollAndClick('*[data-id="sr-notloaded-ethers6"]')
117+
.scrollInto('[data-id="sr-notloaded-default"]')
112118
},
113119
'reset to default after template': function (browser: NightwatchBrowser) {
114120
browser

0 commit comments

Comments
 (0)