Well, yes, a welded-on cap could be used, but then you get into the circular logic of having to cut off a perfectly good, temporary tested joint, and then re-welding that same joint into the permanent configuration, then having to re-test the final joint you just welded.
it would be valid only for a shop test - but then the final hydro reqmt is still not met.
A operational pressure test with the operating fluid is OK to accept a bolted (flanged) joint if the piping system welds have been hydro'ed, but the higher hydro test is required for your butt-welded joints at some point in time. Or a 100 percent X-ray. Or both - depending on your insurance/pressure/temperature. HP/HT Steam, LT/HP main feed water, LT/LP/flammable turbine lube oil, and low temperature low pressure condensate water will have different requirements when new pipes are added.