Skip to content

Commit

Permalink
fix(PPDSC-2312): audio player test improvements (#373)
Browse files Browse the repository at this point in the history
* fix(PPDSC-2312): audio player test improvements

Main issues:
- Player sometimes still in loading state when snapshot taken.
- Arbitrary waits.
- Buffered amount changes, making tests flaky.
- Animations making screenshots inconsistent.
- Time elapsed in autoplay tests not consistent.

Fixes (to avoid ignore regions in tests):
- Make sure all players in a test story are loaded before taking the snapshot using oncanplay event.
- Prefetch src for all players so that content is fully buffered. Add separate tests for loading / unbuffered state.
- Disable CSS animations to make screenshots consistent.
- Remove visual tests for autoplay behaviour as this is not necessary. Also remove duplicate autoplay story.
- Remove all arbitrary waits and ignore regions in tests.

* fix(PPDSC-2312): correct visual test check

* fix(PPDSC-2312): fix e2e test errors
  • Loading branch information
mstuartf authored Sep 14, 2022
1 parent 559a280 commit 0703559
Show file tree
Hide file tree
Showing 6 changed files with 639 additions and 416 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"test:unit:ci": "yarn test:unit:run --maxWorkers=2 --ci --reporters=default --reporters=jest-junit",
"test:unit:comps": "yarn test:unit:run:local --projects=src",
"test:unit:site": "yarn test:unit:run:local --projects=site",
"test:visual:comps:ci": "start-server-and-test dev:storybook 6006 eyes:storybook",
"test:visual:comps:ci": "STORYBOOK_IS_VISUAL_TEST=true start-server-and-test dev:storybook 6006 eyes:storybook",
"test:visual:comps:local": "sh ./scripts/applitools_local.sh comps",
"prepublish": "yarn build:sync-version-number",
"build:clean": "rm -rf dist && rm -rf dist-storybook && rm -rf public",
Expand Down
Loading

0 comments on commit 0703559

Please sign in to comment.