pull/4837/head
bunsenstraat 8 months ago
parent 4270fc5c5f
commit 36dfcad8a9
  1. 38
      .circleci/config.yml
  2. 1
      apps/remixdesktop/src/plugins/fsPlugin.ts
  3. 1
      apps/remixdesktop/test/nighwatch.app.ts
  4. 27
      apps/remixdesktop/test/tests/app/git.test.ts
  5. 33
      apps/remixdesktop/test/tests/app/templates.test.ts
  6. 13
      apps/remixdesktop/test/tests/app/xterm.test.ts
  7. 6
      libs/remix-ui/home-tab/src/lib/components/homeTabFileElectron.tsx

@ -104,6 +104,40 @@ jobs:
paths: paths:
- "persist" - "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: build-remixdesktop-linux:
machine: machine:
image: ubuntu-2004:current image: ubuntu-2004:current
@ -135,6 +169,7 @@ jobs:
path: apps/remixdesktop/release/ path: apps/remixdesktop/release/
destination: remixdesktop-linux destination: remixdesktop-linux
build-remixdesktop-windows: build-remixdesktop-windows:
executor: executor:
name: win/default # executor type name: win/default # executor type
@ -541,6 +576,9 @@ workflows:
- build-remixdesktop-linux: - build-remixdesktop-linux:
requires: requires:
- build-desktop - build-desktop
- test-remixdesktop-linux:
requires:
- build-desktop
- build-plugin: - build-plugin:
matrix: matrix:
parameters: parameters:

@ -404,7 +404,6 @@ class FSPluginClient extends ElectronBasePluginClient {
this.window.setTitle(getBaseName(this.workingDir)) this.window.setTitle(getBaseName(this.workingDir))
this.watch() this.watch()
this.emit('workingDirChanged', path) this.emit('workingDirChanged', path)
await this.call('fileManager', 'closeAllFiles')
} }
async revealInExplorer(action: customAction, isAbsolutePath: boolean = false): Promise<void> { async revealInExplorer(action: customAction, isAbsolutePath: boolean = false): Promise<void> {

@ -1,6 +1,7 @@
module.exports = { module.exports = {
src_folders: ['build-e2e/remixdesktop/test/tests/app'], src_folders: ['build-e2e/remixdesktop/test/tests/app'],
output_folder: './reports/tests', output_folder: './reports/tests',
custom_commands_path: ['build-e2e/remix-ide-e2e/src/commands'],
custom_assertions_path: '', custom_assertions_path: '',
page_objects_path: '', page_objects_path: '',
globals_path: '', globals_path: '',

@ -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()
}
}

@ -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()
}
}

@ -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()
}
}

@ -32,9 +32,9 @@ export const HomeTabFileElectron = ({ plugin }: HomeTabFileProps) => {
<label style={{ fontSize: "0.8rem" }} className="pt-2"><FormattedMessage id='home.loadFrom' /></label> <label style={{ fontSize: "0.8rem" }} className="pt-2"><FormattedMessage id='home.loadFrom' /></label>
<div className="d-flex"> <div className="d-flex">
<button className="btn p-2 border mr-2" data-id="landingPageImportFromGistButton" onClick={async () => await loadTemplate()}>Project Template</button> <button className="btn p-2 border mr-2" data-id="landingPageImportFromTemplate" onClick={async () => await loadTemplate()}>Project Template</button>
<button className="btn p-2 border mr-2" data-id="landingPageImportFromGistButton" onClick={async () => await clone()}>Clone a Git Repository</button> <button className="btn p-2 border mr-2" data-id="landingPageImportFromGit" onClick={async () => await clone()}>Clone a Git Repository</button>
<button className="btn p-2 border mr-2" data-id="landingPageImportFromGistButton" onClick={() => importFromGist()}>Gist</button> <button className="btn p-2 border mr-2" data-id="landingPageImportFromGist" onClick={() => importFromGist()}>Gist</button>
</div> </div>
</div> </div>
) )

Loading…
Cancel
Save