P1 automated testing code