pull/4837/head
bunsenstraat 8 months ago
parent 2dbfe27b87
commit 5600d1cbeb
  1. 2
      apps/remixdesktop/package.json
  2. 9
      apps/remixdesktop/src/plugins/fsPlugin.ts
  3. 50
      apps/remixdesktop/test/nighwatch.app.ts
  4. 18
      apps/remixdesktop/test/tests/app/externaleditor.test.ts
  5. 11
      apps/remixdesktop/yarn.lock

@ -58,7 +58,7 @@
"@remixproject/plugin-electron": "0.3.43", "@remixproject/plugin-electron": "0.3.43",
"@vscode/ripgrep": "^1.15.6", "@vscode/ripgrep": "^1.15.6",
"add": "^2.0.6", "add": "^2.0.6",
"axios": "^1.6.1", "axios": "^1.6.8",
"byline": "^5.0.0", "byline": "^5.0.0",
"chokidar": "^3.5.3", "chokidar": "^3.5.3",
"electron-updater": "^6.1.8", "electron-updater": "^6.1.8",

@ -258,7 +258,7 @@ class FSPluginClient extends ElectronBasePluginClient {
depth: 0, depth: 0,
}) })
.on('all', async (eventName, path, stats) => { .on('all', async (eventName, path, stats) => {
this.watcherExec(eventName, path) this.watcherExec(eventName, convertPathToPosix(path))
}) })
.on('error', (error) => { .on('error', (error) => {
watcher.close() watcher.close()
@ -295,7 +295,6 @@ class FSPluginClient extends ElectronBasePluginClient {
} else { } else {
try { try {
const dirname = path.dirname(pathWithoutPrefix) const dirname = path.dirname(pathWithoutPrefix)
//console.log('check emitting', eventName, pathWithoutPrefix, this.expandedPaths, dirname)
if (this.expandedPaths.includes(dirname) || this.expandedPaths.includes(pathWithoutPrefix)) { if (this.expandedPaths.includes(dirname) || this.expandedPaths.includes(pathWithoutPrefix)) {
//console.log('emitting', eventName, pathWithoutPrefix, this.expandedPaths) //console.log('emitting', eventName, pathWithoutPrefix, this.expandedPaths)
//this.emit('change', eventName, pathWithoutPrefix) //this.emit('change', eventName, pathWithoutPrefix)
@ -390,7 +389,7 @@ class FSPluginClient extends ElectronBasePluginClient {
} }
path = dirs && dirs.length && dirs[0] ? dirs[0] : path path = dirs && dirs.length && dirs[0] ? dirs[0] : path
if (!path) return if (!path) return
this.workingDir = path this.workingDir = convertPathToPosix(path)
await this.updateRecentFolders(path) await this.updateRecentFolders(path)
await this.updateOpenedFolders(path) await this.updateOpenedFolders(path)
this.window.setTitle(this.workingDir) this.window.setTitle(this.workingDir)
@ -400,7 +399,7 @@ class FSPluginClient extends ElectronBasePluginClient {
async setWorkingDir(path: string): Promise<void> { async setWorkingDir(path: string): Promise<void> {
console.log('setWorkingDir', path) console.log('setWorkingDir', path)
this.workingDir = path this.workingDir = convertPathToPosix(path)
await this.updateRecentFolders(path) await this.updateRecentFolders(path)
await this.updateOpenedFolders(path) await this.updateOpenedFolders(path)
this.window.setTitle(getBaseName(this.workingDir)) this.window.setTitle(getBaseName(this.workingDir))
@ -466,7 +465,7 @@ export class FSPluginClientE2E extends FSPluginClient {
async openFolderInSameWindow(dir?: string): Promise<void> { async openFolderInSameWindow(dir?: string): Promise<void> {
dir = await this.selectFolder(dir) dir = await this.selectFolder(dir)
if (!dir) return if (!dir) return
this.workingDir = dir this.workingDir = convertPathToPosix(dir)
await this.updateRecentFolders(dir) await this.updateRecentFolders(dir)
await this.updateOpenedFolders(dir) await this.updateOpenedFolders(dir)
this.window.setTitle(this.workingDir) this.window.setTitle(this.workingDir)

@ -1,51 +1,15 @@
const os = require('os'); const os = require('os');
const http = require('http'); const http = require('http');
import axios from 'axios';
const useIsoGit = process.argv.includes('--useIsoGit'); const useIsoGit = process.argv.includes('--useIsoGit');
const useOffline = process.argv.includes('--useOffline'); const useOffline = process.argv.includes('--useOffline');
// Function to check if localhost:8080 is active
function checkLocalhost8080Active(callback) {
const options = {
hostname: 'localhost',
port: 8080,
path: '/',
method: 'GET',
};
const req = http.request(options, (res) => {
console.log(`Status Code: ${res.statusCode}`);
if (res.statusCode === 200) {
callback(true); // Server is active
} else {
callback(false); // Server is running but returned a non-success status code
}
});
req.on('error', (error) => {
//console.error(error);
callback(false); // Server is not active
});
req.end();
}
// Determine if running on CircleCI or locally with --e2e-local // Determine if running on CircleCI or locally with --e2e-local
const isLocalE2E = process.argv.includes('--e2e-local') && !process.env.CIRCLECI; const isLocalE2E = process.argv.includes('--e2e-local') && !process.env.CIRCLECI;
if (isLocalE2E) {
checkLocalhost8080Active((isActive) => {
if (!isActive) {
console.error('localhost:8080 is not active. Please start the server before running tests.');
process.exit(1); // Exit if localhost:8080 is not active
} else {
console.log('localhost:8080 is active. Proceeding with tests.');
// The script can continue to the Nightwatch configuration below if needed
}
});
}
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',
@ -88,18 +52,6 @@ module.exports = {
if(useIsoGit) args = [...args, '--useIsoGit']; if(useIsoGit) args = [...args, '--useIsoGit'];
if(useOffline) args = [...args, '--useOffline']; if(useOffline) args = [...args, '--useOffline'];
if(!process.env.CIRCLECI){
checkLocalhost8080Active((isActive)=>{
if(!isActive){
console.error('localhost:8080 is not active. Please start the server before running tests.');
process.exit(1); // Exit if localhost:8080 is not active
} else {
console.log('localhost:8080 is active. Proceeding with tests.');
// The script can continue to the Nightwatch configuration below if needed
}
});
}
switch (type) { switch (type) {
case 'Windows_NT': case 'Windows_NT':
binaryPath = "./release/win-unpacked/Remix-Desktop.exe"; binaryPath = "./release/win-unpacked/Remix-Desktop.exe";

@ -76,31 +76,33 @@ const testsWindows = {
.pause(1000) .pause(1000)
.perform(function () { .perform(function () {
const actions = this.actions({async: true}) const actions = this.actions({async: true})
return actions.sendKeys('New-Item -ItemType Directory -Name "dir" && Set-Location -Path "./dir" && "test" | Out-File -FilePath example.txt').sendKeys(this.Keys.ENTER) return actions.sendKeys('New-Item -ItemType Directory -Name "dir" ; Set-Location -Path "./dir" ; Add-Content -Path "example.txt" -Value "test" -Encoding UTF8').sendKeys(this.Keys.ENTER)
}) })
.pause(1000)
.waitForElementVisible('*[data-id="treeViewLitreeViewItemdir"]', 10000) .waitForElementVisible('*[data-id="treeViewLitreeViewItemdir"]', 10000)
.openFile('dir') .openFile('dir')
.waitForElementVisible('*[data-id="treeViewLitreeViewItemdir/example.txt"]', 10000) .waitForElementVisible('*[data-id="treeViewLitreeViewItemdir/example.txt"]', 10000)
.openFile('dir/example.txt') .openFile('dir/example.txt').pause(1000)
.getEditorValue((result) => { .getEditorValue((result) => {
browser.assert.equal(result, 'test\n') browser.assert.equal(result, 'test\r\n')
}) })
.waitForElementVisible('*[data-type="remixUIXT"]', 10000) .pause(1000)
.click('*[data-type="remixUIXT"]') .waitForElementVisible("[data-active='1'][data-type='remixUIXT']", 10000)
.click("[data-active='1'][data-type='remixUIXT']")
.perform(function () { .perform(function () {
const actions = this.actions({async: true}) const actions = this.actions({async: true})
return actions.sendKeys('"123" | Out-File -FilePath "example.txt" -Append').sendKeys(this.Keys.ENTER) return actions.sendKeys('Add-Content -Path "example.txt" -Value "123" -Encoding UTF8').sendKeys(this.Keys.ENTER)
}) })
.pause(1000) .pause(1000)
.getEditorValue((result) => { .getEditorValue((result) => {
browser.assert.equal(result, 'test\n123\n') browser.assert.equal(result, 'test\r\n123\r\n')
}) })
.setEditorValue('somethinginthere') .setEditorValue('somethinginthere')
.pause(1000) .pause(1000)
.perform(function () { .perform(function () {
const actions = this.actions({async: true}) const actions = this.actions({async: true})
return actions.sendKeys('Get-Content example.txt').sendKeys(this.Keys.ENTER) return actions.sendKeys('Get-Content example.txt').sendKeys(this.Keys.ENTER)
}) }).pause(1000)
.getText( .getText(
{ {
selector: "//*[@data-type='remixUIXT' and @data-active='1']", selector: "//*[@data-type='remixUIXT' and @data-active='1']",

@ -1206,7 +1206,7 @@ axios@^0.27.2:
follow-redirects "^1.14.9" follow-redirects "^1.14.9"
form-data "^4.0.0" form-data "^4.0.0"
axios@^1.4.0: axios@^1.4.0, axios@^1.6.8:
version "1.6.8" version "1.6.8"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.8.tgz#66d294951f5d988a00e87a0ffb955316a619ea66" resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.8.tgz#66d294951f5d988a00e87a0ffb955316a619ea66"
integrity sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ== integrity sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==
@ -1215,15 +1215,6 @@ axios@^1.4.0:
form-data "^4.0.0" form-data "^4.0.0"
proxy-from-env "^1.1.0" proxy-from-env "^1.1.0"
axios@^1.6.1:
version "1.6.1"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.1.tgz#76550d644bf0a2d469a01f9244db6753208397d7"
integrity sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g==
dependencies:
follow-redirects "^1.15.0"
form-data "^4.0.0"
proxy-from-env "^1.1.0"
b4a@^1.6.4: b4a@^1.6.4:
version "1.6.4" version "1.6.4"
resolved "https://registry.yarnpkg.com/b4a/-/b4a-1.6.4.tgz#ef1c1422cae5ce6535ec191baeed7567443f36c9" resolved "https://registry.yarnpkg.com/b4a/-/b4a-1.6.4.tgz#ef1c1422cae5ce6535ec191baeed7567443f36c9"

Loading…
Cancel
Save