Do you get crit-hits on spells that use and attack rather than a DC?

Does the Wizard’s Potent Cantrip feature apply to cantrips with attack rolls?

Does uncanny dodge work automatically on every seen attack the rogue gets hit with?