From 0a4d62d2728fd8c5a7f353fb69bfe97a9a92f7d5 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Tue, 27 Dec 2022 10:01:13 +0100 Subject: [PATCH] fix e2e caused by showFlattener && git push ; --- apps/remix-ide-e2e/src/commands/clickLaunchIcon.ts | 9 +++++++-- .../solidity-compiler/src/lib/contract-selection.tsx | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/clickLaunchIcon.ts b/apps/remix-ide-e2e/src/commands/clickLaunchIcon.ts index af1a7dbb55..68220adac3 100644 --- a/apps/remix-ide-e2e/src/commands/clickLaunchIcon.ts +++ b/apps/remix-ide-e2e/src/commands/clickLaunchIcon.ts @@ -3,9 +3,14 @@ import EventEmitter from 'events' class ClickLaunchIcon extends EventEmitter { command (this: NightwatchBrowser, icon: string): NightwatchBrowser { + console.log(icon) this.api - .waitForElementVisible('#icon-panel div[plugin="' + icon + '"]') - .click('#icon-panel div[plugin="' + icon + '"]') + .useXpath() + .assert.visible(`//*[@id="verticalIconsKind${icon}"]`) + // .waitForElementVisible('#icon-panel div[plugin="' + icon + '"]') + .click(`//*[@id="verticalIconsKind${icon}"]`) + .useCss() + // .click('#icon-panel div[plugin="' + icon + '"]') .perform((done) => { done() this.emit('complete') diff --git a/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx b/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx index 51eaecb735..6c8ecbdda3 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx @@ -237,6 +237,7 @@ export const ContractSelection = (props: ContractSelectionProps) => { const showFlattener = () => { const confirmNodeType = api.getCompilationResult().data.sources[api.currentFile] + .ast && api.getCompilationResult().data.sources[api.currentFile] .ast.nodes.some(x => x.nodeType === 'ImportDirective') const currentFile = api.currentFile.split('/')[1] const contractListConfirm = contractList.some(x => x.file === currentFile) @@ -256,7 +257,7 @@ export const ContractSelection = (props: ContractSelectionProps) => {
- {showFlattener() &&