Skip to content

Commit

Permalink
test(transitions): Improve test reliability for video loading
Browse files Browse the repository at this point in the history
- Update tests to account for asynchronous video loading process
- Add waitForTimeout before verifying enabled state
- Implement wait mechanism to prevent flakiness, ensuring button is
  enabled before clicking
  • Loading branch information
ZaikoXander committed Feb 3, 2024
1 parent 308acbf commit 96f3ab3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions e2e/transitions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ test.describe
await youtubeLinkInput.fill(youtubeLink)

await expect(timer).toHaveText('01:00:00')
await page.waitForTimeout(5000)
await expect(startOrPauseOrResumeButton).toBeEnabled()
await expect(startOrPauseOrResumeButton).toHaveText('Começar')
await expect(resetButton).toBeDisabled()
Expand All @@ -65,6 +66,7 @@ test.describe
await useAudioOrVideoFileInputButton.click()

await expect(timer).toHaveText('01:00:00')
await page.waitForTimeout(5000)
await expect(startOrPauseOrResumeButton).toBeEnabled()
await expect(startOrPauseOrResumeButton).toHaveText('Começar')
await expect(resetButton).toBeDisabled()
Expand All @@ -83,6 +85,7 @@ test.describe
await useAudioOrVideoFileInputButton.click()

await expect(timer).toHaveText('01:00:00')
await page.waitForTimeout(5000)
await expect(startOrPauseOrResumeButton).toBeEnabled()
await expect(startOrPauseOrResumeButton).toHaveText('Começar')
await expect(resetButton).toBeDisabled()
Expand Down Expand Up @@ -118,6 +121,7 @@ test.describe
await useAudioOrVideoFileInputButton.click()

await expect(timer).toHaveText('01:00:00')
await page.waitForTimeout(5000)
await expect(startOrPauseOrResumeButton).toBeEnabled()
await expect(startOrPauseOrResumeButton).toHaveText('Começar')
await expect(resetButton).toBeDisabled()
Expand All @@ -134,6 +138,7 @@ test.describe
await youtubeLinkInput.fill(youtubeLink)

await expect(timer).toHaveText('01:00:00')
await page.waitForTimeout(5000)
await expect(startOrPauseOrResumeButton).toBeEnabled()
await expect(startOrPauseOrResumeButton).toHaveText('Começar')
await expect(resetButton).toBeDisabled()
Expand All @@ -152,6 +157,7 @@ test.describe
await useAudioOrVideoFileInputButton.click()

await expect(timer).toHaveText('01:00:00')
await page.waitForTimeout(5000)
await expect(startOrPauseOrResumeButton).toBeEnabled()
await expect(startOrPauseOrResumeButton).toHaveText('Começar')
await expect(resetButton).toBeDisabled()
Expand Down Expand Up @@ -187,6 +193,7 @@ test.describe
await useAudioOrVideoFileInputButton.click()

await expect(timer).toHaveText('01:00:00')
await page.waitForTimeout(5000)
await expect(startOrPauseOrResumeButton).toBeEnabled()
await expect(startOrPauseOrResumeButton).toHaveText('Começar')
await expect(resetButton).toBeDisabled()
Expand All @@ -203,6 +210,7 @@ test.describe
await youtubeLinkInput.fill(youtubeLink)

await expect(timer).toHaveText('01:00:00')
await page.waitForTimeout(5000)
await expect(startOrPauseOrResumeButton).toBeEnabled()
await expect(startOrPauseOrResumeButton).toHaveText('Começar')
await expect(resetButton).toBeDisabled()
Expand All @@ -221,6 +229,7 @@ test.describe
await useAudioOrVideoFileInputButton.click()

await expect(timer).toHaveText('01:00:00')
await page.waitForTimeout(5000)
await expect(startOrPauseOrResumeButton).toBeEnabled()
await expect(startOrPauseOrResumeButton).toHaveText('Começar')
await expect(resetButton).toBeDisabled()
Expand Down

0 comments on commit 96f3ab3

Please sign in to comment.