Writing a selector based on a background color question

17 views
Skip to first unread message

ibli...@gmail.com

unread,
Oct 23, 2017, 12:14:06 PM10/23/17
to Spock Framework - User
Hi... 

I was hoping to ask for a little help. 

I've attached a sample of the html I'm looking at. 

I was hoping to write a selector in a spock test based around the background color. 

I'd like to select the line with the yellow background color(rgba(255, 255, 0, 0.3)) with the class = "highlight_outer" 

But the yellow background color can appear on any of the html lines. 

So far what I have is: 

when: 
def firstHighlight = $( "div.highlight_outer").first()

then: 
assert firstHighlight.css("background color") == "rgba(255, 255, 0, 0.3)" 

This works ok but of course only for when the yellow background color is on the first line of the set. 

Any ideas how I can write a selector to pick out the yellow background color line wherever it occurs in the set? 

Thanks so much... 


background color Capture.JPG
Reply all
Reply to author
Forward
0 new messages