Yes. Being Frightened does not stop a character from casting spells, but it does give them disadvantage on any attack rolls or ability checks related to the spell. So while it doesn’t prevent them from casting, it does make it much more difficult.