If the display order is the same as in html, for example:
<div id="one">This</div> <div id="two">That</div> <div id="three">The other thing</div> <div id="four">And one more item</div>
Then it should be possible as follows:
it "should have the right order" do elements = all('#one, #two, #three, #four'); # all in one selector expect(elements[0]['id']).to eql('one'); expect(elements[1]['id']).to eql('two'); expect(elements[2]['id']).to eql('three'); expect(elements[3]['id']).to eql('four'); end
The order of the elements should be the same as in the document. I tested it myself.
source share