Testing Lid Switch

My washer agitates but does not empty/rinse/or spin.

When I lift the lid it stops agitating and starts again when lid is lowered.

The timer moves from wash to off but it doesn’t go into the various cycles other than the initial wash. It will agitate on rinse but with the old wash water still in the tub.

Will it still agitate with a bad lid switch?

Is this a bad lid switch or timer?

Thanks for any help.