How to program MCUs and test PCBs in mass production?
First, I'd suggest to use one of these pads (i.e. TC2030) for JTAG/SWD programming as they do not cost a component and they lend themselves very easily to programming jigs.

Normally, you can just send the bin or hex file to the EMS. The EMS should be able to identify a gang programmer apt for the MCU, as necessary.
You need a dedicated testing jig (&quot;bed of nails&quot;) for the actual testing. General ease of test jig development depends on the presence of test pads and how the PCBA mechanically lends itself to testing (i.e. are the test pads reachable by pogo pins and are not hampered by tall components, etc). Note that the programming jig and the testing jig can be the same jig, but again, that depends on the complexity of the PCBA, and the number/complexity of tests.
You do need to present them a programming procedure (power up sequences, pin inputs, etc). Its the EMS's job to replicate this on a mass-pro level. Same with the basic test procedure you mentioned.
Component-wise, you can opt for the EMS to do ICT test prior to programming/ testing. At least for the first batch, just to be sure that the right component values are mounted on the right places or that BGA components are connected well. You'd have better confidence of proceeding with the programming/ testing (or at least less debug points to look into) knowing that the PCBAs are assembled correctly.
At a very basic level, those test jigs are computer-controlled (i.e. PC with LabView hooked to different instruments, the programmer, etc) where an operator/ technician manually loads the PCBA(s), presses down the jig, press a start button on the interface, wait for the programming, and the test results PASS/FAIL message to come out.