diff --git a/.circleci/config.yml b/.circleci/config.yml index adc592c1c4..3fb2b5e277 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -104,6 +104,40 @@ jobs: paths: - "persist" + test-remixdesktop-linux: + machine: + image: ubuntu-2004:current + resource_class: + xlarge + working_directory: ~/remix-project + steps: + - run: ldd --version + - checkout + - attach_workspace: + at: . + - run: unzip ./persist/desktopbuild.zip + - run: + command: | + node -v + mkdir apps/remixdesktop/build + cp -r dist/apps/remix-ide apps/remixdesktop/build + cd apps/remixdesktop/ + yarn add node-pty + yarn --ignore-optional + yarn add @remix-project/remix-ws-templates + yarn dist + yarn run selenium-install + - run: + name: "Run selenium" + command: | + yarn run selenium + background: true + - run: + name: "Run tests" + command: | + cd apps/remixdesktop/ + yarn run build:e2e && yarn run test:app:linuxlocal + build-remixdesktop-linux: machine: image: ubuntu-2004:current @@ -135,6 +169,7 @@ jobs: path: apps/remixdesktop/release/ destination: remixdesktop-linux + build-remixdesktop-windows: executor: name: win/default # executor type @@ -541,6 +576,9 @@ workflows: - build-remixdesktop-linux: requires: - build-desktop + - test-remixdesktop-linux: + requires: + - build-desktop - build-plugin: matrix: parameters: diff --git a/apps/remixdesktop/src/plugins/fsPlugin.ts b/apps/remixdesktop/src/plugins/fsPlugin.ts index c9138be53a..61fbc8cb65 100644 --- a/apps/remixdesktop/src/plugins/fsPlugin.ts +++ b/apps/remixdesktop/src/plugins/fsPlugin.ts @@ -404,7 +404,6 @@ class FSPluginClient extends ElectronBasePluginClient { this.window.setTitle(getBaseName(this.workingDir)) this.watch() this.emit('workingDirChanged', path) - await this.call('fileManager', 'closeAllFiles') } async revealInExplorer(action: customAction, isAbsolutePath: boolean = false): Promise { diff --git a/apps/remixdesktop/test/nighwatch.app.ts b/apps/remixdesktop/test/nighwatch.app.ts index 12200d32f6..ccb2b78505 100644 --- a/apps/remixdesktop/test/nighwatch.app.ts +++ b/apps/remixdesktop/test/nighwatch.app.ts @@ -1,6 +1,7 @@ module.exports = { src_folders: ['build-e2e/remixdesktop/test/tests/app'], output_folder: './reports/tests', + custom_commands_path: ['build-e2e/remix-ide-e2e/src/commands'], custom_assertions_path: '', page_objects_path: '', globals_path: '', diff --git a/apps/remixdesktop/test/tests/app/git.test.ts b/apps/remixdesktop/test/tests/app/git.test.ts new file mode 100644 index 0000000000..106b6707d4 --- /dev/null +++ b/apps/remixdesktop/test/tests/app/git.test.ts @@ -0,0 +1,27 @@ +import { NightwatchBrowser } from 'nightwatch' + + +module.exports = { + before: function (browser: NightwatchBrowser, done: VoidFunction) { + done() + }, + 'clone a repo': function (browser: NightwatchBrowser) { + browser + .waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) + .waitForElementVisible('button[data-id="landingPageImportFromGit"]') + .click('button[data-id="landingPageImportFromGit"]') + .pause(1000) + .waitForElementVisible('[data-id="fileSystemModalDialogModalBody-react"]') + .click('[data-id="fileSystemModalDialogModalBody-react"]') + .waitForElementVisible('[data-id="modalDialogCustomPromptTextClone"]') + .setValue('[data-id="modalDialogCustomPromptTextClone"]', 'https://github.com/ethereum/awesome-remix') + .click('[data-id="fileSystem-modal-footer-ok-react"]') + .pause(3000) + .windowHandles(function (result) { + console.log(result.value) + browser.switchWindow(result.value[1]) + .waitForElementVisible('*[data-id="treeViewLitreeViewItem.git"]') + }) + .end() + } +} \ No newline at end of file diff --git a/apps/remixdesktop/test/tests/app/templates.test.ts b/apps/remixdesktop/test/tests/app/templates.test.ts new file mode 100644 index 0000000000..4c4bdc4753 --- /dev/null +++ b/apps/remixdesktop/test/tests/app/templates.test.ts @@ -0,0 +1,33 @@ +import { NightwatchBrowser } from 'nightwatch' + + +module.exports = { + before: function (browser: NightwatchBrowser, done: VoidFunction) { + done() + }, + 'open default template': function (browser: NightwatchBrowser) { + browser + .waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000) + .waitForElementVisible('button[data-id="landingPageImportFromTemplate"]') + .click('button[data-id="landingPageImportFromTemplate"]') + .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') + .waitForElementPresent('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') + .click('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok') + .pause(3000) + .windowHandles(function (result) { + console.log(result.value) + browser.switchWindow(result.value[1]) + .waitForElementVisible('*[data-id="treeViewLitreeViewItemtests"]') + .click('*[data-id="treeViewLitreeViewItemtests"]') + .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]') + .click('*[data-id="treeViewLitreeViewItemcontracts"]') + .waitForElementVisible('[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]') + .openFile('contracts/1_Storage.sol') + .waitForElementVisible('*[id="editorView"]', 10000) + .getEditorValue((content) => { + browser.assert.ok(content.includes('function retrieve() public view returns (uint256){')) + }) + }) + .end() + } +} \ No newline at end of file diff --git a/apps/remixdesktop/test/tests/app/xterm.test.ts b/apps/remixdesktop/test/tests/app/xterm.test.ts deleted file mode 100644 index e56322b495..0000000000 --- a/apps/remixdesktop/test/tests/app/xterm.test.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { NightwatchBrowser } from 'nightwatch' - - -module.exports = { - before: function (browser: NightwatchBrowser, done: VoidFunction) { - done() - }, - 'open app': function (browser: NightwatchBrowser) { - browser - .pause() - .end() - } -} \ No newline at end of file diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabFileElectron.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabFileElectron.tsx index 1f67cfaff5..3d9fdd3c8f 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabFileElectron.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabFileElectron.tsx @@ -32,9 +32,9 @@ export const HomeTabFileElectron = ({ plugin }: HomeTabFileProps) => {
- - - + + +
)