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

Debugger doesn't appear to respect the --env CLI parameter and use per-environment globals overwriting default globals #40

Open
NWinocur opened this issue Jan 12, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@NWinocur
Copy link

NWinocur commented Jan 12, 2024

Steps to replicate:

  • set up a nightwatch.conf.js file with both default globals, and per-environment globals
  • use the extensions radiobutton to select a non-default environment
  • press the play button to run (not debug) tests
  • observe test scripts behave as though the non-default environment's per-environment globals are usable (good)
  • press the debug button to debug tests
  • observe test scripts behave as though default environment's globals are in use, rather than values overwritten by per-environment globals (unexpected)

I strongly suspect that one of the two is occurring:

@NWinocur
Copy link
Author

If I'd ever done VSCode extension development before & knew how to test/verify my own work, and if I knew this repo was still being regularly maintained, I'd be more likely to submit a proper pull request with the bugfix myself.

But for whoever's reading who is already more ready than I am to dive in right now: I think the code for the nightwatch runner you'd need to copy or adapt to the debug provider is here:

`quickSettings.environments`,

and
https://github.com/nightwatchjs/nightwatch-vscode/blob/1bc3bed014b84e06f7046eebb77984318c13982a/src/NightwatchRunner/runner.ts#L102C1-L102C1

@vaibhavsingh97 vaibhavsingh97 added the bug Something isn't working label Jan 13, 2024
@vaibhavsingh97
Copy link
Member

vaibhavsingh97 commented Jan 13, 2024

@NWinocur I am currently afk, but I will later post here detailed steps on how you can test or verify the changes. I would love to help you submit the PR for this issue

@vaibhavsingh97
Copy link
Member

How to Contribute?

  1. Clone the repository

    g clone [email protected]:nightwatchjs/nightwatch-vscode.git
  2. Navigate to the project directory and install dependencies:

    cd nightwatch-vscode
    npm install
  3. Then, go to the sandbox folder and install its dependencies:

    cd sandbox && npm install && cd ../
  4. Open a new terminal tab and run:

    npm run watch
  5. Click on "Run and Debug" in your code editor and select "Run Extension."
    image

  6. Click Run Extension
    demo1 mov

  7. Now, you can make changes to the code. Use the refresh button to load the extension and test your changes.
    image

TIP

Toggle the "Debug" mode to view verbose logs in the console. This is helpful for debugging or testing.
image

You will see the logs in Debug console in your main editor, from which you ran the extension.
image

PS: I always uninstall the downloaded extension, so that it doesn't conflict with the development extension.

@vaibhavsingh97
Copy link
Member

I completely understand that contributing to an open source project can be a daunting task, and reproducing a bug can make things even more challenging. Please don't worry if you are not able to make it work in the first place. I want you to know that I'm here to support you every step of the way, and I'm confident that you will make progress. If you ever feel stuck, please don't hesitate to reach out to me. I'm always here to help you out.

PS: Feel free to modify the above instructions, and make it beginner friendly and create a new file Contributor.md. This will be of great help to new contributors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants