@@ -162,16 +162,16 @@ export const deployNewVersion = async (
162162 await expect ( confirmDeploymentModal ) . not . toBeVisible ( ) ;
163163 }
164164
165- // check if the deployment started or it it has already finished
166- await expect ( versionRow ) . toContainText ( / ( D e p l o y i n g | C u r r e n t l y d e p l o y e d v e r s i o n ) / , { timeout : 10000 } ) ;
167- await expect ( versionRow ) . toContainText ( ' Currently deployed version' , { timeout : 45000 } ) ;
165+ // The row appears and disappears and appears again, so we need to make sure that it contains
166+ // both the sequence we are expecting and the currently deployed version text.
167+ await expect ( versionRow ) . toContainText ( new RegExp ( `Sequence ${ expectedSequence } .* Currently deployed version` ) , { timeout : 45000 } ) ;
168168 await expect ( versionRow . getByRole ( 'button' , { name : 'Redeploy' , exact : true } ) ) . toBeVisible ( ) ;
169169
170170 if ( expectedSequence > 0 ) {
171171 const previousVersionRow = allVersionsCard . getByTestId ( 'version-history-row-1' ) ;
172+ await expect ( previousVersionRow ) . toContainText ( `Sequence ${ expectedSequence - 1 } ` ) ;
172173 await expect ( previousVersionRow ) . toContainText ( 'Previously deployed' ) ;
173174 await expect ( previousVersionRow . getByRole ( 'button' , { name : 'Rollback' , exact : true } ) ) . toBeVisible ( { visible : supportsRollback } ) ;
174- await expect ( previousVersionRow ) . toContainText ( `Sequence ${ expectedSequence - 1 } ` ) ;
175175 }
176176
177177 const currentVersionCard = page . getByTestId ( "current-version-card" ) ;
@@ -203,9 +203,9 @@ export const rollbackToVersion = async (page: Page, expect: Expect, rowIndex: nu
203203 await confirmDeploymentModal . getByRole ( 'button' , { name : 'Yes, redeploy' , exact : true } ) . click ( ) ;
204204 await expect ( confirmDeploymentModal ) . not . toBeVisible ( ) ;
205205
206- // check if the deployment started or it it has already finished
207- await expect ( versionRow ) . toContainText ( / ( D e p l o y i n g | C u r r e n t l y d e p l o y e d v e r s i o n ) / , { timeout : 10000 } ) ;
208- await expect ( versionRow ) . toContainText ( ' Currently deployed version' , { timeout : 45000 } ) ;
206+ // The row appears and disappears and appears again, so we need to make sure that it contains
207+ // both the sequence we are expecting and the currently deployed version text.
208+ await expect ( versionRow ) . toContainText ( new RegExp ( `Sequence ${ sequence } .* Currently deployed version` ) , { timeout : 45000 } ) ;
209209 await expect ( versionRow . getByRole ( 'button' , { name : 'Redeploy' , exact : true } ) ) . toBeVisible ( ) ;
210210
211211 const nextVersionRow = allVersionsCard . getByTestId ( `version-history-row-${ rowIndex - 1 } ` ) ;
0 commit comments