From 6902a481b3f5673e50322c9f83e2a1c0b898e821 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Mon, 19 Sep 2022 15:58:48 +0100 Subject: [PATCH 01/21] add custom tooltip to passing test result --- .../src/lib/solidity-unit-testing.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx index 947eae4dac..2de770a347 100644 --- a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx +++ b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx @@ -2,6 +2,7 @@ import React, { useState, useRef, useEffect, ReactElement } from 'react' // esli import * as semver from 'semver' import { eachOfSeries } from 'async' // eslint-disable-line import type Web3 from 'web3' +import { OverlayTrigger, Tooltip } from 'react-bootstrap' import { canUseWorker, urlFromVersion } from '@remix-project/remix-solidity' import { Renderer } from '@remix-ui/renderer' // eslint-disable-line import { Toaster } from '@remix-ui/toaster' // eslint-disable-line @@ -304,12 +305,15 @@ export const SolidityUnitTesting = (props: Record) => { // eslint-d ) } else { const className = "alert-success d-inline-block mb-1 mr-1 p-1 passed_" + runningTestFileName - label = (
+ All contract tests passed + + }>
PASS -
) +
) } // show contract and file name with label const ContractCard: ReactElement = ( From 8ccb9da71b5f2355642a1c4000150b41d7d99d41 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Mon, 19 Sep 2022 17:09:46 +0100 Subject: [PATCH 02/21] add custom tooltips for start and stop buttons --- .../src/lib/solidity-unit-testing.tsx | 51 ++++++++++++++----- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx index 2de770a347..ff7b12801a 100644 --- a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx +++ b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx @@ -297,15 +297,18 @@ export const SolidityUnitTesting = (props: Record) => { // eslint-d let label if (index > -1) { const className = "alert-danger d-inline-block mb-1 mr-1 p-1 failed_" + runningTestFileName - label = (
+ At least one contract test failed + + }>
FAIL -
) +
) } else { const className = "alert-success d-inline-block mb-1 mr-1 p-1 passed_" + runningTestFileName - label = ( All contract tests passed @@ -339,8 +342,12 @@ export const SolidityUnitTesting = (props: Record) => { // eslint-d if (test.debugTxHash) { const { web3, debugTxHash } = test debugBtn = ( -
startDebug(debugTxHash, web3)}> - +
startDebug(debugTxHash, web3)}> + + Start debugging + + }>
) } @@ -711,14 +718,30 @@ export const SolidityUnitTesting = (props: Record) => { // eslint-d
- - + + + {runButtonTitle} + + + }> + + + + + Stop running tests + + + }> + +
Date: Thu, 22 Sep 2022 11:03:09 +0100 Subject: [PATCH 03/21] custom tooltip for plugin info --- .../panel/src/lib/plugins/panel-header.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/libs/remix-ui/panel/src/lib/plugins/panel-header.tsx b/libs/remix-ui/panel/src/lib/plugins/panel-header.tsx index b6e8c9948a..ba729b5c0a 100644 --- a/libs/remix-ui/panel/src/lib/plugins/panel-header.tsx +++ b/libs/remix-ui/panel/src/lib/plugins/panel-header.tsx @@ -2,6 +2,7 @@ import React, { useEffect, useRef, useState } from 'react' // eslint-disable-line import { PluginRecord } from '../types' import './panel.css' +import { OverlayTrigger, Tooltip } from 'react-bootstrap' export interface RemixPanelProps { plugins: Record; @@ -32,9 +33,15 @@ const RemixUIPanelHeader = (props: RemixPanelProps) => {
{plugin?.profile?.maintainedBy?.toLowerCase() === "remix" && ()}
-
- -
+ + Plugin info + + } placement={'right-end'}> +
+ +
+
@@ -57,7 +64,7 @@ const RemixUIPanelHeader = (props: RemixPanelProps) => { { plugin?.profile.description } } {plugin?.profile?.repo && - + Make an issue }
From 8c5982de95e0404c04a568c8db72aa7f158b14e3 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Thu, 22 Sep 2022 11:32:05 +0100 Subject: [PATCH 04/21] add custom tooltip to generate tests input and button --- .../src/lib/solidity-unit-testing.tsx | 60 ++++++++++++------- 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx index ff7b12801a..9b6e18e44b 100644 --- a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx +++ b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx @@ -199,7 +199,7 @@ export const SolidityUnitTesting = (props: Record) => { // eslint-d if (await testTabLogic.pathExists(testDirInput)) { setDisableCreateButton(true) setDisableGenerateButton(false) - + } else { // Enable Create button setDisableCreateButton(false) @@ -674,28 +674,44 @@ export const SolidityUnitTesting = (props: Record) => { // eslint-d }) } - { if (inputPathValue === '/') setInputPathValue('')} } - onChange={handleTestDirInput} - onClick = {() => { if (inputPathValue === '/') setInputPathValue('')} } - /> - + { if (inputPathValue === '/') setInputPathValue('')} } + onChange={handleTestDirInput} + onClick = {() => { if (inputPathValue === '/') setInputPathValue('')} } + /> +
+ + Create a test folder + + } + > + + From f9705bcf3fe7a2d89b2c3ab444430b9435ca0e2c Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Thu, 22 Sep 2022 12:07:32 +0100 Subject: [PATCH 05/21] add custom overlay generate and How to use buttons --- .../src/lib/solidity-unit-testing.tsx | 37 ++++++++++++------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx index 9b6e18e44b..0b3569386a 100644 --- a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx +++ b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx @@ -717,21 +717,32 @@ export const SolidityUnitTesting = (props: Record) => { // eslint-d
Date: Fri, 23 Sep 2022 10:24:12 +0100 Subject: [PATCH 06/21] increase waiting time for current css selector --- apps/remix-ide-e2e/src/commands/clickElementAtPosition.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/commands/clickElementAtPosition.ts b/apps/remix-ide-e2e/src/commands/clickElementAtPosition.ts index 7fb12e8dfe..7cf22cbabc 100644 --- a/apps/remix-ide-e2e/src/commands/clickElementAtPosition.ts +++ b/apps/remix-ide-e2e/src/commands/clickElementAtPosition.ts @@ -14,7 +14,7 @@ class ClickElement extends EventEmitter { } function _clickElement (browser: NightwatchBrowser, cssSelector: string, index: number, forceSelectIfUnselected: boolean, cb: VoidFunction) { - browser.waitForElementPresent(cssSelector) + browser.waitForElementPresent(cssSelector, 5000) .execute(function (cssSelector: string, index: number, forceSelectIfUnselected: boolean) { const elem = document.querySelectorAll(cssSelector)[index] as HTMLElement if (forceSelectIfUnselected) { From 0215163790c5729e924b0c6db56afa72967c46a0 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Fri, 23 Sep 2022 15:07:49 +0100 Subject: [PATCH 07/21] fixing e2e --- .../src/tests/solidityUnittests.test.ts | 61 ++++++++++--------- .../src/lib/solidity-unit-testing.tsx | 2 +- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts index 5e7284368a..0c39751dce 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts @@ -155,6 +155,7 @@ module.exports = { .clearValue('*[data-id="uiPathInput"]') .setValue('*[data-id="uiPathInput"]', 'myTests') .click('*[data-id="testTabGenerateTestFolder"]') + .saveScreenshot('./reports/screenshots/changeCurrentPathg3.png') .clickElementAtPosition('.singleTest', 0, { forceSelectIfUnselected: true }) .scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') .waitForElementPresent('*[data-id="testTabSolidityUnitTestsOutputheader"]', 60000) @@ -359,15 +360,15 @@ const sources = [ contract SimpleStorage { uint public storedData; - + constructor() { storedData = 100; } - + function set(uint x) public { storedData = x; } - + function get() public view returns (uint retVal) { return storedData; } @@ -408,7 +409,7 @@ const sources = [ pragma solidity >=0.4.22 <0.9.0; contract Kickstarter { enum State { Started, Completed } - + struct Project { address owner; string name; @@ -420,10 +421,10 @@ const sources = [ } uint numProjects; Project[] public projects; - + constructor() { } - + function createProject(string memory name, uint goal) public { projects.push(); // new line Project storage project = projects[projects.length - 1]; @@ -432,28 +433,28 @@ const sources = [ project.owner = msg.sender; project.state = State.Started; } - + function fundProject(uint projectId) payable public { Project storage project = projects[projectId]; // require project exists // PLEASE CHECK / or erase // not this: require(projects[projectId].exists, "the project must exist to be funded"); - + // require for... underflow/overflow protection project.funders[msg.sender] += msg.value; project.amountContributed += msg.value; project.fundsAvailable += msg.value; - + if (project.amountContributed >= project.goal) { project.state = State.Completed; } } - + // this function is here because we can't use web3 when using the VM function getContractBalance() public view returns(uint balance) { return address(this).balance; } - + } ` }, @@ -470,13 +471,13 @@ const sources = [ enum State { Started, Completed } Kickstarter kickstarter; - + function beforeAll () public { kickstarter = new Kickstarter(); kickstarter.createProject("ProjectA", 123000); kickstarter.createProject("ProjectB", 100); } - + /// #sender: account-1 /// #value: 10000000 function checkProjectExists () public payable { @@ -512,14 +513,14 @@ const sources = [ (address owner, string memory name, uint goal, uint fundsAvailable, uint amountContributed, Kickstarter.State state) = kickstarter.projects(0); Assert.equal(amountContributed, 120000, "contributed amount is incorrect"); } - + } ` }, 'compilationError_test.sol': { content: ` pragma solidity ^0.8.0; - + contract failOnCompilation { fallback() { @@ -547,7 +548,7 @@ const sources = [ uint c = a+b; Assert.equal(a+b, c, "wrong value"); } - } + } ` }, 'tests/ballotFailedDebug_test.sol': { @@ -556,31 +557,31 @@ const sources = [ pragma solidity >=0.7.0 <0.9.0; import "remix_tests.sol"; // this import is automatically injected by Remix. import "../contracts/3_Ballot.sol"; - + contract BallotTest { - + bytes32[] proposalNames; - + Ballot ballotToTest; function beforeAll () public { proposalNames.push(bytes32("candidate1")); ballotToTest = new Ballot(proposalNames); } - + function checkWinningProposalFailed () public { ballotToTest.vote(1); Assert.equal(ballotToTest.winningProposal(), uint(0), "proposal at index 0 should be the winning proposal"); } - + function checkWinningProposalPassed () public { ballotToTest.vote(0); Assert.equal(ballotToTest.winningProposal(), uint(0), "proposal at index 0 should be the winning proposal"); } - + function checkWinningProposalAgain () public { Assert.equal(ballotToTest.winningProposal(), uint(1), "proposal at index 0 should be the winning proposal"); } - + function checkWinninProposalWithReturnValue () public view returns (bool) { return ballotToTest.winningProposal() == 0; } @@ -594,17 +595,17 @@ const sources = [ import "../contracts/3_Ballot.sol"; import "hardhat/console.sol"; - + contract BallotTest { - + bytes32[] proposalNames; - + Ballot ballotToTest; function beforeAll () public { proposalNames.push(bytes32("candidate1")); ballotToTest = new Ballot(proposalNames); } - + function checkWinningProposal () public { console.log("Inside checkWinningProposal"); ballotToTest.vote(1); // This will revert the transaction @@ -617,13 +618,13 @@ const sources = [ pragma solidity >=0.7.0 <0.9.0; import "remix_tests.sol"; // this import is automatically injected by Remix. import "hardhat/console.sol"; - + contract hhLogs { - + function beforeAll () public { console.log('Inside beforeAll'); } - + function checkSender () public { console.log('msg.sender is %s', msg.sender); Assert.ok(true, "should be true"); diff --git a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx index 0b3569386a..0778908169 100644 --- a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx +++ b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx @@ -784,7 +784,7 @@ export const SolidityUnitTesting = (props: Record) => { // eslint-d const elemId = `singleTest${testFileObj.fileName}` return (
- toggleCheckbox(e.target.checked, index)} type="checkbox" checked={testFileObj.checked} /> + toggleCheckbox(e.target.checked, index)} type="checkbox" checked={testFileObj.checked} />
) From ae82fbaa1bb433c78d133cbfcf80e66b03eb8121 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Fri, 23 Sep 2022 16:14:03 +0100 Subject: [PATCH 08/21] update test solidityUnitTest #group3 --- apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts index 0c39751dce..365f5dcb12 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts @@ -152,8 +152,9 @@ module.exports = { .waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') .addFile('myTests/simple_storage_test.sol', sources[0]['tests/simple_storage_test.sol']) .clickLaunchIcon('solidityUnitTesting') - .clearValue('*[data-id="uiPathInput"]') - .setValue('*[data-id="uiPathInput"]', 'myTests') + // .clearValue('*[data-id="uiPathInput"]') + // .setValue('*[data-id="uiPathInput"]', 'myTests') + .updateValue('*[data-id="uiPathInput"]','myTests') .click('*[data-id="testTabGenerateTestFolder"]') .saveScreenshot('./reports/screenshots/changeCurrentPathg3.png') .clickElementAtPosition('.singleTest', 0, { forceSelectIfUnselected: true }) From 11e17d34cf84e5eadcc772792d9ce6f951a088b1 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Fri, 23 Sep 2022 16:16:22 +0100 Subject: [PATCH 09/21] fix clear input --- apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts index 365f5dcb12..5dc4dfafaa 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts @@ -152,7 +152,7 @@ module.exports = { .waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') .addFile('myTests/simple_storage_test.sol', sources[0]['tests/simple_storage_test.sol']) .clickLaunchIcon('solidityUnitTesting') - // .clearValue('*[data-id="uiPathInput"]') + .clearValue('*[data-id="uiPathInput"]') // .setValue('*[data-id="uiPathInput"]', 'myTests') .updateValue('*[data-id="uiPathInput"]','myTests') .click('*[data-id="testTabGenerateTestFolder"]') From 748ef3e5e90123ca60cdd059cc6caa588ccf4e39 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Mon, 26 Sep 2022 11:59:37 +0100 Subject: [PATCH 10/21] fix failing e2e test --- apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts index 5dc4dfafaa..a536a5fe6c 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts @@ -152,9 +152,13 @@ module.exports = { .waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]') .addFile('myTests/simple_storage_test.sol', sources[0]['tests/simple_storage_test.sol']) .clickLaunchIcon('solidityUnitTesting') - .clearValue('*[data-id="uiPathInput"]') - // .setValue('*[data-id="uiPathInput"]', 'myTests') - .updateValue('*[data-id="uiPathInput"]','myTests') + .execute(() => { + const myQuery: any = document.getElementById('utPath') + console.log({ myQuery }) + + myQuery.value = 'myTests' + console.log('reset input') + }) .click('*[data-id="testTabGenerateTestFolder"]') .saveScreenshot('./reports/screenshots/changeCurrentPathg3.png') .clickElementAtPosition('.singleTest', 0, { forceSelectIfUnselected: true }) From 9005e3ae950baa430437681edac0b9df93073be8 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Mon, 26 Sep 2022 14:03:47 +0100 Subject: [PATCH 11/21] fix autocomplete e2e test --- apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts b/apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts index 9e09df0e8b..dfd7651051 100644 --- a/apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts +++ b/apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts @@ -101,6 +101,7 @@ module.exports = { 'Should autcomplete address types #group1': function (browser: NightwatchBrowser) { browser .perform(function () { + console.log({ autoCompleteLineElement }) const actions = this.actions({ async: true }); return actions. sendKeys('addre') @@ -118,6 +119,7 @@ module.exports = { return actions. sendKeys('someaddress.') }) + .pause(120000) .waitForElementVisible(autoCompleteLineElement('balance')) .waitForElementVisible(autoCompleteLineElement('send')) .waitForElementVisible(autoCompleteLineElement('transfer')) @@ -216,7 +218,7 @@ module.exports = { .waitForElementVisible(autoCompleteLineElement('importedbook')) .waitForElementVisible(autoCompleteLineElement('importpublicstring')) .waitForElementVisible(autoCompleteLineElement('publicimport')) - // no private + // no private .waitForElementNotPresent(autoCompleteLineElement('importprivatestring')) .waitForElementNotPresent(autoCompleteLineElement('privateimport')) // no internal @@ -523,4 +525,4 @@ module.exports = { .sendKeys(this.Keys.ENTER) }) } -} \ No newline at end of file +} From aecc0d06e53012c2ac62f020e821d3d6d8d5d759 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Mon, 26 Sep 2022 16:01:20 +0100 Subject: [PATCH 12/21] fix e2e test for autocomplete --- apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts b/apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts index dfd7651051..5a23048b59 100644 --- a/apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts +++ b/apps/remix-ide-e2e/src/tests/editorAutoComplete.test.ts @@ -101,7 +101,6 @@ module.exports = { 'Should autcomplete address types #group1': function (browser: NightwatchBrowser) { browser .perform(function () { - console.log({ autoCompleteLineElement }) const actions = this.actions({ async: true }); return actions. sendKeys('addre') @@ -119,7 +118,6 @@ module.exports = { return actions. sendKeys('someaddress.') }) - .pause(120000) .waitForElementVisible(autoCompleteLineElement('balance')) .waitForElementVisible(autoCompleteLineElement('send')) .waitForElementVisible(autoCompleteLineElement('transfer')) From 11566aa1a651440e786be174d1bd42d6776457c8 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Mon, 26 Sep 2022 16:06:31 +0100 Subject: [PATCH 13/21] fix tooltip for disabled stop button --- .../src/lib/solidity-unit-testing.tsx | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx index 0778908169..0396ba7932 100644 --- a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx +++ b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx @@ -757,18 +757,20 @@ export const SolidityUnitTesting = (props: Record) => { // eslint-d
- - - Stop running tests - - - }> - - +
Date: Fri, 14 Oct 2022 20:17:32 +0100 Subject: [PATCH 14/21] respond to review comments from @Aniket-Engg --- apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts index a536a5fe6c..6a7840c6cd 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts @@ -154,10 +154,7 @@ module.exports = { .clickLaunchIcon('solidityUnitTesting') .execute(() => { const myQuery: any = document.getElementById('utPath') - console.log({ myQuery }) - myQuery.value = 'myTests' - console.log('reset input') }) .click('*[data-id="testTabGenerateTestFolder"]') .saveScreenshot('./reports/screenshots/changeCurrentPathg3.png') From 12378b80a2f41bd43e2f37a6926c3ebc14dd3862 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 5 Oct 2022 14:58:02 +0100 Subject: [PATCH 15/21] add tooltips to buttons in solidity compiler --- .../src/lib/contract-selection.tsx | 59 ++++++++++++++++--- 1 file changed, 50 insertions(+), 9 deletions(-) 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 7eb240c7a9..332169f14b 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx @@ -1,10 +1,11 @@ -import React, { useState, useEffect } from 'react' // eslint-disable-line +import React, { useState, useEffect, Fragment } from 'react' // eslint-disable-line import { ContractSelectionProps } from './types' import { PublishToStorage } from '@remix-ui/publish-to-storage' // eslint-disable-line import { TreeView, TreeViewItem } from '@remix-ui/tree-view' // eslint-disable-line import { CopyToClipboard } from '@remix-ui/clipboard' // eslint-disable-line import './css/style.css' +import { OverlayTrigger, Tooltip } from 'react-bootstrap' export const ContractSelection = (props: ContractSelectionProps) => { const { api, compiledFileName, contractsDetails, contractList, modal } = props @@ -195,16 +196,56 @@ export const ContractSelection = (props: ContractSelectionProps) => {
- - - {/* Copy to Clipboard */}
From a03c703b13855494a86180cc7948c03db100aaed Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 5 Oct 2022 16:53:22 +0100 Subject: [PATCH 16/21] add tooltip to disabled element --- .../src/lib/compiler-container.tsx | 59 +++++++++++++++---- 1 file changed, 48 insertions(+), 11 deletions(-) diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index 1745306755..a9df2a0fcf 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -727,8 +727,26 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
- promptCompiler()} title="Add a custom compiler with URL"> - showCompilerLicense()} title="See compiler license"> + + {"Add a custom compiler with URL"} + + } + > + promptCompiler()}> + + + {"See compiler license"} + + } + > + showCompilerLicense()}> + handleLanguageChange(e.target.value)} disabled={state.useFileConfiguration} value={state.language} className="custom-select" id="compilierLanguageSelector" title="Language specification available from Compiler >= v0.5.7"> - - - + + {'Language specification available from Compiler >= v0.5.7'} + + } + > + +
@@ -838,11 +865,21 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
- {(!showFilePathInput && state.useFileConfiguration) && { } : async () => { await openFile() }} - className="py-2 remixui_compilerConfigPath" - >{configFilePath === '' ? 'No file selected.' : configFilePath}} + {(!showFilePathInput && state.useFileConfiguration) && + + Click to open the config file + + + } + > + { } : async () => { await openFile() }} + className="py-2 remixui_compilerConfigPath" + >{configFilePath === '' ? 'No file selected.' : configFilePath} + } {(!showFilePathInput && !state.useFileConfiguration) && {configFilePath}} Date: Fri, 7 Oct 2022 18:48:16 +0100 Subject: [PATCH 17/21] add custom tooltips for file explorer icons --- .../src/lib/components/file-explorer-menu.tsx | 69 +++++++++++-------- .../remix-ui/workspace/src/lib/types/index.ts | 3 +- 2 files changed, 44 insertions(+), 28 deletions(-) diff --git a/libs/remix-ui/workspace/src/lib/components/file-explorer-menu.tsx b/libs/remix-ui/workspace/src/lib/components/file-explorer-menu.tsx index 4f553f1583..484d76cd50 100644 --- a/libs/remix-ui/workspace/src/lib/components/file-explorer-menu.tsx +++ b/libs/remix-ui/workspace/src/lib/components/file-explorer-menu.tsx @@ -1,4 +1,6 @@ import React, { useState, useEffect } from 'react' //eslint-disable-line +import { OverlayTrigger, Tooltip } from 'react-bootstrap' +import { Placement } from 'react-bootstrap/esm/Overlay' import { FileExplorerMenuProps } from '../types' const _paq = window._paq = window._paq || [] @@ -8,27 +10,32 @@ export const FileExplorerMenu = (props: FileExplorerMenuProps) => { { action: 'createNewFile', title: 'Create New File', - icon: 'far fa-file' + icon: 'far fa-file', + placement: 'top-end' }, { action: 'createNewFolder', title: 'Create New Folder', - icon: 'far fa-folder' + icon: 'far fa-folder', + placement: 'top-end' }, { action: 'publishToGist', title: 'Publish all the current workspace files (only root) to a github gist', - icon: 'fab fa-github' + icon: 'fab fa-github', + placement: 'top-start' }, { action: 'uploadFile', title: 'Load a local file into current workspace', - icon: 'fa fa-upload' + icon: 'fa fa-upload', + placement: 'bottom-start' }, { action: 'updateGist', title: 'Update the current [gist] explorer', - icon: 'fab fa-github' + icon: 'fab fa-github', + placement: 'right-start' } ].filter(item => props.menuItems && props.menuItems.find((name) => { return name === item.action })), actions: {} @@ -48,14 +55,13 @@ export const FileExplorerMenu = (props: FileExplorerMenuProps) => { <> { props.title } { - state.menuItems.map(({ action, title, icon }, index) => { + state.menuItems.map(({ action, title, icon, placement }, index) => { if (action === 'uploadFile') { return (