Using protractor control flow to make test robust