Based on these elements:
1. You have a washer made by Whirlpool.
2. The motor runs during agitation and spin, wherever those actions are
supposed to occur.
3. It doesn't agitate, though, and it doesn't spin either, but it does
You have a broken motor coupling. You can look online on how to
replace it. The part number is 285753.