owncast/test/automated/browser
Gabe Kangas ca9d5de192
Embed static resources (#1466)
* Replace pkger with go:embed for bundling the admin. Closes #844

* Remove references to pkged.go

* Point tests to use an updated version of Go

* Add comment to new exported function

* Cleanup

* Add a dummy pkged.go to alert people to stop using it.

* Add simple browser test to make sure the admin is available and renders

* Don't panic

* Embed bot/scraper metadata template.

Add browser test to validate the rendering of this template.

* Use embedded offline.ts segment

* Remove placeholder thumbnail as its unnecessary

* Remove copying the static directory into the release

* Cleanup
2021-10-11 15:04:16 -07:00
..
lib Automated browser testing (#1415) 2021-09-17 14:04:09 -07:00
screenshots Automated browser testing (#1415) 2021-09-17 14:04:09 -07:00
tests Automated browser testing (#1415) 2021-09-17 14:04:09 -07:00
admin.test.js Replace pkger with go:embed for bundling the admin. Closes #844 (#1464) 2021-10-11 14:56:00 -07:00
bot-share-search-scrapers.test.js Embed static resources (#1466) 2021-10-11 15:04:16 -07:00
chat-embed.test.js Automated browser testing (#1415) 2021-09-17 14:04:09 -07:00
jest.config.json Automated browser testing (#1415) 2021-09-17 14:04:09 -07:00
main.test.js Automated browser testing (#1415) 2021-09-17 14:04:09 -07:00
package-lock.json Automated browser testing (#1415) 2021-09-17 14:04:09 -07:00
package.json Automated browser testing (#1415) 2021-09-17 14:04:09 -07:00
README.md Automated browser testing (#1415) 2021-09-17 14:04:09 -07:00
run.sh Replace pkger with go:embed for bundling the admin. Closes #844 (#1464) 2021-10-11 14:56:00 -07:00
video-embed.test.js Automated browser testing (#1415) 2021-09-17 14:04:09 -07:00

Automated browser tests

The tests currently address the following interfaces:

  1. The main web frontend of Owncast
  2. The embeddable video player
  3. The embeddable read-only chat
  4. the embeddable read-write chat

Each have a set of test to make sure they load, have the expected elements on the screen, that API requests are successful, and that there are no errors being thrown in the console.

The main web frontend additionally iterates its tests over a set of different device characteristics to verify mobile and tablet usage and goes through some interactive usage of the page such as changing their name and sending a chat message by clicking and typing.

While it emulates the user agent, screen size, and touch features of different devices, they're still just a copy of Chromium running and not a true emulation of these other devices. So any "it breaks only on Safari" type bugs will not get caught.

It can't actually play video, so anything specific about video playback cannot be verified with these tests.

Setup

npm install

Run

./run.sh

Screenshots

After the tests finish a set of screenshots will be saved into the screenshots directory to aid in troubleshooting or sanity checking different viewport sizes. three