File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
packages/patterns/integration Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -107,12 +107,20 @@ function clickCtCheckbox(page: Page) {
107107 } ) ;
108108}
109109
110- async function getFeatureStatus ( page : Page ) : Promise < string | undefined > {
110+ async function getFeatureStatus (
111+ page : Page ,
112+ ) : Promise < string | undefined | null > {
111113 const featureStatus = await page . waitForSelector ( "#feature-status" , {
112114 strategy : "pierce" ,
113115 } ) ;
114- const statusText = await featureStatus . evaluate ( ( el : HTMLElement ) =>
115- el . textContent
116- ) ;
117- return statusText ?. trim ( ) ;
116+ // This could throw due to lacking a box model to click on.
117+ // Catch in lieu of handling time sensitivity.
118+ try {
119+ const statusText = await featureStatus . evaluate ( ( el : HTMLElement ) =>
120+ el . textContent
121+ ) ;
122+ return statusText ?. trim ( ) ;
123+ } catch ( _ ) {
124+ return null ;
125+ }
118126}
You can’t perform that action at this time.
0 commit comments