Can't add more than one step on the same element
See original GitHub issueHi there!
I have a use case that involves running two different steps on the same element. (Specifically, I’m trying to update the contents of this div
with Angular between steps.)
Example:
driver.defineSteps([
{
element: '#thing1',
popover: {
title: 'Thing 1',
position: 'top'
}
},
{
element: '#thing2',
popover: {
title: 'Thing 2, Part 1',
position: 'top'
}
},
{
element: '#thing2',
popover: {
title: 'Thing 2, Part 2',
position: 'top'
}
},
]);
When I do that, I see “Thing 1” and “Thing 2, Part 1”. When I click Next, nothing seems to happen – i.e. the popover doesn’t update, so the title doesn’t change to “Thing2, Part 2” and the Close button isn’t added. When I click Next again, the driver ends altogether as if I were looking at the last step.
I’ve also tried using a different element selector, like div#thing2
or .class#thing2
, but it behaves the same way as if I reference them identically (like in my example).
Any light you can shed on this would be wonderful! 😄
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How to appendChild(element) many times. (The same element)
The problem is that I can't append the same element that many times. It just creates one element instead of 4. For you...
Read more >4 reasons your z-index isn't working (and how to fix it)
Solution: Move the modal outside of the content parent, and into the main stacking context of the page. ... Now, the modal element...
Read more >Apply multiple animation effects to one object - Microsoft Support
Open the Animation Pane. Select the object on the slide that you want to animate. On the Animations tab, click Animation Pane. Open...
Read more >Cascade, specificity, and inheritance - Learn web development
Often, the problem is that you create two rules that apply different values of the same property to the same element.
Read more >Configuring a Step - Spring
If the same standalone step is referenced in more than one step in ... To allow a child to add additional listeners to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can put two classes on the same element and put every class in a step 😆 Didn’t try it but seems cleaner and it should work!
I ran into this same issue trying to add multiple steps on a single element – basically a complicated explanation broken up into several smaller parts, but all about the same element.
I managed to find a workaround by surrounding the element in question (e.g.
#thing2
) with a superfluous div element (say#thing3
), and then alternating back and forth between the two until all steps for the element are completed.This is an example of what the page structure might look like before the change:
And this is what it would look like after applying the workaround:
This might not work for your case if the div itself is changing, but I found it worked out perfectly despite being a bit of a kludge, in the sense that the switching between divs is completely transparent when the driver is running (since they are the same size and one is on top of the other).
In any case, as far as I can tell, this is the only relatively simple way to work around this bug for the moment.