How to test the ignitor, camshaft sensor, and coil? on 1994 Toyota Camry

Car starts sometimes, then dies after engine heats up. Will restart sometimes after it cools down. Recently replaced distributor cap,roder and coil. Tried new ignitor but still wont start.

Asked by for the 1994 Toyota Camry
Is spark the problem when it doesen't start for sure? IF so, you should have replaced the distributor assembly!
Replaced ignition coil, rotor and cap in distributor. Ran great for about a month. Replaced igniter, still not starting