Shanghai residents are required to take at least one nucleic acid test within seven days, and those who fail to do so will be assigned a yellow health code, said the city's health authority on Saturday.
The requirement takes effect immediately and will remain in place until at least July 31, said Xia Kejia, the official responsible for the municipal task force of nucleic acid test screening.
People with a yellow health code are required to stay within the compound of their residence, except for going for COVID test or hospital visit.
The city will extend free testing service from June 30 to July 31, Xia said.
Also on Saturday, the city reported three confirmed COVID-19 cases and one asymptomatic infection in Minhang, Jing'an, Pudong and Xuhui districts, with the affected places classified as medium-risk areas.
A total of 79 primary contacts and 52 secondary contacts were quarantined and tested, with all testing negative.
Zhao Dandan, deputy director of Shanghai Health Commission, said the gene sequencing of new infections since June 1 showed the same origin with early cases in the current outbreak.
"That means we are in the final stage of the outbreak," he said. "The latest cases emerged from 13 districts. However, the risk of further epidemic spreading still exists."