/**
 * Select block in editor by clicking on it.
 *
 * @param {string} className Class name to select by.
 */
export async function selectBlockByClassName( className ) {
	// We have to select the page first and then the block inside.
	await page.click( '.amp-page-active' );
	await page.click( `.${ className }` );
}

@@ -228,33 +228,36 @@
 nside.%0A%09
-awai
+cons
 t page
-.click(
+Selector =
  '.amp-p
@@ -271,48 +271,211 @@
 ive'
- );%0A%09await page.click( %60.$%7B className %7D%60
+;%0A%09await page.waitForSelector( pageSelector );%0A%09await page.click( pageSelector );%0A%0A%09const blockSelector = %60.$%7B className %7D%60;%0A%09await page.waitForSelector( blockSelector );%0A%09await page.click( blockSelector
  );%0A

Add waitForSelector-s