fixes #14350 - replace selector to ensure Capybara wait is used
The CSS selector using .all wouldn't wait for a matching element to be rendered, so any delay could cause it to match nothing. Since text can't be matched in a CSS selector, it's been replaced with an XPath selector.
The test was also passing a block to Array#first, which was ignored causing the wrong item to be selected.
Related issues
Bug #14350: Intermittent HostgroupJSTest.test_0001_submit updates taxonomy test failures
fixes #14350 - replace selector to ensure Capybara wait is used
The CSS selector using .all wouldn't wait for a matching element to be
rendered, so any delay could cause it to match nothing. Since text can't
be matched in a CSS selector, it's been replaced with an XPath selector.
The test was also passing a block to Array#first, which was ignored
causing the wrong item to be selected.