Skip to content

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

fix e2e for MacOS and optimize

sytolka97c3e2819f9
diff --git a/package-lock.json b/package-lock.json
index 5864fba53..ff5b1b058 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -21,7 +21,7 @@
"@mui/styles": "5.10.15",
"@mui/x-date-pickers": "^5.0.8",
"@tagspaces/tagspaces-md": "2.1.6",
- "@tagspaces/tagspaces-platforms": "2.1.38",
+ "@tagspaces/tagspaces-platforms": "2.1.39",
"aws-amplify": "^4.3.8",
"aws-sdk": "^2.1036.0",
"babel-polyfill": "^6.26.0",
@@ -12309,9 +12309,9 @@
}
},
"node_modules/@tagspaces/tagspaces-platforms": {
- "version": "2.1.38",
- "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-platforms/-/tagspaces-platforms-2.1.38.tgz",
- "integrity": "sha512-XKcMljKoCAuNGQOeYiCiuVex2NsMZgKcqKNJ4qxbfuXiY7Ddxvqc7NrzQBWEKZPBT3Y/UkOw6OxAwQHsWbWdlA==",
+ "version": "2.1.39",
+ "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-platforms/-/tagspaces-platforms-2.1.39.tgz",
+ "integrity": "sha512-wxm+NTZX9a+3aXYC0REpg+2kiNgXYUHJUofE3AwZpwB6rzyxuXxOsCGvUtc0oUykg/wdgUAptNeUoKvkZNMckg==",
"hasInstallScript": true
},
"node_modules/@testim/chrome-version": {
@@ -51895,9 +51895,9 @@
}
},
"@tagspaces/tagspaces-platforms": {
- "version": "2.1.38",
- "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-platforms/-/tagspaces-platforms-2.1.38.tgz",
- "integrity": "sha512-XKcMljKoCAuNGQOeYiCiuVex2NsMZgKcqKNJ4qxbfuXiY7Ddxvqc7NrzQBWEKZPBT3Y/UkOw6OxAwQHsWbWdlA=="
+ "version": "2.1.39",
+ "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-platforms/-/tagspaces-platforms-2.1.39.tgz",
+ "integrity": "sha512-wxm+NTZX9a+3aXYC0REpg+2kiNgXYUHJUofE3AwZpwB6rzyxuXxOsCGvUtc0oUykg/wdgUAptNeUoKvkZNMckg=="
},
"@testim/chrome-version": {
"version": "1.1.3",
diff --git a/tests/e2e/fileopener.pw.e2e.js b/tests/e2e/fileopener.pw.e2e.js
index 7d945ca5e..547586905 100644
--- a/tests/e2e/fileopener.pw.e2e.js
+++ b/tests/e2e/fileopener.pw.e2e.js
@@ -25,11 +25,11 @@ import {
} from './file.properties.helpers';
import { openContextEntryMenu } from './test-utils';
import { startTestingApp, stopApp, testDataRefresh } from './hook';
-import { init } from './welcome.helpers';
+import { clearDataStorage } from './welcome.helpers';
test.beforeAll(async () => {
- await startTestingApp('extconfig-with-welcome.js');
- await init();
+ await startTestingApp('extconfig.js');
+ // await clearDataStorage();
});
test.afterAll(async () => {
@@ -41,7 +41,7 @@ test.afterEach(async ({ page }, testInfo) => {
if (testInfo.status !== testInfo.expectedStatus) {
await takeScreenshot(testInfo);
}
- await init();
+ await clearDataStorage();
});
test.beforeEach(async () => {
diff --git a/tests/e2e/folder.pw.e2e.js b/tests/e2e/folder.pw.e2e.js
index 3e115b00e..96ac24b68 100644
--- a/tests/e2e/folder.pw.e2e.js
+++ b/tests/e2e/folder.pw.e2e.js
@@ -18,11 +18,11 @@ import {
} from './general.helpers';
import { renameFolder } from './test-utils';
import { startTestingApp, stopApp, testDataRefresh } from './hook';
-import { init } from './welcome.helpers';
+import { clearDataStorage } from './welcome.helpers';
test.beforeAll(async () => {
- await startTestingApp('extconfig-with-welcome.js');
- await init();
+ await startTestingApp('extconfig.js');
+ // await clearDataStorage();
});
test.afterAll(async () => {
@@ -34,7 +34,7 @@ test.afterEach(async ({ page }, testInfo) => {
if (testInfo.status !== testInfo.expectedStatus) {
await takeScreenshot(testInfo);
}
- await init();
+ await clearDataStorage();
});
test.beforeEach(async () => {
diff --git a/tests/e2e/general.helpers.js b/tests/e2e/general.helpers.js
index a9b5ea88c..875530c6e 100644
--- a/tests/e2e/general.helpers.js
+++ b/tests/e2e/general.helpers.js
@@ -73,64 +73,10 @@ export async function waitUntilClassChanged(selector, className) {
return await element.getAttribute('class');
}
-/**
- * @deprecated Spectron specific use await global.client.dblclick(selector);
- */
-export async function doubleClickOn(selector) {
- const element = await global.client.$(selector);
- await element.waitUntil(
- async function() {
- const displayed = await this.isDisplayed();
- // const displayed = await this.isDisplayedInViewport();
- return displayed; //=== true;
- },
- {
- timeout: 5000,
- timeoutMsg: 'doubleClick selector ' + selector + ' to exist after 5s'
- }
- );
- await element.doubleClick();
-}
-
export async function setInputValue(selector, value) {
global.client.fill(selector, value);
}
-/*
- * @deprecated spectron specific use setInputKeys instead
- */
-export async function addInputKeys(tid, value) {
- const element = await global.client.$('[data-tid=' + tid + ']');
- await element.waitUntil(
- async function() {
- const displayed = await this.isDisplayedInViewport();
- return displayed === true;
- },
- {
- timeout: 5000,
- timeoutMsg:
- 'setInputKeys selector ' + element.selector + ' to exist after 5s'
- }
- );
- await element.click();
-
- const elemInput = await global.client.$('[data-tid=' + tid + '] input');
- await elemInput.waitUntil(
- async function() {
- // const displayed = await this.isDisplayed();
- const displayed = await this.isDisplayedInViewport();
- return displayed === true;
- },
- {
- timeout: 5000,
- timeoutMsg:
- 'setInputKeys selector ' + element.selector + ' to exist after 5s'
- }
- );
- await elemInput.click();
- await elemInput.keys(value);
-}
-
/**
* @param tid
* @param value
@@ -163,7 +109,7 @@ export async function typeInputValue(inputSelector, value, delay = 50) {
return oldValue;
}
-export async function setSelectorKeys(selector, value) {
+/*export async function setSelectorKeys(selector, value) {
const element = await global.client.$(selector);
await element.waitUntil(
async function() {
@@ -199,9 +145,9 @@ export async function setSelectorKeys(selector, value) {
await element.click();
await elemInput.keys(value);
return oldValue;
-}
+}*/
-export async function clearInputValue(inputElement) {
+/*export async function clearInputValue(inputElement) {
const oldValue = await inputElement.getValue();
const count = oldValue.length;
for (let i = 0; i < count; i++) {
@@ -215,7 +161,7 @@ export async function clearInputValue(inputElement) {
await inputElement.clearValue();
}
return oldValue;
-}
+}*/
/**
* @param fileIndex
diff --git a/tests/e2e/general.pw.e2e.js b/tests/e2e/general.pw.e2e.js
index 357d0b13b..f51d4107d 100644
--- a/tests/e2e/general.pw.e2e.js
+++ b/tests/e2e/general.pw.e2e.js
@@ -25,7 +25,7 @@ import {
} from './general.helpers';
import { searchEngine } from './search.helpers';
import { startTestingApp, stopApp, testDataRefresh } from './hook';
-import { init } from './welcome.helpers';
+import { clearDataStorage } from './welcome.helpers';
export const firstFile = '/span';
export const perspectiveGridTable = '//*[@data-tid="perspectiveGridFileTable"]';
@@ -36,8 +36,8 @@ const subFolderThumbnailsPath = defaultLocationPath + '/thumbnails';
const testFolder = 'testFolder';
test.beforeAll(async () => {
- await startTestingApp('extconfig-with-welcome.js');
- await init();
+ await startTestingApp('extconfig.js');
+ // await clearDataStorage();
});
test.afterAll(async () => {
@@ -49,7 +49,7 @@ test.afterEach(async ({ page }, testInfo) => {
if (testInfo.status !== testInfo.expectedStatus) {
await takeScreenshot(testInfo);
}
- await init();
+ await clearDataStorage();
});
test.beforeEach(async () => {
diff --git a/tests/e2e/key-bindings.pw.e2e.js b/tests/e2e/key-bindings.pw.e2e.js
index bff4e069a..f63f10fb5 100644
--- a/tests/e2e/key-bindings.pw.e2e.js
+++ b/tests/e2e/key-bindings.pw.e2e.js
@@ -11,11 +11,11 @@ import {
takeScreenshot
} from './general.helpers';
import { startTestingApp, stopApp, testDataRefresh } from './hook';
-import { init } from './welcome.helpers';
+import { clearDataStorage } from './welcome.helpers';
test.beforeAll(async () => {
- await startTestingApp('extconfig-with-welcome.js');
- await init();
+ await startTestingApp('extconfig.js');
+ // await clearDataStorage();
});
test.afterAll(async () => {
@@ -27,7 +27,7 @@ test.afterEach(async ({ page }, testInfo) => {
if (testInfo.status !== testInfo.expectedStatus) {
await takeScreenshot(testInfo);
}
- await init();
+ await clearDataStorage();
});
test.beforeEach(async () => {
diff --git a/tests/e2e/location.pw.e2e.js b/tests/e2e/location.pw.e2e.js
index 1b6ab044e..9719b8092 100644
--- a/tests/e2e/location.pw.e2e.js
+++ b/tests/e2e/location.pw.e2e.js
@@ -15,7 +15,7 @@ import {
takeScreenshot
} from './general.helpers';
import { startTestingApp, stopApp, testDataRefresh } from './hook';
-import { init } from './welcome.helpers';
+import { clearDataStorage } from './welcome.helpers';
export const perspectiveGridTable = '//*[@data-tid="perspectiveGridFileTable"]';
export const newLocationName = 'Location_Name_Changed';
@@ -24,7 +24,7 @@ let testLocationName;
test.beforeAll(async () => {
await startTestingApp('extconfig-without-locations.js');
- await init();
+ //await clearDataStorage();
});
test.afterAll(async () => {
@@ -36,7 +36,7 @@ test.afterEach(async ({ page }, testInfo) => {
if (testInfo.status !== testInfo.expectedStatus) {
await takeScreenshot(testInfo);
}
- await init();
+ await clearDataStorage();
});
test.beforeEach(async () => {
diff --git a/tests/e2e/markdown-editor.pw.e2e.js b/tests/e2e/markdown-editor.pw.e2e.js
index 553dc5f72..3d795b63b 100644
--- a/tests/e2e/markdown-editor.pw.e2e.js
+++ b/tests/e2e/markdown-editor.pw.e2e.js
@@ -16,11 +16,11 @@ import {
} from './general.helpers';
import { startTestingApp, stopApp, testDataRefresh } from './hook';
import { openContextEntryMenu, toContainTID } from './test-utils';
-import { init } from './welcome.helpers';
+import { clearDataStorage, closeWelcomePlaywright } from './welcome.helpers';
test.beforeAll(async () => {
await startTestingApp();
- await init();
+ // await clearDataStorage();
});
test.afterAll(async () => {
@@ -32,10 +32,11 @@ test.afterEach(async ({ page }, testInfo) => {
if (testInfo.status !== testInfo.expectedStatus) {
await takeScreenshot(testInfo);
}
- await init();
+ await clearDataStorage();
});
test.beforeEach(async () => {
+ await closeWelcomePlaywright();
if (global.isMinio) {
await createPwMinioLocation('', defaultLocationName, true);
} else {
diff --git a/tests/e2e/perspective-grid-right-button.pw.e2e.js b/tests/e2e/perspective-grid-right-button.pw.e2e.js
index 8bdd2cc39..2a2af87ea 100644
--- a/tests/e2e/perspective-grid-right-button.pw.e2e.js
+++ b/tests/e2e/perspective-grid-right-button.pw.e2e.js
@@ -36,13 +36,13 @@ import {
} from './general.helpers';
import { AddRemoveTagsToSelectedFiles } from './perspective-grid.helpers';
import { startTestingApp, stopApp, testDataRefresh } from './hook';
-import { init } from './welcome.helpers';
+import { clearDataStorage } from './welcome.helpers';
const testTagName = 'testTag'; // TODO fix camelCase tag name
test.beforeAll(async () => {
- await startTestingApp('extconfig-with-welcome.js');
- await init();
+ await startTestingApp('extconfig.js');
+ // await clearDataStorage();
});
test.afterAll(async () => {
@@ -54,7 +54,7 @@ test.afterEach(async ({ page }, testInfo) => {
if (testInfo.status !== testInfo.expectedStatus) {
await takeScreenshot(testInfo);
}
- await init();
+ await clearDataStorage();
});
test.beforeEach(async () => {
diff --git a/tests/e2e/perspective-grid-sort.pw.e2e.js b/tests/e2e/perspective-grid-sort.pw.e2e.js
index 05914f6cc..8be8baabf 100644
--- a/tests/e2e/perspective-grid-sort.pw.e2e.js
+++ b/tests/e2e/perspective-grid-sort.pw.e2e.js
@@ -11,12 +11,12 @@ import {
import { clickOn, getGridFileName, takeScreenshot } from './general.helpers';
import { startTestingApp, stopApp, testDataRefresh } from './hook';
-import { init } from './welcome.helpers';
+import { clearDataStorage } from './welcome.helpers';
import { getDirEntries } from './perspective-grid.helpers';
test.beforeAll(async () => {
- await startTestingApp('extconfig-with-welcome.js');
- await init();
+ await startTestingApp('extconfig.js');
+ // await clearDataStorage();
});
test.afterAll(async () => {
diff --git a/tests/e2e/perspective-grid.pw.e2e.js b/tests/e2e/perspective-grid.pw.e2e.js
index 13dc1b5ec..324d16fbf 100644
--- a/tests/e2e/perspective-grid.pw.e2e.js
+++ b/tests/e2e/perspective-grid.pw.e2e.js
@@ -39,11 +39,11 @@ import {
import { AddRemoveTagsToSelectedFiles } from './perspective-grid.helpers';
import { getPropertiesFileName } from './file.properties.helpers';
import { startTestingApp, stopApp, testDataRefresh } from './hook';
-import { init } from './welcome.helpers';
+import { clearDataStorage } from './welcome.helpers';
test.beforeAll(async () => {
- await startTestingApp('extconfig-with-welcome.js');
- await init();
+ await startTestingApp('extconfig.js');
+ //await clearDataStorage();
});
test.afterAll(async () => {
@@ -55,7 +55,7 @@ test.afterEach(async ({ page }, testInfo) => {
if (testInfo.status !== testInfo.expectedStatus) {
await takeScreenshot(testInfo);
}
- await init();
+ await clearDataStorage();
});
test.beforeEach(async () => {
@@ -243,24 +243,6 @@ test.describe('TST50 - Perspective Grid', () => {
5000
);
}
-
- /* await doubleClickOn(selectorFolder);
- await createTxtFile();
- await searchEngine('note');
- await expectElementExist(selectorFile, true);
-
- const classNotSelected = await getGridCellClass(0);
- await clickOn(selectorFile);
- const classSelected = await waitUntilClassChanged(
- selectorFile + '/div/div',
- classNotSelected
- );
- expect(classNotSelected).not.toBe(classSelected);
-
- await clickOn('[data-tid=gridPerspectiveDeleteMultipleFiles]');
- await clickOn('[data-tid=confirmDeleteFileDialog]');
- await waitForNotification();
- await expectElementExist(selectorFile, false); */
});
test.skip('TST5015 - Tag file drag&drop in perspective [manual]', async () => {});
diff --git a/tests/e2e/quick-access.pw.e2e.js b/tests/e2e/quick-access.pw.e2e.js
index 5ed395053..6f0f7ae51 100644
--- a/tests/e2e/quick-access.pw.e2e.js
+++ b/tests/e2e/quick-access.pw.e2e.js
@@ -19,11 +19,11 @@ import { startTestingApp, stopApp, testDataRefresh } from './hook';
import { createSavedSearch, searchEngine } from './search.helpers';
import { openContextEntryMenu } from './test-utils';
import { dataTidFormat } from '../../app/services/test';
-import { init } from './welcome.helpers';
+import { clearDataStorage, closeWelcomePlaywright } from './welcome.helpers';
test.beforeAll(async () => {
await startTestingApp();
- await init();
+ //await clearDataStorage();
});
test.afterAll(async () => {
@@ -35,10 +35,11 @@ test.afterEach(async ({ page }, testInfo) => {
if (testInfo.status !== testInfo.expectedStatus) {
await takeScreenshot(testInfo);
}
- await init();
+ await clearDataStorage();
});
test.beforeEach(async () => {
+ await closeWelcomePlaywright();
if (global.isMinio) {
await createPwMinioLocation('', defaultLocationName, true);
} else {
diff --git a/tests/e2e/search.pw.e2e.js b/tests/e2e/search.pw.e2e.js
index 17d4b89db..0ad5fd9ea 100644
--- a/tests/e2e/search.pw.e2e.js
+++ b/tests/e2e/search.pw.e2e.js
@@ -25,14 +25,14 @@ import {
createSavedSearch,
addSearchCommand
} from './search.helpers';
-import { init } from './welcome.helpers';
+import { clearDataStorage, closeWelcomePlaywright } from './welcome.helpers';
import { openContextEntryMenu } from './test-utils';
import { dataTidFormat } from '../../app/services/test';
import { AddRemoveTagsToSelectedFiles } from './perspective-grid.helpers';
test.beforeAll(async () => {
- await startTestingApp('extconfig-with-welcome.js');
- await init();
+ await startTestingApp('extconfig.js'); //'extconfig-with-welcome.js');
+ // await clearDataStorage();
});
test.afterAll(async () => {
@@ -44,10 +44,11 @@ test.afterEach(async ({ page }, testInfo) => {
if (testInfo.status !== testInfo.expectedStatus) {
await takeScreenshot(testInfo);
}
- await init();
+ await clearDataStorage();
});
test.beforeEach(async () => {
+ // await closeWelcomePlaywright();
if (global.isMinio) {
await createPwMinioLocation('', defaultLocationName, true);
} else {
@@ -237,12 +238,12 @@ test.describe('TST06 - Test Search in file structure:', () => {
await expectElementExist(getFileName(file3, tags3), false, 5000);
});
- test('TST0639 - Add/Remove sidecar tags in search results [web,electron]', async () => {
+ test('TST0642 - Add/Remove sidecar tags in search results [web,electron]', async () => {
await setSettings('[data-tid=settingsSetPersistTagsInSidecarFile]', true);
await addRemoveTagsInSearchResults(['sidecar-tag5', 'sidecar-tag6']);
});
- test('TST0640 - Add/Remove filename tags in search results [web,electron]', async () => {
+ test('TST0643 - Add/Remove filename tags in search results [web,electron]', async () => {
await addRemoveTagsInSearchResults(['filename-tag5', 'filename-tag6']);
});
});
diff --git a/tests/e2e/tag.pw.e2e.js b/tests/e2e/tag.pw.e2e.js
index 70c1f2a97..44df323f1 100644
--- a/tests/e2e/tag.pw.e2e.js
+++ b/tests/e2e/tag.pw.e2e.js
@@ -8,7 +8,7 @@ import {
takeScreenshot
} from './general.helpers';
import { startTestingApp, stopApp, testDataRefresh } from './hook';
-import { init } from './welcome.helpers';
+import { clearDataStorage, closeWelcomePlaywright } from './welcome.helpers';
const testTagName = 'testTag';
const newTagName = 'newTagName';
@@ -42,7 +42,7 @@ export async function tagMenu(tagName, menuOperation) {
test.beforeAll(async () => {
await startTestingApp();
- await init();
+ //await clearDataStorage();
});
test.afterAll(async () => {
@@ -54,10 +54,11 @@ test.afterEach(async ({ page }, testInfo) => {
if (testInfo.status !== testInfo.expectedStatus) {
await takeScreenshot(testInfo);
}
- await init();
+ await clearDataStorage();
});
test.beforeEach(async () => {
+ await closeWelcomePlaywright();
await clickOn('[data-tid=tagLibrary]');
});
diff --git a/tests/e2e/viewer-audiovideo.pw.e2e.js b/tests/e2e/viewer-audiovideo.pw.e2e.js
index 9a17a22df..8f7c98325 100644
--- a/tests/e2e/viewer-audiovideo.pw.e2e.js
+++ b/tests/e2e/viewer-audiovideo.pw.e2e.js
@@ -17,14 +17,15 @@ import {
} from './general.helpers';
import { startTestingApp, stopApp, testDataRefresh } from './hook';
import { openContextEntryMenu } from './test-utils';
-import { init } from './welcome.helpers';
+import { clearDataStorage, closeWelcomePlaywright } from './welcome.helpers';
test.beforeAll(async () => {
await startTestingApp();
- await init();
+ await closeWelcomePlaywright();
});
test.afterAll(async () => {
+ await clearDataStorage();
await stopApp();
await testDataRefresh();
});
diff --git a/tests/e2e/welcome.helpers.js b/tests/e2e/welcome.helpers.js
index 7f198da4d..1425f565b 100644
--- a/tests/e2e/welcome.helpers.js
+++ b/tests/e2e/welcome.helpers.js
@@ -1,7 +1,6 @@
-import { clickOn } from './general.helpers';
import { clearStorage } from './clearstorage.helpers';
-export async function init() {
+export async function clearDataStorage() {
if (global.isWeb) {
await global.client.evaluate(() => {
window.history.pushState('', document.title, window.location.pathname);
@@ -9,25 +8,11 @@ export async function init() {
});
await global.client.reload();
} else {
- await closeWelcomePlaywright();
+ // await closeWelcomePlaywright();
await clearStorage();
}
- await closeWelcomePlaywright();
-}
-
-export async function closeWelcome() {
- const nextButton = await global.client.$('[data-tid=nextStepOnboarding]');
- if (await nextButton.isDisplayed()) {
- await nextButton.click();
- await nextButton.click();
- await nextButton.click();
- await nextButton.click();
- await global.client.pause(500);
- await clickOn('[data-tid=startTagSpacesAfterOnboarding]');
- await global.client.pause(600);
- await clickOn('[data-tid=agreeLicenseDialog]');
- }
+ // await closeWelcomePlaywright();
}
export async function closeWelcomePlaywright() {
diff --git a/tests/global-setup.js b/tests/global-setup.js
index 68459e7e2..0024cfd45 100644
--- a/tests/global-setup.js
+++ b/tests/global-setup.js
@@ -1,7 +1,3 @@
-/**
- * https://jestjs.io/docs/configuration#globalsetup-string
- * Note: Any global variables that are defined through globalSetup can only be read in globalTeardown. You cannot retrieve globals defined here in your test suites.
- */
module.exports = async function() {
// await globalSetup();