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

Is it support template literals? #324

Open
zhiburt opened this issue Nov 13, 2020 · 4 comments
Open

Is it support template literals? #324

zhiburt opened this issue Nov 13, 2020 · 4 comments
Assignees

Comments

@zhiburt
Copy link

zhiburt commented Nov 13, 2020

Hey there,
as I see when we have this command

{
      "id": "87663521-6dd0-432f-9f85-84d9eebb7806",
      "comment": "",
      "command": "executeScript",
      "target": "let bar = \"123\"; return `${bar} hello`",
      "targets": [],
      "value": "seller_url"
    }, 

In selenium and in your runner the result is different

Selenese

[2020-11-13 20:04:22.297 +03:00] [INFO] <4> Command#4: executeScript("let bar = \"123\"; return `${bar} hello`", "seller_url")
[2020-11-13 20:04:22.328 +03:00] [INFO] - [null hello]

Selenium-IDE

image

It will be fair to say that I've been developing a similar tool as selenese for a while and bump into the same issue :(
I didn't know about existent of this repo before.

Thanks for selenese

ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals

@vmi
Copy link
Owner

vmi commented Dec 8, 2020

I fixed this problem and released version 3.33.0.
Please test it.

@zhiburt
Copy link
Author

zhiburt commented Jun 11, 2021

Hey @vmi I've review your changes it's seems to work 👍

I would only mention in a doc comment for replaceVars that it prioritize selenium vars after js vars if the names are the same.

@zhiburt
Copy link
Author

zhiburt commented Jun 11, 2021

Actually there's a major change in your code isn't it?
In case if variable isn't present in environment there will be not emitted anything but for example in Selenium IDE as I remember it emits empty string.

@zhiburt
Copy link
Author

zhiburt commented Jun 11, 2021

In case if variable isn't present in environment there will be not emitted anything but for example in Selenium IDE as I remember it emits empty string.

Ultimately I was wrong I guess.

But it will be interesting to hear you according to it

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

No branches or pull requests

2 participants