From 613395f79d57900936227f2db85fdc2077300ce1 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 27 Sep 2021 16:11:24 +0200 Subject: [PATCH] test recorder --- apps/remix-ide-e2e/src/tests/recorder.spec.ts | 1 + apps/remix-ide/src/app/tabs/runTab/recorder.js | 6 +++--- apps/remix-ide/src/app/tabs/testTab/testTab.js | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/recorder.spec.ts b/apps/remix-ide-e2e/src/tests/recorder.spec.ts index fa3ffbed26..dfd94781c4 100644 --- a/apps/remix-ide-e2e/src/tests/recorder.spec.ts +++ b/apps/remix-ide-e2e/src/tests/recorder.spec.ts @@ -44,6 +44,7 @@ module.exports = { .clickFunction('set - transact (not payable)', { types: 'uint256 _p', values: '34' }) .click('i.savetransaction') .modalFooterOKClick() + .pause(1000) .getEditorValue(function (result) { console.log(result) const parsed = JSON.parse(result) diff --git a/apps/remix-ide/src/app/tabs/runTab/recorder.js b/apps/remix-ide/src/app/tabs/runTab/recorder.js index 52d5367464..f1f25e1bd9 100644 --- a/apps/remix-ide/src/app/tabs/runTab/recorder.js +++ b/apps/remix-ide/src/app/tabs/runTab/recorder.js @@ -148,10 +148,10 @@ class RecorderUI extends Plugin { var fileProvider = this.fileManager.fileProviderOf(path) if (!fileProvider) return var newFile = path + '/' + input - helper.createNonClashingName(newFile, fileProvider, (error, newFile) => { + helper.createNonClashingName(newFile, fileProvider, async (error, newFile) => { if (error) return cb('Failed to create file. ' + newFile + ' ' + error) - if (!fileProvider.set(newFile, txJSON)) return cb('Failed to create file ' + newFile) - this.fileManager.open(newFile) + if (!await fileProvider.set(newFile, txJSON)) return cb('Failed to create file ' + newFile) + await this.fileManager.open(newFile) }) }) } diff --git a/apps/remix-ide/src/app/tabs/testTab/testTab.js b/apps/remix-ide/src/app/tabs/testTab/testTab.js index 93cb49516b..e7d80552ec 100644 --- a/apps/remix-ide/src/app/tabs/testTab/testTab.js +++ b/apps/remix-ide/src/app/tabs/testTab/testTab.js @@ -40,11 +40,11 @@ class TestTabLogic { if (!fileProvider) return const splittedFileName = fileName.split('/') const fileNameToImport = (!hasCurrent) ? fileName : this.currentPath + '/' + splittedFileName[splittedFileName.length - 1] - helper.createNonClashingNameWithPrefix(fileNameToImport, fileProvider, '_test', (error, newFile) => { + helper.createNonClashingNameWithPrefix(fileNameToImport, fileProvider, '_test', async (error, newFile) => { if (error) return modalDialogCustom.alert('Failed to create file. ' + newFile + ' ' + error) - if (!fileProvider.set(newFile, this.generateTestContractSample(hasCurrent, fileName))) return modalDialogCustom.alert('Failed to create test file ' + newFile) - this.fileManager.open(newFile) - this.fileManager.syncEditor(newFile) + if (!await fileProvider.set(newFile, this.generateTestContractSample(hasCurrent, fileName))) return modalDialogCustom.alert('Failed to create test file ' + newFile) + await this.fileManager.open(newFile) + await this.fileManager.syncEditor(newFile) }) }