diff --git a/apps/remixdesktop/package.json b/apps/remixdesktop/package.json index 3f9fda914c..b72f8ee94e 100644 --- a/apps/remixdesktop/package.json +++ b/apps/remixdesktop/package.json @@ -58,7 +58,7 @@ "@remixproject/plugin-electron": "0.3.43", "@vscode/ripgrep": "^1.15.6", "add": "^2.0.6", - "axios": "^1.6.1", + "axios": "^1.6.8", "byline": "^5.0.0", "chokidar": "^3.5.3", "electron-updater": "^6.1.8", diff --git a/apps/remixdesktop/src/plugins/fsPlugin.ts b/apps/remixdesktop/src/plugins/fsPlugin.ts index ea091e3429..1d75fbb5b3 100644 --- a/apps/remixdesktop/src/plugins/fsPlugin.ts +++ b/apps/remixdesktop/src/plugins/fsPlugin.ts @@ -258,7 +258,7 @@ class FSPluginClient extends ElectronBasePluginClient { depth: 0, }) .on('all', async (eventName, path, stats) => { - this.watcherExec(eventName, path) + this.watcherExec(eventName, convertPathToPosix(path)) }) .on('error', (error) => { watcher.close() @@ -295,7 +295,6 @@ class FSPluginClient extends ElectronBasePluginClient { } else { try { const dirname = path.dirname(pathWithoutPrefix) - //console.log('check emitting', eventName, pathWithoutPrefix, this.expandedPaths, dirname) if (this.expandedPaths.includes(dirname) || this.expandedPaths.includes(pathWithoutPrefix)) { //console.log('emitting', eventName, pathWithoutPrefix, this.expandedPaths) //this.emit('change', eventName, pathWithoutPrefix) @@ -390,7 +389,7 @@ class FSPluginClient extends ElectronBasePluginClient { } path = dirs && dirs.length && dirs[0] ? dirs[0] : path if (!path) return - this.workingDir = path + this.workingDir = convertPathToPosix(path) await this.updateRecentFolders(path) await this.updateOpenedFolders(path) this.window.setTitle(this.workingDir) @@ -400,7 +399,7 @@ class FSPluginClient extends ElectronBasePluginClient { async setWorkingDir(path: string): Promise { console.log('setWorkingDir', path) - this.workingDir = path + this.workingDir = convertPathToPosix(path) await this.updateRecentFolders(path) await this.updateOpenedFolders(path) this.window.setTitle(getBaseName(this.workingDir)) @@ -466,7 +465,7 @@ export class FSPluginClientE2E extends FSPluginClient { async openFolderInSameWindow(dir?: string): Promise { dir = await this.selectFolder(dir) if (!dir) return - this.workingDir = dir + this.workingDir = convertPathToPosix(dir) await this.updateRecentFolders(dir) await this.updateOpenedFolders(dir) this.window.setTitle(this.workingDir) diff --git a/apps/remixdesktop/test/nighwatch.app.ts b/apps/remixdesktop/test/nighwatch.app.ts index b82cf2eecb..558c357eb6 100644 --- a/apps/remixdesktop/test/nighwatch.app.ts +++ b/apps/remixdesktop/test/nighwatch.app.ts @@ -1,51 +1,15 @@ const os = require('os'); const http = require('http'); +import axios from 'axios'; const useIsoGit = process.argv.includes('--useIsoGit'); 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 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 = { src_folders: ['build-e2e/remixdesktop/test/tests/app'], output_folder: './reports/tests', @@ -88,18 +52,6 @@ module.exports = { if(useIsoGit) args = [...args, '--useIsoGit']; 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) { case 'Windows_NT': binaryPath = "./release/win-unpacked/Remix-Desktop.exe"; diff --git a/apps/remixdesktop/test/tests/app/externaleditor.test.ts b/apps/remixdesktop/test/tests/app/externaleditor.test.ts index a3479d38bf..89e991fdcd 100644 --- a/apps/remixdesktop/test/tests/app/externaleditor.test.ts +++ b/apps/remixdesktop/test/tests/app/externaleditor.test.ts @@ -76,31 +76,33 @@ const testsWindows = { .pause(1000) .perform(function () { 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) .openFile('dir') .waitForElementVisible('*[data-id="treeViewLitreeViewItemdir/example.txt"]', 10000) - .openFile('dir/example.txt') + .openFile('dir/example.txt').pause(1000) .getEditorValue((result) => { - browser.assert.equal(result, 'test\n') + browser.assert.equal(result, 'test\r\n') }) - .waitForElementVisible('*[data-type="remixUIXT"]', 10000) - .click('*[data-type="remixUIXT"]') + .pause(1000) + .waitForElementVisible("[data-active='1'][data-type='remixUIXT']", 10000) + .click("[data-active='1'][data-type='remixUIXT']") .perform(function () { 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) .getEditorValue((result) => { - browser.assert.equal(result, 'test\n123\n') + browser.assert.equal(result, 'test\r\n123\r\n') }) .setEditorValue('somethinginthere') .pause(1000) .perform(function () { const actions = this.actions({async: true}) return actions.sendKeys('Get-Content example.txt').sendKeys(this.Keys.ENTER) - }) + }).pause(1000) .getText( { selector: "//*[@data-type='remixUIXT' and @data-active='1']", diff --git a/apps/remixdesktop/yarn.lock b/apps/remixdesktop/yarn.lock index 8eaf42aacf..29f41755ac 100644 --- a/apps/remixdesktop/yarn.lock +++ b/apps/remixdesktop/yarn.lock @@ -1206,7 +1206,7 @@ axios@^0.27.2: follow-redirects "^1.14.9" form-data "^4.0.0" -axios@^1.4.0: +axios@^1.4.0, axios@^1.6.8: version "1.6.8" resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.8.tgz#66d294951f5d988a00e87a0ffb955316a619ea66" integrity sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ== @@ -1215,15 +1215,6 @@ axios@^1.4.0: form-data "^4.0.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: version "1.6.4" resolved "https://registry.yarnpkg.com/b4a/-/b4a-1.6.4.tgz#ef1c1422cae5ce6535ec191baeed7567443f36c9"