Improved re-use of test configuration and new Hamcrest matchers

Added hamcrest matchers: HasTextAfterElement, HasTextBeforeElement