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

Global variables not working #19

Open
riccardocossu opened this issue Dec 6, 2022 · 2 comments
Open

Global variables not working #19

riccardocossu opened this issue Dec 6, 2022 · 2 comments
Assignees

Comments

@riccardocossu
Copy link

riccardocossu commented Dec 6, 2022

I have this problem on debian (I tried it on windows but it didn't start); I am using the -a flag, which I expect to work like the "Run all" button in Idea.

I use this pattern in my tests (this works in Idea): I first login, get a token, set it in client.global and use it for several later calls.

Authorization: Bearer {{authToken}}

I debugged the issue and it turns out that global it's not working. Calling this in the script, it prints "undefined":

`client.global.set("authToken",response.body.access_token);

client.log(client.global.get("authToken"));`

Edit: I further investigated the problem and it is definitely in the JS part; it seems that the global_variables.json is written only at startup, using global.set never writes it. I am using debian on WSL2

@linux-china linux-china self-assigned this Dec 7, 2022
@riccardocossu
Copy link
Author

never mind, Jetbrains released a CLI runner a couple of days ago. That's what I am gonna use

@linux-china
Copy link
Collaborator

@riccardocossu for integration test, and HTTP Client CLI is better. httpx is native image binary, and JS is executed by external Node(not rhino embedded) and hard to implement some features.

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