Are there critical hits for spells?

According to PHB p. 194 you always score a critical hit on any attack roll.

Does this rule also apply to magical attacks, e.g. the inflict wounds spell?