Capybara tests with first-child/last-child randomly fails so replaced with alternative method

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>