Skip to content

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

add TST0609 - Show thumbnails of image files in the search results

Stanimirc97e24fdd9b2
diff --git a/tests/e2e/hook.js b/tests/e2e/hook.js
index 6d2a75351..f6e8b1df5 100644
--- a/tests/e2e/hook.js
+++ b/tests/e2e/hook.js
@@ -18,6 +18,9 @@ export const getRandomInt = (min, max) =>
export function writeFile(filePath, fileContent) {
fse.writeFileSync(filePath, fileContent);
}
+export function checkFileExist(filePath) {
+ return fse.existsSync(filePath);
+}
// use this pause only for visual debuging on places where you want to see the result after a given operation
// global.msDebugPause = 0;
diff --git a/tests/e2e/search.pw.e2e.js b/tests/e2e/search.pw.e2e.js
index 6a7ff266f..4ae02e0a4 100644
--- a/tests/e2e/search.pw.e2e.js
+++ b/tests/e2e/search.pw.e2e.js
@@ -10,6 +10,7 @@ import {
takeScreenshot
} from './general.helpers';
import {
+ checkFileExist,
createFile,
startTestingApp,
stopApp,
@@ -134,6 +135,20 @@ test.describe('TST06 - Test Search in file structure:', () => {
// expected to reset all search engine
});*/
+ test('TST0609 - Show thumbnails of image files in the search results [web,minio,electron]', async () => {
+ const searchQuery = 'jpg'; //'sample_exif.jpg';
+ await addSearchCommand(searchQuery, true);
+ await global.client.waitForSelector('img[alt=thumbnail]', {
+ visible: true
+ });
+ const images = await global.client.$$('img[alt=thumbnail]');
+ for (let i = 0; i < images.length; i++) {
+ const src = await images[i].getAttribute('src');
+ const fileExists = checkFileExist(src);
+ expect(fileExists).toBe(true);
+ }
+ });
+
test('TST0621 - Search actions - open location [web,electron]', async () => {
//const firstLocationTID = await getPwLocationTid(0);
await closeLocation(); //lastLocationTID);