Yes.
First, the end condition of the fear spell (PHB, pg. 239):
If the creature ends its turn in a location where it doesn't have line of sight to you, the creature can make a Wisdom saving throw. On a successful save, the spell ends for that creature.
So when the creature can no longer see the caster, it may make the save. On a success the effect ends, on a failure, return to the beginning of the paragraph:
While frightened by this spell, a creature must take the Dash action and move away from you by the safest available route on each of its turns, unless there is nowhere to move.
This is the effect of the spell, and this describes what you do until you succeed on the save.
This answer gives some insight into what this may look like in play. Essentially, you are compelled to move away from where you think the source of the fear is.