I'm working on creating Selenium tests for a very large Polymer webapp.
The developers would prefer that I don't modify the actual app.
So instead I'm trying to inject the extra pieces I need to make this easier using Javascript. I then want to inject this Javacript into the app using Selenium, before running the actual test.
But so far, I'm just trying things in the console to see what works.
So, for example, I want to add a dynamic class to this for example:
<span id="value" class="io-editor" tabindex="0" spellcheck="false" contenteditable></span>
If I actually go into the html, and add qasel_io-number_{{value}} as so:
<span id="value" class="io-editor qasel_io-number_{{value}}" tabindex="0" spellcheck="false" contenteditable></span>
And I have for example the value of 7, I get the expected result of a class named qasel_io-number_7
But I can't figure out how to do this dynamically after the fact.
Now I've tried a bunch of different ways to do this in javascript, both with and without using JQuery.
Here's an example of just one of the ways I've tried it.
$("body /deep/ .io-editor").addClass("qasel_io-number_{{value}}")
(I've also tried variations of this using Polymer's $$, also to no avail).
The classes get added, but the double brackets and value are inserted literally, instead of being "magical" properties.
How can I make {{value}} update automatically?
Thanks!