I have a link:
link_to %q(<span class='glyphicon glyphicon-trash'/>).html_safe, feed_item, data: {confirm: 'Are you sure?',toggle: 'tooltip'}, method: :delete, title: 'Delete', id: 'delete_post'
and the following feature spec code
page.accept_confirm do
click_link 'delete_post'
end
and I get the following error
Capybara::Webkit::ClickFailed:
Failed to find position for element /html/body/div[@id='wrapper']/div[@id='page-content-wrapper']/div/div[@id='main']/div[@id='main_content']/div[4]/div/div/div[1]/h3/div/a[@id='delete_post']
If I replace the span with the glyphicon by some text e.g. 'Delete', the test works. This appears to be related to an unresolved issue on Github, and may be to do with CSS overlaying the clickable html element. However, I cannot understand how this overlaying is happening in this case or how to correct it.
It is becoming a common practice to use icons for common tasks like 'Edit" or 'Delete', so it would be good to find a solution to this.
How do I work around this problem?