Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

launchURL should not be hardcoded to 'localhost' #22

Open
tjad opened this issue Sep 25, 2023 · 1 comment
Open

launchURL should not be hardcoded to 'localhost' #22

tjad opened this issue Sep 25, 2023 · 1 comment

Comments

@tjad
Copy link

tjad commented Sep 25, 2023

The launch url is hardcoded to 'localhost'. I am wanting to do remote testing - via docker. This blocks me from being able to allow my test docker environment from using a custom url to the container hosting the vite server.

I initially logged an issue here, but I see that it is actually in the vite-plugin-nightwatch

nightwatchjs/nightwatch-plugin-react#7

I am using a vite_dev_server setup.

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

@heitorsilva
Copy link

@tjad if I'm not mistaken, you can customize what goes on this launchUrl variable via the nightwatch.conf.cjs file... for example:

test_settings: {
    default: {
      disable_error_log: false,
      launch_url: `http://127.0.0.1:${process.env.CI ? '4173' : '5173'}`,

      screenshots: {
        enabled: false,
        path: 'screens',
        on_failure: true
      },

      desiredCapabilities: {
        browserName: 'firefox'
      },

      webdriver: {
        start_process: true,
        server_path: ''
      }
    },

I'm using 127.0.0.1 with a ternary operator for port definition depending on the environment.
Just pass what you need there and you should be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants