Add e2e test for Performance Panel reload and record

Bug: 1464849
Change-Id: I385aed92c2dbf6bfd7c7e767f5072738df581385
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4684350
Commit-Queue: Jack Franklin <[email protected]>
Reviewed-by: Andres Olivares <[email protected]>
diff --git a/test/e2e/helpers/performance-helpers.ts b/test/e2e/helpers/performance-helpers.ts
index 00848ff..10c1141 100644
--- a/test/e2e/helpers/performance-helpers.ts
+++ b/test/e2e/helpers/performance-helpers.ts
@@ -7,6 +7,7 @@
 import {click, goToResource, platform, waitFor, waitForAria} from '../../shared/helper.js';
 
 export const RECORD_BUTTON_SELECTOR = '[aria-label="Record"]';
+export const RELOAD_AND_RECORD_BUTTON_SELECTOR = '[aria-label="Start profiling and reload page"]';
 export const STOP_BUTTON_SELECTOR = '[aria-label="Stop"]';
 export const SUMMARY_TAB_SELECTOR = '[aria-label="Summary"]';
 export const BOTTOM_UP_SELECTOR = '[aria-label="Bottom-Up"]';
@@ -60,6 +61,14 @@
   await waitFor(STOP_BUTTON_SELECTOR);
 }
 
+export async function reloadAndRecord() {
+  await click(RELOAD_AND_RECORD_BUTTON_SELECTOR);
+  // Make sure the timeline details panel appears. It's a sure way to assert
+  // that a recording is actually displayed as some of the other elements in
+  // the timeline remain in the DOM even after the recording has been cleared.
+  await waitFor('.timeline-details-chip-body');
+}
+
 export async function stopRecording() {
   await click(STOP_BUTTON_SELECTOR);