mitodl / ocw-hugo-themes

A Hugo theme for building OCW websites
BSD 3-Clause "New" or "Revised" License
5 stars 4 forks source link

playwright tests time out on video tests #1279

Closed gumaerc closed 1 year ago

gumaerc commented 1 year ago

Expected Behavior

All end to end tests should pass

Current Behavior

The test titled "Transcripts start time matches video start time" times out and fails after 30 seconds when running const activeCaption = await videoSection.transcript.activeLine().getAttribute("data-begin"), after running await videoSection.playButton().click()

Steps to Reproduce

  1. Run yarn test:e2e

Possible Solution

The problem seems to be related to the Chromium browser that Playwright downloads not being able to start playing back a video. If a solution cannot be found to get Chromium to play the video within the Playwright testing context, the test should be removed for now until a solution can be found in the future.

Additional Details

This is the full stack trace of the error as seen by Github Actions:

  1) [chromium] › ocw-ci-test-course/video.spec.ts:40:5 › Transcripts start time matches video start time 

    Test timeout of 30000ms exceeded.

    Error: locator.getAttribute: Target closed
    =========================== logs ===========================
    waiting for locator('.video-page, .video-embed').locator('.transcript-line.is-active')
    ============================================================

      54 |   const activeCaption = await videoSection.transcript
      55 |     .activeLine()
    > 56 |     .getAttribute("data-begin")
         |      ^
      57 |   const nextCaption = await videoSection.transcript
      58 |     .nextLine()
      59 |     .getAttribute("data-begin")

        at /home/runner/work/ocw-hugo-themes/ocw-hugo-themes/tests-e2e/ocw-ci-test-course/video.spec.ts:56:6

    Pending operations:
      - locator.getAttribute at tests-e2e/ocw-ci-test-course/video.spec.ts:56:6
ChristopherChudzicki commented 1 year ago

To see the issue more explicitly, I would run yarn test:e2e video.spec --debug. Navigate to http://localhost:3010/courses/ocw-ci-test-course/pages/video-series-overview/ ...

This seems like it must have been caused by an update to Chromium. Playwright's browsers are not pinned, I believe.