Skip to content

TagSpaces is an offline, open source, document manager with tagging support

finish TST59 and fixes

sytolk4ddcb07e9b3f
diff --git a/tests/e2e/general.helpers.js b/tests/e2e/general.helpers.js
index 5bff56e17..7aa42e0a1 100644
--- a/tests/e2e/general.helpers.js
+++ b/tests/e2e/general.helpers.js
@@ -1,6 +1,7 @@
/* Copyright (c) 2016-present - TagSpaces UG (Haftungsbeschraenkt). All rights reserved. */
import path from 'path';
-import { delay, clearLocalStorage } from './hook';
+import { expect as pExpect } from '@playwright/test';
+import { delay } from './hook';
import { firstFile } from './test-utils';
import AppConfig from '../../app/AppConfig';
@@ -390,6 +391,24 @@ export async function getGridCellClass(fileIndex = 0) {
return undefined;
}
+export async function expectAudioPlay(){
+ await pExpect
+ .poll(
+ async () => {
+ const fLocator = await frameLocator();
+ const progressSeek = await fLocator.locator('[data-plyr=seek]');
+ const ariaValueNow = await progressSeek.getAttribute('aria-valuenow');
+ return parseFloat(ariaValueNow) > 0;
+ },
+ {
+ message: 'progress of file is not greater that 0', // custom error message
+ // Poll for 10 seconds; defaults to 5 seconds. Pass 0 to disable timeout.
+ timeout: 10000
+ }
+ )
+ .toBe(true);
+}
+
export async function expectElementExist(
selector,
exist = true,
diff --git a/tests/e2e/hook.js b/tests/e2e/hook.js
index 93c8ff171..b290f1414 100644
--- a/tests/e2e/hook.js
+++ b/tests/e2e/hook.js
@@ -196,7 +196,7 @@ export async function startTestingApp(extconfig) {
// Get the first window that the app opens, wait if necessary.
global.client = await global.app.firstWindow();
global.session = await global.client.context().newCDPSession(global.client);
- await global.client.setViewportSize({ width: 1920, height: 1080 });
+ // await global.client.setViewportSize({ width: 1920, height: 1080 });
await global.client.waitForLoadState('load'); //'domcontentloaded'); //'networkidle');
// await global.client.bringToFront();
diff --git a/tests/e2e/viewer-audiovideo.pw.e2e.js b/tests/e2e/viewer-audiovideo.pw.e2e.js
index 1ac389acd..a16671124 100644
--- a/tests/e2e/viewer-audiovideo.pw.e2e.js
+++ b/tests/e2e/viewer-audiovideo.pw.e2e.js
@@ -1,14 +1,18 @@
/*
* Copyright (c) 2016-present - TagSpaces UG (Haftungsbeschraenkt). All rights reserved.
*/
-import { expect as pExpect } from '@playwright/test';
import {
defaultLocationPath,
defaultLocationName,
createPwMinioLocation,
createPwLocation
} from './location.helpers';
-import { clickOn, frameLocator, isDisplayed } from './general.helpers';
+import {
+ clickOn,
+ expectAudioPlay,
+ frameLocator,
+ isDisplayed
+} from './general.helpers';
import { startTestingApp, stopSpectronApp, testDataRefresh } from './hook';
import { openContextEntryMenu, toContainTID } from './test-utils';
@@ -32,6 +36,22 @@ describe('TST59 - Media player', () => {
// await closeFileProperties();
});
+ test('TST5901 - Play ogg file [web,minio,electron]', async () => {
+ await openContextEntryMenu(
+ '[data-tid="fsEntryName_sample.ogg"]',
+ 'fileMenuOpenFile'
+ );
+ await expectAudioPlay();
+ });
+
+ test('TST5902 - Play ogv file [web,minio,electron]', async () => {
+ await openContextEntryMenu(
+ '[data-tid="fsEntryName_sample.ogv"]',
+ 'fileMenuOpenFile'
+ );
+ await expectAudioPlay();
+ });
+
test('TST5903 - Open and close about dialog [web,minio,electron]', async () => {
await openContextEntryMenu(
'[data-tid="fsEntryName_sample.mp4"]',
@@ -69,22 +89,7 @@ describe('TST59 - Media player', () => {
'[data-tid="fsEntryName_sample.mp3"]',
'fileMenuOpenFile'
);
-
- await pExpect
- .poll(
- async () => {
- const fLocator = await frameLocator();
- const progressSeek = await fLocator.locator('[data-plyr=seek]');
- const ariaValueNow = await progressSeek.getAttribute('aria-valuenow');
- return parseFloat(ariaValueNow) > 0;
- },
- {
- message: 'progress of file is not greater that 0', // custom error message
- // Poll for 10 seconds; defaults to 5 seconds. Pass 0 to disable timeout.
- timeout: 10000
- }
- )
- .toBe(true);
+ await expectAudioPlay();
});
test('TST5905 - Play mp4 [web,minio,electron]', async () => {
@@ -93,6 +98,8 @@ describe('TST59 - Media player', () => {
'fileMenuOpenFile'
);
+ await expectAudioPlay();
+
// Access the iframe
const iframeElement = await global.client.waitForSelector('iframe');
const frame = await iframeElement.contentFrame();
@@ -102,4 +109,12 @@ describe('TST59 - Media player', () => {
const playExists = await isDisplayed('[data-plyr=play]', true, 2000, frame);
expect(playExists).toBeTruthy();
});
+
+ test('TST5906 - Play flac [web,minio,electron]', async () => {
+ await openContextEntryMenu(
+ '[data-tid="fsEntryName_sample.flac"]',
+ 'fileMenuOpenFile'
+ );
+ await expectAudioPlay();
+ });
});