TagSpaces is an offline, open source, document manager with tagging support
e2e fixes win
Stanimirc1bb0821b2d6
diff --git a/package-lock.json b/package-lock.jsonindex b8432cb40..724ec0a90 100644--- a/package-lock.json+++ b/package-lock.json@@ -22,7 +22,7 @@"@mui/material": "^7.1.1","@mui/x-date-pickers": "^8.5.2","@tagspaces/tagspaces-common": "4.5.82",- "@tagspaces/tagspaces-common-aws3": "4.5.82",+ "@tagspaces/tagspaces-common-aws3": "4.5.83","@tagspaces/tagspaces-common-cordova": "4.5.82","@tagspaces/tagspaces-indexer": "4.5.82","aws-amplify": "^4.3.8",@@ -19059,9 +19059,9 @@}},"node_modules/@tagspaces/tagspaces-common-aws3": {- "version": "4.5.82",- "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-common-aws3/-/tagspaces-common-aws3-4.5.82.tgz",- "integrity": "sha512-R7jp9r9Z/3Ba2tDUk81vXTxuOiP3ebYrqMxUI8hueewD12keftAMQ6fuXqkSCUpEuy5g0AoTInwLxVbaeM5xVg==",+ "version": "4.5.83",+ "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-common-aws3/-/tagspaces-common-aws3-4.5.83.tgz",+ "integrity": "sha512-zXRD7Y/v2drpANtqoAkURNFCJRWudSJFpm8JwsKjWO3QVtvtZyRgIcNQ2FmRe8RyZiL//bd4Y0PzS+nQRE9HoQ==","license": "MIT","dependencies": {"@aws-sdk/client-s3": "^3.665.0",diff --git a/package.json b/package.jsonindex 8366fd5ad..f02c3010e 100644--- a/package.json+++ b/package.json@@ -173,7 +173,7 @@"@mui/material": "^7.1.1","@mui/x-date-pickers": "^8.5.2","@tagspaces/tagspaces-common": "4.5.82",- "@tagspaces/tagspaces-common-aws3": "4.5.82",+ "@tagspaces/tagspaces-common-aws3": "4.5.83","@tagspaces/tagspaces-common-cordova": "4.5.82","@tagspaces/tagspaces-indexer": "4.5.82","aws-amplify": "^4.3.8",diff --git a/release/app/package-lock.json b/release/app/package-lock.jsonindex 758d31cc0..ce79df176 100644--- a/release/app/package-lock.json+++ b/release/app/package-lock.json@@ -13,7 +13,7 @@"@elife/pm2": "3.6.1","@tagspaces/extensions": "1.0.191","@tagspaces/tagspaces-common-node": "4.5.82",- "@tagspaces/tagspaces-ws": "4.5.82",+ "@tagspaces/tagspaces-ws": "4.5.83","sharp": "0.32.6","ws": "8.18.1"},@@ -221,9 +221,9 @@}},"node_modules/@tagspaces/tagspaces-ws": {- "version": "4.5.82",- "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-ws/-/tagspaces-ws-4.5.82.tgz",- "integrity": "sha512-G7WoN/Z8EQOaoptQI/JTp4wZliqS/i71H4LUDU/H78Xd2U93OIIVvR1+FljVxjWuA8mYQqWa/7IjANYWbXykbA==",+ "version": "4.5.83",+ "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-ws/-/tagspaces-ws-4.5.83.tgz",+ "integrity": "sha512-NVnXL1IKwVyl8QTD4DsGA6d/sBblCbh/EflmMhpB1uDmE8WcRjhRNujvYEXHJkN/ALG4Ks4Tq4Zz5Pt4sttE0g==","dependencies": {"@tagspaces/tagspaces-indexer": "^4.5.82","@tagspaces/tagspaces-pdf-extraction": "^4.5.53",@@ -1951,9 +1951,9 @@}},"@tagspaces/tagspaces-ws": {- "version": "4.5.82",- "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-ws/-/tagspaces-ws-4.5.82.tgz",- "integrity": "sha512-G7WoN/Z8EQOaoptQI/JTp4wZliqS/i71H4LUDU/H78Xd2U93OIIVvR1+FljVxjWuA8mYQqWa/7IjANYWbXykbA==",+ "version": "4.5.83",+ "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-ws/-/tagspaces-ws-4.5.83.tgz",+ "integrity": "sha512-NVnXL1IKwVyl8QTD4DsGA6d/sBblCbh/EflmMhpB1uDmE8WcRjhRNujvYEXHJkN/ALG4Ks4Tq4Zz5Pt4sttE0g==","requires": {"@tagspaces/tagspaces-indexer": "^4.5.82","@tagspaces/tagspaces-pdf-extraction": "^4.5.53",diff --git a/release/app/package.json b/release/app/package.jsonindex 675a17eb6..bd7ced6e8 100644--- a/release/app/package.json+++ b/release/app/package.json@@ -20,7 +20,7 @@"@elife/pm2": "3.6.1","@tagspaces/extensions": "1.0.191","@tagspaces/tagspaces-common-node": "4.5.82",- "@tagspaces/tagspaces-ws": "4.5.82",+ "@tagspaces/tagspaces-ws": "4.5.83","sharp": "0.32.6","ws": "8.18.1"},diff --git a/tests/e2e/general.helpers.js b/tests/e2e/general.helpers.jsindex 999579922..0d8387960 100644--- a/tests/e2e/general.helpers.js+++ b/tests/e2e/general.helpers.js@@ -794,7 +794,7 @@ export async function setFileTypeExtension(}export async function expectMetaFileContain(- { testDataDir, isWeb },+ { testDataDir, isS3, isMinio },metaFile,rootFolder,contain,@@ -808,8 +808,8 @@ export async function expectMetaFileContain(await expectElementExist(getGridFileSelector(metaFile), true, timeout);await openFile(metaFile, 'showPropertiesTID');- if (isWeb) {- await expectS3FileContain({ testDataDir }, metaFile, rootFolder, contain);+ if (isS3 || isMinio) {+ await expectS3FileContain({ isMinio }, metaFile, rootFolder, contain);} else {await expectLocalFileContain({ testDataDir },@@ -926,14 +926,14 @@ export async function expectLocalFileContain(}export async function expectS3FileContain(- { testDataDir },+ { isMinio },fileName,rootFolder,txtToContain = 'etete&5435',) {- const filePath = pathLib.join(testDataDir, rootFolder, fileName);+ const filePath = rootFolder + '/' + fileName; //pathLib.join(rootFolder,fileName); //testDataDir, rootFolder, fileName);- const content = await getS3File(filePath);+ const content = await getS3File({ isMinio }, filePath);const contentN = normalized(content);const txtToContainN = normalized(txtToContain);diff --git a/tests/e2e/hook.js b/tests/e2e/hook.jsindex 9ce9e19e2..43d1aa809 100644--- a/tests/e2e/hook.js+++ b/tests/e2e/hook.js@@ -304,6 +304,7 @@ export async function testDataRefresh(isS3, testDataDir) {if (isS3) {//console.log('testDataDir:'+testDataDir);await refreshS3testData(testDataDir);+ //} else (isMinio){ todo minio} else {await fse.rm(testDataDir, {recursive: true,diff --git a/tests/e2e/location.pw.e2e.js b/tests/e2e/location.pw.e2e.jsindex 8a9afd497..32dcd3b9f 100644--- a/tests/e2e/location.pw.e2e.js+++ b/tests/e2e/location.pw.e2e.js@@ -211,7 +211,7 @@ test.describe('TST03 - Testing locations:', () => {const rootFolder = locationFolderName + '/' + AppConfig.metaFolder;// await global.client.waitForTimeout(180000);await expectMetaFileContain(- { testDataDir, isWeb },+ { testDataDir, isS3, isMinio },'tsi.json',rootFolder,indexFileContent,diff --git a/tests/s3rver/S3DataRefresh.js b/tests/s3rver/S3DataRefresh.jsindex 4ae8832c0..bc571a1d3 100644--- a/tests/s3rver/S3DataRefresh.js+++ b/tests/s3rver/S3DataRefresh.js@@ -52,6 +52,20 @@ function getS3Client() {});}+function getMinioClient() {+ return new S3Client({+ region: 'eu-central-1',+ endpoint: 'http://127.0.0.1:9000', // Adjust endpoint as needed+ credentials: {+ accessKeyId: 'minioadmin',+ secretAccessKey: 'minioadmin',+ },+ // Force path style required for local S3rver+ forcePathStyle: true,+ //logger: console,+ });+}+async function deleteAllObjects(bucketName) {try {// List objects in the bucket@@ -90,15 +104,16 @@ async function deleteAllObjects(bucketName) {}}-function getS3File(filePath) {- const key = path.relative(directoryPath, filePath).replace(/\\/g, '/'); // Normalize path separators+function getS3File({ isMinio }, filePath) {+ const key = filePath.replace(/\\/g, '/'); // Normalize path separators+ //const key = path.relative(directoryPath, filePath).replace(/\\/g, '/'); // Normalize path separatorsconst params = {Bucket: bucketName,Key: key,ResponseCacheControl: 'no-cache',};- const s3Client = getS3Client();+ const s3Client = isMinio ? getMinioClient() : getS3Client();return s3Client.send(new GetObjectCommand(params)).then((data) => {