MDL-46572 behat: extended table head look up to check if header is link

Header can be a link, this step will now look if
header has a text or header link has the text
MDL-46572 gradereport_history: added behat test