From d851efe0c983e1b072ee4f498c2a830894b10b0b Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 19 Feb 2025 09:56:06 +0100 Subject: [PATCH] add e2e --- .../src/app/components/container.tsx | 2 +- apps/remix-ide-e2e/src/tests/noir.test.ts | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 apps/remix-ide-e2e/src/tests/noir.test.ts diff --git a/apps/noir-compiler/src/app/components/container.tsx b/apps/noir-compiler/src/app/components/container.tsx index a0a3319c10..35c2af0b14 100644 --- a/apps/noir-compiler/src/app/components/container.tsx +++ b/apps/noir-compiler/src/app/components/container.tsx @@ -66,7 +66,7 @@ export function Container () { - + View compiled noir program artefact. diff --git a/apps/remix-ide-e2e/src/tests/noir.test.ts b/apps/remix-ide-e2e/src/tests/noir.test.ts new file mode 100644 index 0000000000..2823530217 --- /dev/null +++ b/apps/remix-ide-e2e/src/tests/noir.test.ts @@ -0,0 +1,43 @@ +'use strict' +import { NightwatchBrowser } from 'nightwatch' +import init from '../helpers/init' + +module.exports = { + '@disabled': true, + before: function (browser: NightwatchBrowser, done: VoidFunction) { + browser.globals.asyncHookTimeout = 30000000; + init(browser, done) + }, + + 'Should create noir workspace template #group1': function (browser: NightwatchBrowser) { + browser + .clickLaunchIcon('filePanel') + .click('*[data-id="workspacesMenuDropdown"]') + .click('*[data-id="workspacecreate"]') + .waitForElementPresent('*[data-id="create-multNr"]') + .scrollAndClick('*[data-id="create-multNr"]') + .modalFooterOKClick('TemplatesSelection') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemsrc"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemsrc/main.nr"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests/multiplier.test.ts"]') + }, + 'Should compile a simple circuit using editor play button #group1': function (browser: NightwatchBrowser) { + browser + .clickLaunchIcon('noir-compiler') + .openFile('src/main.nr') + .click('[data-id="play-editor"]') + .waitForElementPresent('[data-id="view-noir-compilation-result"]') + .click('[data-id="view-noir-compilation-result"]') + .getEditorValue((value) => { + browser.assert.ok(value.indexOf('noir_version') !== -1, 'compilation result did not show') + }) + }, + 'Should run script for compute a witness and proof generation #group1': function (browser: NightwatchBrowser) { + browser + .clickLaunchIcon('filePanel') + .openFile('tests/multiplier.test.ts') + .click('[data-id="play-editor"]') + .waitForElementContainsText('*[data-id="terminalJournal"]', ' CHECK PROOF ', 60000) + } +}