Files
AustinMroz fc9a1d6bfb Add audio/video preview tests (#11523)
Adds tests for the vue audio preview widget and vue video previews
(which are not widgets).

Also
- Fixes a bug where muted audio previews would incorrectly display a
'low volume' indicator instead of a muted indicator.
- Add test helper for deleting uploaded files after a test completes

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-11523-Add-audio-preview-tests-3496d73d365081be8630ede6dae1726a)
by [Unito](https://www.unito.io)
2026-04-23 02:14:48 +00:00

25 lines
717 B
TypeScript

import type { Locator } from '@playwright/test'
export class VideoPreview {
public readonly navigationDots: Locator
public readonly preview: Locator
public readonly upload: Locator
public readonly video: Locator
public readonly download: Locator
constructor(loadVideoNode: Locator) {
this.preview = loadVideoNode.locator('.video-preview')
this.navigationDots = this.preview.getByRole('button', {
name: 'View video'
})
this.upload = loadVideoNode.locator('input')
this.video = this.preview.locator('video')
this.download = loadVideoNode.getByRole('button', {
name: 'Download video'
})
}
async videoSrc() {
return await this.video.getAttribute('src')
}
}