Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions nightwatch/commands/launchComponentRenderer.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
module.exports = class Command {
async command() {
let launchUrl = '';
const {vite_dev_server, vite_port} = this.client.settings;
let launchUrl = new URL(this.api.globals.launchUrl ?? this.client.settings.launchUrl ?? 'http://localhost:5173');
const { vite_dev_server, vite_port } = this.client.settings;

if (vite_dev_server) {
const port = vite_dev_server.port || 5173;
launchUrl = `http://localhost:${port}`;
} else if (this.api.globals.launchUrl) {
launchUrl = this.api.globals.launchUrl;
launchUrl.port = vite_port || 5173
}

if (global.viteServer) {
const protocol = global.viteServer.config.server.https ? 'https' : 'http';
launchUrl = `${protocol}://localhost:${global.viteServer.config.port}`;
launchUrl.port = global.viteServer.config.port;
const protocol = global.viteServer.config.server.https ? "https" : "http";
launchUrl.protocol = protocol;
}

return this.api.navigateTo(`${launchUrl}/_nightwatch/`);
launchUrl.pathname = '/_nightwatch/';

return this.api.navigateTo(launchUrl.toString());
}
};