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

TestCaseWriter login cookie variable name #989

Open
chrstphlbr opened this issue May 24, 2024 · 2 comments
Open

TestCaseWriter login cookie variable name #989

chrstphlbr opened this issue May 24, 2024 · 2 comments
Labels

Comments

@chrstphlbr
Copy link

Hi,

I was just trying to execute EM-generated REST test suites and ran into a compilation error when the login username contains characters that are not permissible as variable names.

As an example: if I have a login username that contains a hyphen (e.g., my-user) the org.evomaster.core.output.auth.CookieWriter (via org.evomaster.core.output.service.ApiTestCaseWriter) will generate the variable name cookies_my-user, which leads to a compilation error.

I assume that this line (https://github.com/EMResearch/EvoMaster/blob/0d6e01be737e8a7a434907eda651d29f1e2ffef3/core/src/main/kotlin/org/evomaster/core/output/auth/CookieWriter.kt#L20) is the place to fix it.

Let me know if you need any more infos.

Christoph

@arcuri82 arcuri82 added the bug label May 24, 2024
@arcuri82
Copy link
Collaborator

hi,

thx for reporting this bug. indeed, as that name is provided by the user, it could contain invalid characters for a variable.

@arcuri82
Copy link
Collaborator

@chrstphlbr btw, the name is just a label. it does not have to match the actual username. so an easy workaround is to change the label name into my_user while the actual username used in the username field can stay as my-user

arcuri82 added a commit that referenced this issue Aug 18, 2024
arcuri82 added a commit that referenced this issue Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants