check a text is before or after another text

Useful to check text order or sorting in a web table
It will not be in infinite loops as it needs to find both texts before the loop. See below code:
`
assertNotNull($elementBefore, sprintf('%s not found', $textBefore));
`
`
assertNotNull($elementAfter, sprintf('%s not found', $textAfter));
`
I did not use getText() to get the whole page text as there may be duplicated $textBefore or duplicated $textAfter. See Damian's concerns above.