Check the motor connector. Unplug it and check for corroded/burned terminals in the connector and the motor receptacle. Pull on the wires to the connector to look for broken wire. Also check the connections at the thermal overload looking for the same conditions. With cabinet off and lid switch bypassed, set washer to spin and move the motor harness wires around, put pressure on the connector, trying to make it work as it is likely due to a faulty connection in this area.