From 73cf3876510b63e890b813ae62fc8e6ec2f51a37 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Mon, 26 Sep 2022 19:43:51 +0530 Subject: [PATCH 1/5] fix path to create and open file from home tab --- apps/remix-ide/src/app/panels/file-panel.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/apps/remix-ide/src/app/panels/file-panel.js b/apps/remix-ide/src/app/panels/file-panel.js index 71c637406b..d6a3708269 100644 --- a/apps/remix-ide/src/app/panels/file-panel.js +++ b/apps/remix-ide/src/app/panels/file-panel.js @@ -102,10 +102,7 @@ module.exports = class Filepanel extends ViewPlugin { createNewFile () { return new Promise((resolve, reject) => { - const provider = this.fileManager.currentFileProvider() - const dir = provider.workspace || '/' - - this.emit('createNewFileInputReducerEvent', dir, (err, data) => { + this.emit('createNewFileInputReducerEvent', '/', (err, data) => { if (err) reject(err) else resolve(data) }) @@ -114,10 +111,7 @@ module.exports = class Filepanel extends ViewPlugin { uploadFile (target) { return new Promise((resolve, reject) => { - const provider = this.fileManager.currentFileProvider() - const dir = provider.workspace || '/' - - return this.emit('uploadFileReducerEvent', dir, target, (err, data) => { + return this.emit('uploadFileReducerEvent', '/', target, (err, data) => { if (err) reject(err) else resolve(data) }) From 8409ace925fe0fb0f85f49a2b22aa08978c66581 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Tue, 27 Sep 2022 13:38:05 +0530 Subject: [PATCH 2/5] nightwatch BDD tests --- apps/remix-ide-e2e/src/tests/homeTab.test.ts | 16 ++++++++++++++++ .../home-tab/src/lib/remix-ui-home-tab.tsx | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 apps/remix-ide-e2e/src/tests/homeTab.test.ts diff --git a/apps/remix-ide-e2e/src/tests/homeTab.test.ts b/apps/remix-ide-e2e/src/tests/homeTab.test.ts new file mode 100644 index 0000000000..c5f19f290d --- /dev/null +++ b/apps/remix-ide-e2e/src/tests/homeTab.test.ts @@ -0,0 +1,16 @@ +'use strict' +import { NightwatchBrowser } from 'nightwatch' +import init from '../helpers/init' + +describe('HomeTab e2e test', function () { + + before(function (browser: NightwatchBrowser, done: VoidFunction) { + init(browser, done) + }) + + it('Should create new file', function (browser: NightwatchBrowser) { + browser + .waitForElementVisible('*[data-id="homeTabNewFile"]') + .click('*[data-id="homeTabNewFile"]') + }) +}) \ No newline at end of file diff --git a/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx b/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx index 07120d63dc..2914b9ee69 100644 --- a/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx +++ b/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx @@ -273,7 +273,7 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {

File

- +

From 9f165bf05f33cec8399e87b7b75df5833547dd8a Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Tue, 27 Sep 2022 13:53:07 +0530 Subject: [PATCH 3/5] end in after --- apps/remix-ide-e2e/src/tests/homeTab.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/remix-ide-e2e/src/tests/homeTab.test.ts b/apps/remix-ide-e2e/src/tests/homeTab.test.ts index c5f19f290d..bb3f2eab29 100644 --- a/apps/remix-ide-e2e/src/tests/homeTab.test.ts +++ b/apps/remix-ide-e2e/src/tests/homeTab.test.ts @@ -13,4 +13,6 @@ describe('HomeTab e2e test', function () { .waitForElementVisible('*[data-id="homeTabNewFile"]') .click('*[data-id="homeTabNewFile"]') }) + + after(browser => browser.end()); }) \ No newline at end of file From 81af656ac742e743cc561afc9057dd6db67986dd Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Tue, 27 Sep 2022 19:12:09 +0530 Subject: [PATCH 4/5] new file creation e2e --- apps/remix-ide-e2e/src/tests/homeTab.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/remix-ide-e2e/src/tests/homeTab.test.ts b/apps/remix-ide-e2e/src/tests/homeTab.test.ts index bb3f2eab29..8d3d643db1 100644 --- a/apps/remix-ide-e2e/src/tests/homeTab.test.ts +++ b/apps/remix-ide-e2e/src/tests/homeTab.test.ts @@ -12,6 +12,12 @@ describe('HomeTab e2e test', function () { browser .waitForElementVisible('*[data-id="homeTabNewFile"]') .click('*[data-id="homeTabNewFile"]') + // click again to make it work + .click('*[data-id="homeTabNewFile"]') + .waitForElementVisible('li[data-id="treeViewLitreeViewItem//blank"]') + .sendKeys('li[data-id="treeViewLitreeViewItem//blank"]', 'newTestFile') + .sendKeys('li[data-id="treeViewLitreeViewItem//blank"]', browser.Keys.ENTER) + .waitForElementVisible('li[data-id="treeViewLitreeViewItemnewTestFile.sol"]') }) after(browser => browser.end()); From 70c44c2db25c47032080f0d64c1c3648b8e909a7 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Tue, 27 Sep 2022 17:54:07 +0200 Subject: [PATCH 5/5] fix error --- apps/remix-ide-e2e/src/tests/homeTab.test.ts | 22 ++++++++------------ 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/homeTab.test.ts b/apps/remix-ide-e2e/src/tests/homeTab.test.ts index 8d3d643db1..81f78be22a 100644 --- a/apps/remix-ide-e2e/src/tests/homeTab.test.ts +++ b/apps/remix-ide-e2e/src/tests/homeTab.test.ts @@ -2,23 +2,19 @@ import { NightwatchBrowser } from 'nightwatch' import init from '../helpers/init' -describe('HomeTab e2e test', function () { +module.exports = { - before(function (browser: NightwatchBrowser, done: VoidFunction) { + before: function (browser: NightwatchBrowser, done: VoidFunction) { init(browser, done) - }) + }, - it('Should create new file', function (browser: NightwatchBrowser) { + 'Should create new file': function (browser: NightwatchBrowser) { browser .waitForElementVisible('*[data-id="homeTabNewFile"]') .click('*[data-id="homeTabNewFile"]') - // click again to make it work - .click('*[data-id="homeTabNewFile"]') - .waitForElementVisible('li[data-id="treeViewLitreeViewItem//blank"]') - .sendKeys('li[data-id="treeViewLitreeViewItem//blank"]', 'newTestFile') - .sendKeys('li[data-id="treeViewLitreeViewItem//blank"]', browser.Keys.ENTER) + .waitForElementContainsText('*[data-id$="/blank"]', '', 60000) + .sendKeys('*[data-id$="/blank"] .remixui_items', 'newTestFile') + .sendKeys('*[data-id$="/blank"] .remixui_items', browser.Keys.ENTER) .waitForElementVisible('li[data-id="treeViewLitreeViewItemnewTestFile.sol"]') - }) - - after(browser => browser.end()); -}) \ No newline at end of file + } +} \ No newline at end of file