When running locally, the code works as expected, but when running on CI server (circle CI) it behaves strangely.
I call the #find
method passing in a css
selector, this normally returns the specific DOM node or throws an error.
card = find('.card__title', text: display_name).ancestor('.card')
expect(card).to have_no_selector('.read')
On the CI server, it doesn't throw an error, rather the variable card
has the value of:
#<Capybara::Node::Element tag="html" path="/HTML">
and the expectations fails, as it would if I wrote:
card = find(:xpath, '/html')
For the record, the return value of
card = find('.card__title', text: display_name).ancestor('.card')
On my local is:
#<Capybara::Node::Element
tag="article"
path="/HTML/BODY/DIV[1]/DIV[2]/DIV[2]/DIV/ARTICLE[3]">
What can possibly cause this behavior?