From b348af898aa125c3b2bc4c9245ae664f005a9944 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 1 Nov 2023 16:34:53 +0100 Subject: [PATCH] Test create semaphore template and test 2 compile options --- .../src/app/components/compileBtn.tsx | 1 + apps/remix-ide-e2e/src/tests/circom.test.ts | 55 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 apps/remix-ide-e2e/src/tests/circom.test.ts diff --git a/apps/circuit-compiler/src/app/components/compileBtn.tsx b/apps/circuit-compiler/src/app/components/compileBtn.tsx index c778377cc1..369b450b04 100644 --- a/apps/circuit-compiler/src/app/components/compileBtn.tsx +++ b/apps/circuit-compiler/src/app/components/compileBtn.tsx @@ -12,6 +12,7 @@ export function CompileBtn () { className="btn btn-primary btn-block d-block w-100 text-break mb-1 mt-3" onClick={() => { compileCircuit(plugin, appState) }} disabled={(appState.filePath === "") || (appState.status === "compiling") || (appState.status === "generating")} + data-id="compile_circuit_btn" > button') + .click('select[id="wstemplate"]') + .click('select[id="wstemplate"] option[value=semaphore]') + .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') + .execute(function () { (document.querySelector('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') as HTMLElement).click() }) + .pause(100) + .waitForElementVisible('*[data-id="treeViewLitreeViewItemcircuits"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemcircuits/semaphore.circom"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemscripts/run_setup.ts"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemtemplates"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemtemplates/groth16_verifier.sol.ejs"]') + }, + 'Should compile a simple circuit using editor play button #group1': function (browser: NightwatchBrowser) { + browser + .click('[data-id="treeViewLitreeViewItemcircuits/simple.circom"]') + .waitForElementPresent('[data-path="Semaphore - 1/circuits/simple.circom"]') + .waitForElementVisible('[data-path="Semaphore - 1/circuits/simple.circom"]') + .click('[data-id="play-editor"]') + .waitForElementPresent('[data-id="treeViewLitreeViewItemcircuits/.bin/simple.wasm"]') + .waitForElementVisible('[data-id="treeViewLitreeViewItemcircuits/.bin/simple.wasm"]') + }, + 'Should compile a simple circuit using compile button in circom plugin #group2': function (browser: NightwatchBrowser) { + browser + .click('[data-id="treeViewLitreeViewItemcircuits/simple.circom"]') + .waitForElementPresent('[data-path="Semaphore - 1/circuits/simple.circom"]') + .waitForElementVisible('[data-path="Semaphore - 1/circuits/simple.circom"]') + .clickLaunchIcon('circuit-compiler') + .frame(0) + .waitForElementPresent('button[data-id="compile_circuit_btn"]', 60000) + .waitForElementVisible('button[data-id="compile_circuit_btn"]') + .click('button[data-id="compile_circuit_btn"]') + .frameParent() + .clickLaunchIcon('filePanel') + .waitForElementPresent('[data-id="treeViewLitreeViewItemcircuits/.bin/simple.wasm"]') + .waitForElementVisible('[data-id="treeViewLitreeViewItemcircuits/.bin/simple.wasm"]') + .end() + } +}