diff --git a/apps/remix-ide-e2e/src/tests/remixd.test.ts b/apps/remix-ide-e2e/src/tests/remixd.test.ts index e34425b4a9..e9567bd9fc 100644 --- a/apps/remix-ide-e2e/src/tests/remixd.test.ts +++ b/apps/remix-ide-e2e/src/tests/remixd.test.ts @@ -251,6 +251,34 @@ module.exports = { done() }) }, + 'Should perform slither analysis #group10': function (browser: NightwatchBrowser) { + + browser.perform(async (done) => { + try { + remixd = await spawnRemixd(join(process.cwd(), '/apps/remix-ide', '/contracts')) + } catch (err) { + console.error(err) + } + console.log('working directory', process.cwd()) + connectRemixd(browser, done) + }) + .openFile('ballot.sol') + .pause(2000) + .clickLaunchIcon('solidityStaticAnalysis') + .useXpath() + .click('//*[@id="staticAnalysisRunBtn"]') + .waitForElementPresent('//*[@id="staticanalysisresult"]', 5000) + .waitForElementVisible({ + selector: "//*[@data-id='nolibslitherwarnings'][contains(text(), '3')]", + locateStrategy: 'xpath', + timeout: 5000 + }) + .waitForElementVisible({ + selector: "//div[@data-id='block']/span[contains(text(), '3 warnings found.')]", + locateStrategy: 'xpath', + timeout: 5000 + }) + } } function runTests(browser: NightwatchBrowser, done: any) { diff --git a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx index 5840411c30..7b3241481d 100644 --- a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx +++ b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx @@ -721,11 +721,11 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { Slither {slitherWarnings.length > 0 ? ( hideWarnings ? ( - {slitherErrors.length} + {slitherErrors.length} ) : showLibsWarning && !hideWarnings ? ( - 0 ? `badge-danger` : 'badge-warning'} badge-pill mx-1 ml-1 text-center`}>{slitherWarnings.length} + 0 ? `badge-danger` : 'badge-warning'} badge-pill mx-1 ml-1 text-center`}>{slitherWarnings.length} ) : ( - 0 ? `badge-danger` : 'badge-warning'} badge-pill mx-1 ml-1 text-center`}>{noLibSlitherWarnings.length} + 0 ? `badge-danger` : 'badge-warning'} badge-pill mx-1 ml-1 text-center`}>{noLibSlitherWarnings.length} ) ) : null}