The fuel cap test would only work when the problem occurs. If you just walked out to the tractor in the barn and removed the cap, that wouldn't tell us anything. If the tank vent is partly blocked, it takes a while of operation for vacuum to develop. The time to test is when the engine is losing power and stalling.
If that's how you tested it, then good we can eliminate that possibility.
I don't know if the electric fuel pump is supposed to operate continuously or just for a few seconds at start-up. That would be something to ascertain before replacing the pump, especially given the price!