pull/2868/head
filip mertens 2 years ago
parent 617a0625bc
commit 4d702acd54
  1. 4
      apps/remix-ide-e2e/src/commands/checkVariableDebug.ts
  2. 4
      apps/remix-ide-e2e/src/commands/clickLaunchIcon.ts
  3. 4
      apps/remix-ide-e2e/src/helpers/init.ts
  4. 4
      apps/remix-ide-e2e/src/tests/ballot_0_4_14.test.ts
  5. 3
      apps/remix-ide-e2e/src/tests/debugger.test.ts
  6. 1
      apps/remix-ide-e2e/src/tests/erc721.test.ts
  7. 1
      apps/remix-ide-e2e/src/tests/proxy.test.ts
  8. 1
      apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts
  9. 2
      apps/remix-ide-e2e/src/tests/transactionExecution.test.ts
  10. 1
      libs/remix-ui/editor/src/lib/remix-ui-editor.tsx
  11. 8
      libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx
  12. 2
      package.json

@ -19,22 +19,20 @@ function checkDebug(browser: NightwatchBrowser, id: string, debugValue: Nightwat
// id is soliditylocals or soliditystate
let resultOfElement = null
let isEqual = false
// waitUntil will run with intervals of 1000ms for 10 seconds until the condition is met
browser.waitUntil(() => {
browser.execute(function (id: string) {
const elem = document.querySelector('#' + id + ' .dropdownrawcontent') as HTMLElement
if (elem && elem.innerText) {
console.log(elem.innerText)
return elem.innerText
}
}, [id], (result) => {
if (result.value) {
console.log(JSON.parse(<string>result.value))
try {
resultOfElement = JSON.parse(<string>result.value)
isEqual = deepequal(debugValue, resultOfElement)
} catch (e) {
browser.assert.fail('cant parse solidity state', e.message, '')
console.log(e)
}
}
})

@ -5,9 +5,7 @@ class ClickLaunchIcon extends EventEmitter {
command (this: NightwatchBrowser, icon: string): NightwatchBrowser {
this.api
.waitForElementVisible('#icon-panel div[plugin="' + icon + '"]')
.click('#icon-panel div[plugin="' + icon + '"]', (result) => {
console.log('clicking on ', result.status)
})
.click('#icon-panel div[plugin="' + icon + '"]')
.perform((done) => {
done()
this.emit('complete')

@ -10,8 +10,7 @@ type LoadPlugin = {
export default function (browser: NightwatchBrowser, callback: VoidFunction, url?: string, preloadPlugins = true, loadPlugin?: LoadPlugin): void {
browser
.url(url || 'http://127.0.0.1:8080')
//.pause(6000)
.switchBrowserTab(0)
//.switchBrowserTab(0)
.waitForElementVisible('[id="remixTourSkipbtn"]')
.click('[id="remixTourSkipbtn"]')
@ -24,7 +23,6 @@ export default function (browser: NightwatchBrowser, callback: VoidFunction, url
localStorage.setItem('test-plugin-url', loadPlugin.url)
}, [loadPlugin])
.refreshPage()
.waitForElementVisible('[data-id="sidePanelSwapitTitle"]')
.perform(done())
})
.verifyLoad()

@ -16,7 +16,7 @@ module.exports = {
'@sources': function () {
return sources
},
'Add Ballot #group1 #group2': function (browser: NightwatchBrowser) {
'Add Ballot': function (browser: NightwatchBrowser) {
browser
.addFile('Untitled.sol', sources[0]['Untitled.sol'])
},
@ -30,7 +30,7 @@ module.exports = {
.verify.elementPresent('[data-id="compilerContainerAutoCompile"]:checked')
},
'Compile Ballot with compiler version 0.4.14 #group1 #group2': function (browser: NightwatchBrowser) {
'Compile Ballot with compiler version 0.4.14': function (browser: NightwatchBrowser) {
browser
.testContracts('Untitled.sol', sources[0]['Untitled.sol'], ['Ballot'])
},

@ -15,10 +15,11 @@ module.exports = {
'Should launch debugger #group1': function (browser: NightwatchBrowser) {
browser.addFile('blah.sol', sources[0]['blah.sol'])
.pause(4000)
// on autocompile sometimes the compiler returns invalid source, so we need to recompile to make sure the source is valid
.clickLaunchIcon('solidity').click('*[data-id="compilerContainerCompileBtn"]')
.pause(4000)
.clickLaunchIcon('udapp')
.waitForElementPresent('*[title="Deploy - transact (not payable)"]', 180000)
.waitForElementPresent('*[title="Deploy - transact (not payable)"]', 60000)
.click('*[title="Deploy - transact (not payable)"]')
.debugTransaction(0)
.waitForElementContainsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER', 60000)

@ -28,6 +28,7 @@ module.exports = {
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]')
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts/MyToken.sol"]')
.openFile('contracts/MyToken.sol')
// because the compilatiom imports are slow and sometimes stop loading (not sure why, it's bug) we need to recompile and check to see if the files are really in de FS
.clickLaunchIcon('solidity')
.pause(2000)
.click('[data-id="compilerContainerCompileBtn"]')

@ -20,6 +20,7 @@ module.exports = {
.addFile('myTokenV1.sol', sources[0]['myTokenV1.sol'])
.clickLaunchIcon('solidity')
.pause(2000)
// because the compilatiom imports are slow and sometimes stop loading (not sure why, it's bug) we need to recompile and check to see if the files are really in de FS
.click('[data-id="compilerContainerCompileBtn"]')
.clickLaunchIcon('filePanel')
.isVisible({

@ -271,7 +271,6 @@ module.exports = {
'Debug tests using debugger #group7': function (browser: NightwatchBrowser) {
browser
//.pause()
.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
.addFile('tests/ballotFailedDebug_test.sol', sources[0]['tests/ballotFailedDebug_test.sol'])
.clickLaunchIcon('solidityUnitTesting')

@ -23,8 +23,6 @@ module.exports = {
status: 'true Transaction mined and execution succeed',
'decoded output': { 0: 'uint256: 8' }
})
//.pause(5000)
//.checkTerminalFilter('0x12332162e2e31397dc1e07ed0a1cf08f728e9b4487c6f9ed79d2f39410c92782', '')
.clickFunction('g - transact (not payable)')
.testFunction('last',
{

@ -606,6 +606,7 @@ export const EditorUI = (props: EditorUIProps) => {
}
return result
}
// just for e2e testing
const loadedElement = document.createElement('span')
loadedElement.setAttribute('data-id', 'editorloaded')
document.body.appendChild(loadedElement)

@ -61,7 +61,6 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
const [showFilePathInput, setShowFilePathInput] = useState<boolean>(false)
const [toggleExpander, setToggleExpander] = useState<boolean>(false)
const [disableCompileButton, setDisableCompileButton] = useState<boolean>(false)
const [compilerLoadedVersion, setCompilerLoadedVersion] = useState<string>('')
const compileIcon = useRef(null)
const promptMessageInput = useRef(null)
const configFilePathInput = useRef(null)
@ -187,7 +186,6 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
loadingCompiler()
break
case 'compilerLoaded':
setCompilerLoadedVersion(state.selectedVersion)
compilerLoaded(compilerContainer.compiler.args[1])
break
case 'compilationFinished':
@ -458,6 +456,11 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
// just for e2e
// eslint-disable-next-line no-case-declarations
const elements = document.querySelectorAll('[data-id="compilerloaded"]')
// remove elements
for (let i = 0; i < elements.length; i++) {
elements[i].remove()
}
const loadedElement = document.createElement('span')
loadedElement.setAttribute('data-id', 'compilerloaded')
loadedElement.setAttribute('data-version', state.selectedVersion)
@ -858,7 +861,6 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
</div>
</div>
<div className="px-4">
{compilerLoadedVersion ? <span data-id='compilerLoadedVersion' data-version={compilerLoadedVersion}></span> : ''}
<button id="compileBtn" data-id="compilerContainerCompileBtn" className="btn btn-primary btn-block d-block w-100 text-break remixui_disabled mb-1 mt-3" onClick={compile} disabled={(configFilePath === '' && state.useFileConfiguration) || disableCompileButton}>
<OverlayTrigger overlay={
<Tooltip id="overlay-tooltip-compile">

@ -67,7 +67,7 @@
"nightwatch_local_firefox": "yarn run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=firefox",
"nightwatch_local_chrome": "yarn run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome",
"nightwatch_local_ballot": "yarn run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot.test.js --env=chrome",
"nightwatch_local_ballot_0_4_11": "yarn run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot_0_4_14.test.js --env=chrome",
"nightwatch_local_ballot_0_4_14": "yarn run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot_0_4_14.test.js --env=chrome",
"nightwatch_local_usingWorker": "yarn run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/usingWebWorker.test.js --env=chrome",
"nightwatch_local_libraryDeployment": "yarn run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/libraryDeployment.test.js --env=chrome",
"nightwatch_local_solidityImport": "yarn run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityImport_*.test.js --env=chrome",

Loading…
Cancel
Save