Skip to content

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

chore: separating old tests

Ilian Sapundshiev960aea5eb7ac
diff --git a/app/components/LocationManager.tsx b/app/components/LocationManager.tsx
index b5088688c..1055a4cd1 100644
--- a/app/components/LocationManager.tsx
+++ b/app/components/LocationManager.tsx
@@ -224,7 +224,9 @@ const LocationManager = (props: Props) => {
<ExportLocationsDialog
open={isExportLocationsDialogOpened}
onClose={() => setExportLocationsDialogOpened(false)}
- locations={props.locations.filter(location => !location.isNotEditable)}
+ locations={props.locations.filter(
+ location => !location.isNotEditable
+ )}
/>
)}
{ImportLocationsDialog && importFile && (
diff --git a/tests/e2e/extensions/editor-html.spec.js b/tests/e2e/old/editor-html.spec.js
similarity index 94%
rename from tests/e2e/extensions/editor-html.spec.js
rename to tests/e2e/old/editor-html.spec.js
index 97a6ffdc7..da06d6f6e 100644
--- a/tests/e2e/extensions/editor-html.spec.js
+++ b/tests/e2e/old/editor-html.spec.js
@@ -2,7 +2,14 @@
import { delay, clearLocalStorage } from '../hook';
import { searchEngine } from '../search.helpers';
import { openFile } from '../test-utils';
-import { createLocation, openLocation, aboutDialogExt, defaultLocationPath, defaultLocationName, perspectiveGridTable } from '../location.e2e';
+import {
+ createLocation,
+ openLocation,
+ aboutDialogExt,
+ defaultLocationPath,
+ defaultLocationName,
+ perspectiveGridTable
+} from '../location.e2e';
const extButton = '/div[1]/div[2]/button';
const firstExtButton = 'div[1]/button';
@@ -32,7 +39,7 @@ describe('TST56 - Editor Extension', () => {
// window.$htmlEditor.append('Opening dialog simulated');
// });
- await webview.executeJavaScript((e) => {
+ await webview.executeJavaScript(e => {
console.log(e);
window.$htmlEditor.append('Opening dialog simulated');
});
@@ -76,4 +83,3 @@ describe('TST56 - Editor Extension', () => {
// .waitForVisible('#closeAboutDialogButton').click('#closeAboutDialogButton')
});
});
-
diff --git a/tests/e2e/extensions/editor-json.spec.js b/tests/e2e/old/editor-json.spec.js
similarity index 82%
rename from tests/e2e/extensions/editor-json.spec.js
rename to tests/e2e/old/editor-json.spec.js
index c489a26f7..0b1009cdc 100644
--- a/tests/e2e/extensions/editor-json.spec.js
+++ b/tests/e2e/old/editor-json.spec.js
@@ -2,11 +2,18 @@
import { delay, clearLocalStorage } from './hook';
import { searchEngine } from './search.helpers';
import { openFile } from './perspective.spec';
-import { createLocation, openLocation, defaultLocationPath, defaultLocationName, perspectiveGridTable } from './location.spec';
+import {
+ createLocation,
+ openLocation,
+ defaultLocationPath,
+ defaultLocationName,
+ perspectiveGridTable
+} from './location.spec';
-const dirPath ='./tagspacestests/webdav-app';
+const dirPath = './tagspacestests/webdav-app';
-const extButton = '//*[@id="perspectiveGridGroupContent0"]/div[1]/div[2]/button';
+const extButton =
+ '//*[@id="perspectiveGridGroupContent0"]/div[1]/div[2]/button';
const firstFile = '/div[1]/div';
const iFrame = '#iframeViewer';
@@ -33,5 +40,3 @@ describe('TST57 - JSON Editor Extension', () => {
// .should.eventually.contain('version')
});
});
-
-
diff --git a/tests/e2e/extensions/editor-text.spec.js b/tests/e2e/old/editor-text.spec.js
similarity index 95%
rename from tests/e2e/extensions/editor-text.spec.js
rename to tests/e2e/old/editor-text.spec.js
index 6b8f038db..e0b4fc944 100644
--- a/tests/e2e/extensions/editor-text.spec.js
+++ b/tests/e2e/old/editor-text.spec.js
@@ -2,10 +2,18 @@
import { delay, clearLocalStorage } from './hook';
import { searchEngine } from './search.helpers';
import { openFile } from './perspective.spec';
-import { createLocation, openLocation, aboutDialogExt, defaultLocationPath, defaultLocationName, perspectiveGridTable } from './location.spec';
+import {
+ createLocation,
+ openLocation,
+ aboutDialogExt,
+ defaultLocationPath,
+ defaultLocationName,
+ perspectiveGridTable
+} from './location.spec';
const dirPath = defaultLocationPath + '/content-extraction';
-const extButton = '//*[@id="perspectiveGridGroupContent0"]/div[1]/div[2]/button';
+const extButton =
+ '//*[@id="perspectiveGridGroupContent0"]/div[1]/div[2]/button';
const firstFile = '/div[1]/div';
const iFrame = '#viewer';
@@ -97,5 +105,3 @@ describe('TST55 - Editor Text', async () => {
await aboutDialogExt(aboutTitle);
});
});
-
-
diff --git a/tests/e2e/old/filetypes.spec.js b/tests/e2e/old/filetypes.spec.js
new file mode 100644
index 000000000..6f974bafe
--- /dev/null
+++ b/tests/e2e/old/filetypes.spec.js
@@ -0,0 +1,46 @@
+/* Copyright (c) 2016-present - TagSpaces UG (Haftungsbeschraenkt). All rights reserved. */
+import { clearLocalStorage, delay } from './hook';
+import {
+ createLocation,
+ defaultLocationPath,
+ openLocation
+} from './location.helpers';
+import { openSettings } from './general.е2е';
+
+const testLocationName = '' + new Date().getTime();
+
+describe('TST12 - Settings file type:', async () => {
+ beforeEach(async () => {
+ await clearLocalStorage();
+ await delay(500);
+ await createLocation(defaultLocationPath, testLocationName);
+ await delay(500);
+ await openLocation(testLocationName);
+ await delay(500);
+ await openSettings('fileTypeSettingsDialog');
+ await delay(500);
+ });
+
+ it('TST1201 - Add file type', async () => {
+ // TODO add file type
+ await global.client.waitForVisible(
+ '[data-tid=settingsFileTypes_addFileType]'
+ );
+ await global.client.click('[data-tid=settingsFileTypes_addFileType]');
+ });
+
+ it('TST1202 - Remove file type', async () => {
+ // TODO remove file type
+ await global.client.waitForVisible(
+ '[data-tid=settingsFileTypes_remove_bmp]'
+ );
+ await global.client.click('[data-tid=settingsFileTypes_remove_bmp]');
+ const removeExt = await global.client.element(
+ '[data-tid=settingsFileTypes_remove_bmp]'
+ );
+ await delay(500);
+ expect(removeExt.selector).not.toBe(
+ '[data-tid=settingsFileTypes_remove_bmp]'
+ );
+ });
+});
diff --git a/tests/e2e/old/settings.spec.js b/tests/e2e/old/settings.spec.js
new file mode 100644
index 000000000..961e74e5b
--- /dev/null
+++ b/tests/e2e/old/settings.spec.js
@@ -0,0 +1,65 @@
+/* Copyright (c) 2016-present - TagSpaces UG (Haftungsbeschraenkt). All rights reserved. */
+import { delay, clearLocalStorage } from './hook';
+import {
+ createLocation,
+ openLocation,
+ defaultLocationPath,
+ checkForIdExist
+} from './location.helpers';
+
+const testLocationName = '' + new Date().getTime();
+const testNewLocationName = '' + new Date().getTime();
+
+const hiddenFile = '.ts';
+const perspectiveGridTable = '[data-tid=perspectiveGridFileTable]';
+
+describe('TST10 - General', () => {
+ beforeEach(async () => {
+ await clearLocalStorage();
+ await delay(500);
+ });
+
+ it('TST1001 - Show files & directories with dots in the begin of the filename', async () => {
+ await createLocation(defaultLocationPath, testLocationName, true);
+ await delay(500);
+ await global.client.waitForVisible('[data-tid=settings]');
+ await global.client.click('[data-tid=settings]');
+ // activate 'Show Hidden File' functionality in the general settings
+ await global.client.waitForVisible(
+ '[data-tid=settingsSetShowUnixHiddenEntries]'
+ );
+ await global.client.click('[data-tid=settingsSetShowUnixHiddenEntries]');
+ await global.client.waitForVisible('[data-tid=closeSettingsDialog]');
+ await global.client.click('[data-tid=closeSettingsDialog]');
+ await openLocation(testLocationName);
+ // should find hidden file with dot in the begin of the filename
+ await global.client.waitForVisible(perspectiveGridTable);
+ const hiddenEntry = await global.client.getText(
+ perspectiveGridTable,
+ hiddenFile
+ );
+ expect(hiddenFile).toBe(hiddenEntry);
+ });
+
+ it('TST1002 - Use default location as startup location', async () => {
+ // activate 'Use default location as a startup location'
+ // functionality in the general settings
+ await delay(500);
+ await createLocation(defaultLocationPath, testLocationName, true);
+ await delay(500);
+ await createLocation(defaultLocationPath, testNewLocationName, true);
+ await delay(500);
+ await global.client.waitForVisible('[data-tid=settings]');
+ await global.client.click('[data-tid=settings]');
+ await global.client.waitForVisible(
+ '[data-tid=settingsSetUseDefaultLocation]'
+ );
+ await global.client.click('[data-tid=settingsSetUseDefaultLocation]');
+ await global.client.waitForVisible('[data-tid=closeSettingsDialog]');
+ await global.client.click('[data-tid=closeSettingsDialog]');
+ // reload application
+ await global.client.keys('F5');
+ await delay(500);
+ await checkForIdExist('perspectiveGridFileTable');
+ });
+});
diff --git a/tests/e2e/extensions/viewer-epub.spec.js b/tests/e2e/old/viewer-epub.spec.js
similarity index 90%
rename from tests/e2e/extensions/viewer-epub.spec.js
rename to tests/e2e/old/viewer-epub.spec.js
index 0fdba615a..36056574f 100644
--- a/tests/e2e/extensions/viewer-epub.spec.js
+++ b/tests/e2e/old/viewer-epub.spec.js
@@ -2,7 +2,13 @@
import { delay, clearLocalStorage } from './hook';
import { searchEngine } from './search.helpers';
import { openFile } from './perspective.spec';
-import { createLocation, openLocation, defaultLocationPath, defaultLocationName, perspectiveGridTable } from './location.spec';
+import {
+ createLocation,
+ openLocation,
+ defaultLocationPath,
+ defaultLocationName,
+ perspectiveGridTable
+} from './location.spec';
const extButton = '/div[1]/div[2]/button';
const firstExtButton = '/div[1]/button';
diff --git a/tests/e2e/extensions/viewer-html.spec.js b/tests/e2e/old/viewer-html.spec.js
similarity index 96%
rename from tests/e2e/extensions/viewer-html.spec.js
rename to tests/e2e/old/viewer-html.spec.js
index 81bc2ab2d..650de34f0 100644
--- a/tests/e2e/extensions/viewer-html.spec.js
+++ b/tests/e2e/old/viewer-html.spec.js
@@ -2,7 +2,14 @@
import { delay, clearLocalStorage } from './hook';
import { searchEngine } from './search.helpers';
import { openFile } from './perspective.spec';
-import { createLocation, openLocation, aboutDialogExt, defaultLocationPath, defaultLocationName, perspectiveGridTable } from './location.spec';
+import {
+ createLocation,
+ openLocation,
+ aboutDialogExt,
+ defaultLocationPath,
+ defaultLocationName,
+ perspectiveGridTable
+} from './location.spec';
const extButton = '/div[1]/div[2]/button';
const firstExtButton = '/div[1]/button';
@@ -94,5 +101,3 @@ describe('TST61 - HTML Viewer', () => {
// .should.eventually.equals('markdown zoomDefault')
});
});
-
-
diff --git a/tests/e2e/extensions/viewer-image.spec.js b/tests/e2e/old/viewer-image.spec.js
similarity index 95%
rename from tests/e2e/extensions/viewer-image.spec.js
rename to tests/e2e/old/viewer-image.spec.js
index fef828cbd..c32e3ab99 100644
--- a/tests/e2e/extensions/viewer-image.spec.js
+++ b/tests/e2e/old/viewer-image.spec.js
@@ -2,7 +2,13 @@
import { delay, clearLocalStorage } from './hook';
import { searchEngine } from './search.helpers';
import { openFile } from './perspective.spec';
-import { createLocation, openLocation, defaultLocationPath, defaultLocationName, perspectiveGridTable } from './location.spec';
+import {
+ createLocation,
+ openLocation,
+ defaultLocationPath,
+ defaultLocationName,
+ perspectiveGridTable
+} from './location.spec';
const extButton = '/tbody/tr/td[1]/button[1]';
const firstFile = '/div[1]/div';
diff --git a/tests/e2e/extensions/viewer-markdown.spec.js b/tests/e2e/old/viewer-markdown.spec.js
similarity index 94%
rename from tests/e2e/extensions/viewer-markdown.spec.js
rename to tests/e2e/old/viewer-markdown.spec.js
index e61660512..84ddce4e9 100644
--- a/tests/e2e/extensions/viewer-markdown.spec.js
+++ b/tests/e2e/old/viewer-markdown.spec.js
@@ -2,7 +2,13 @@
import { delay, clearLocalStorage } from './hook';
import { searchEngine } from './search.helpers';
import { openFile } from './perspective.spec';
-import { createLocation, openLocation, defaultLocationPath, defaultLocationName, perspectiveGridTable } from './location.spec';
+import {
+ createLocation,
+ openLocation,
+ defaultLocationPath,
+ defaultLocationName,
+ perspectiveGridTable
+} from './location.spec';
const extButton = '/div[1]/div[2]/button';
const firstFile = '/div[1]/div';
@@ -59,4 +65,3 @@ describe('TST54 - Markdown viewer extension', () => {
// .getElementSize('//*[@id="mdContent"]/p[7]/img', 'width').should.eventually.equals(200)
});
});
-
diff --git a/tests/e2e/extensions/viewer-mhtml.spec.js b/tests/e2e/old/viewer-mhtml.spec.js
similarity index 93%
rename from tests/e2e/extensions/viewer-mhtml.spec.js
rename to tests/e2e/old/viewer-mhtml.spec.js
index ca46605ac..b7c92217e 100644
--- a/tests/e2e/extensions/viewer-mhtml.spec.js
+++ b/tests/e2e/old/viewer-mhtml.spec.js
@@ -2,13 +2,21 @@
import { delay, clearLocalStorage } from './hook';
import { searchEngine } from './search.helpers';
import { openFile } from './perspective.spec';
-import { createLocation, openLocation, aboutDialogExt, defaultLocationPath, defaultLocationName, perspectiveGridTable } from './location.spec';
+import {
+ createLocation,
+ openLocation,
+ aboutDialogExt,
+ defaultLocationPath,
+ defaultLocationName,
+ perspectiveGridTable
+} from './location.spec';
const extButton = '/div[1]/div[2]/button';
const firstFile = '/div[1]/div';
let iFrame = '#viewerMHTMLViewer';
-let text = 'This week at TechCrunch Disrupt ambitious startups took the stage and shared their vision of changing the world™.';
+let text =
+ 'This week at TechCrunch Disrupt ambitious startups took the stage and shared their vision of changing the world™.';
describe('TST61 - MHTML Viewer', () => {
beforeEach(async () => {
@@ -89,5 +97,3 @@ describe('TST61 - MHTML Viewer', () => {
// .waitForVisible('#readabilityOn').should.eventually.exist
});
});
-
-
diff --git a/tests/e2e/extensions/viewer-pdf.spec.js b/tests/e2e/old/viewer-pdf.spec.js
similarity index 84%
rename from tests/e2e/extensions/viewer-pdf.spec.js
rename to tests/e2e/old/viewer-pdf.spec.js
index da4a013a0..14c09a400 100644
--- a/tests/e2e/extensions/viewer-pdf.spec.js
+++ b/tests/e2e/old/viewer-pdf.spec.js
@@ -2,7 +2,13 @@
import { delay, clearLocalStorage } from './hook';
import { searchEngine } from './search.helpers';
import { openFile } from './perspective.spec';
-import { createLocation, openLocation, defaultLocationPath, defaultLocationName, perspectiveGridTable } from './location.spec';
+import {
+ createLocation,
+ openLocation,
+ defaultLocationPath,
+ defaultLocationName,
+ perspectiveGridTable
+} from './location.spec';
const extButton = '/div[1]/div[2]/button';
const firstFile = '/div[1]/div';
@@ -22,5 +28,3 @@ describe('TST58 - PDF viewer', () => {
await openFile(perspectiveGridTable, firstFile);
});
});
-
-
diff --git a/tests/e2e/extensions/viewer-text.spec.js b/tests/e2e/old/viewer-text.spec.js
similarity index 88%
rename from tests/e2e/extensions/viewer-text.spec.js
rename to tests/e2e/old/viewer-text.spec.js
index 6a3fe6eea..b8f676183 100644
--- a/tests/e2e/extensions/viewer-text.spec.js
+++ b/tests/e2e/old/viewer-text.spec.js
@@ -2,7 +2,13 @@
import { delay, clearLocalStorage } from './hook';
import { searchEngine } from './search.helpers';
import { openFile } from './perspective.spec';
-import { createLocation, openLocation, defaultLocationPath, defaultLocationName, perspectiveGridTable } from './location.spec';
+import {
+ createLocation,
+ openLocation,
+ defaultLocationPath,
+ defaultLocationName,
+ perspectiveGridTable
+} from './location.spec';
const extButton = '/tbody/tr/td[1]/button[1]';
const firstFile = '/div[1]/div';
@@ -28,5 +34,3 @@ describe('TST62 - Text viewer', () => {
// .getText('//*[@id="mainLayout"]/textarea').should.eventually.contain(text)
});
});
-
-
diff --git a/tests/e2e/extensions/viewer-url.spec.js b/tests/e2e/old/viewer-url.spec.js
similarity index 91%
rename from tests/e2e/extensions/viewer-url.spec.js
rename to tests/e2e/old/viewer-url.spec.js
index ea87666f9..51310e2d4 100644
--- a/tests/e2e/extensions/viewer-url.spec.js
+++ b/tests/e2e/old/viewer-url.spec.js
@@ -2,7 +2,14 @@
import { delay, clearLocalStorage } from './hook';
import { searchEngine } from './search.helpers';
import { openFile } from './perspective.spec';
-import { createLocation, openLocation, aboutDialogExt, defaultLocationPath, defaultLocationName, perspectiveGridTable } from './location.spec';
+import {
+ createLocation,
+ openLocation,
+ aboutDialogExt,
+ defaultLocationPath,
+ defaultLocationName,
+ perspectiveGridTable
+} from './location.spec';
const extButton = '/tbody/tr/td[1]/button[1]';
const firstFile = '/div[1]/div';
@@ -42,5 +49,3 @@ describe('TST63 - URL viewer', () => {
// .waitForVisible('#closeAboutDialogButton').click('#closeAboutDialogButton')
});
});
-
-
diff --git a/tests/e2e/extensions/viewer-zip.spec.js b/tests/e2e/old/viewer-zip.spec.js
similarity index 87%
rename from tests/e2e/extensions/viewer-zip.spec.js
rename to tests/e2e/old/viewer-zip.spec.js
index 682c0165f..339052cd2 100644
--- a/tests/e2e/extensions/viewer-zip.spec.js
+++ b/tests/e2e/old/viewer-zip.spec.js
@@ -2,14 +2,22 @@
import { delay, clearLocalStorage } from './hook';
import { searchEngine } from './search.helpers';
import { openFile } from './perspective.spec';
-import { createLocation, openLocation, aboutDialogExt, defaultLocationPath, defaultLocationName, perspectiveGridTable } from './location.spec';
+import {
+ createLocation,
+ openLocation,
+ aboutDialogExt,
+ defaultLocationPath,
+ defaultLocationName,
+ perspectiveGridTable
+} from './location.spec';
const extButton = '/tbody/tr/td[1]/button[1]';
const firstFile = '/div[1]/div';
const iFrame = '#iframeViewer';
const someFileNameInExt = 'TestData-DirectoryMeta/201410/.ts/tsm.json';
-const firstFileNameInExt = 'TestData-DirectoryMeta/.ts/034-IMG_29263[5star 20130809].jpg.png';
+const firstFileNameInExt =
+ 'TestData-DirectoryMeta/.ts/034-IMG_29263[5star 20130809].jpg.png';
let text = 'Contents of file';
describe('TST64 - Zip viewer', () => {
@@ -47,4 +55,3 @@ describe('TST64 - Zip viewer', () => {
await aboutDialogExt('About URL Viewer');
});
});
-