China’s capital has mandated coronavirus tests for hundreds of thousands of people as it widens measures against a new outbreak of the disease that has sent anxious residents flooding to clinics for voluntary tests, putting a strain on the system.