Skip to content

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

e2e fix

sytolk605214020a01
diff --git a/tests/e2e/folder.pw.e2e.js b/tests/e2e/folder.pw.e2e.js
index b7bf8446a..530ab7160 100644
--- a/tests/e2e/folder.pw.e2e.js
+++ b/tests/e2e/folder.pw.e2e.js
@@ -192,10 +192,6 @@ test.describe('TST01 - Folder management', () => {
await clickOn('[data-tid=fsEntryName_empty_folder]');
await AddRemoveTagsToSelectedFiles('grid', ['test-tag1']);
await expectElementExist('[data-tid=tagContainer_test-tag1]', true, 5000);
- /*await openContextEntryMenu(
- '[data-tid=fsEntryName_empty_folder]',
- 'fileMenuMoveCopyDirectoryTID'
- );*/
});
test('TST0111 - Open folder properties [web,minio,electron]', async () => {
diff --git a/tests/e2e/folderprops.pw.e2e.js b/tests/e2e/folderprops.pw.e2e.js
index f75b22fa5..a4c7c59c8 100644
--- a/tests/e2e/folderprops.pw.e2e.js
+++ b/tests/e2e/folderprops.pw.e2e.js
@@ -16,7 +16,8 @@ import {
expectElementExist,
takeScreenshot,
selectorFile,
- setInputKeys
+ setInputKeys,
+ getGridFileSelector
} from './general.helpers';
import { openContextEntryMenu, renameFolder } from './test-utils';
import { createFile, startTestingApp, stopApp, testDataRefresh } from './hook';
@@ -63,10 +64,6 @@ test.describe('TST02 - Folder properties', () => {
);
await clickOn('[data-tid=openInMainAreaTID]');
- await expectElementExist(
- '[data-tid=fsEntryName_' + dataTidFormat(testFile) + ']',
- true,
- 5000
- );
+ await expectElementExist(getGridFileSelector(testFile), true, 5000);
});
});
diff --git a/tests/e2e/quick-access.pw.e2e.js b/tests/e2e/quick-access.pw.e2e.js
index 6f0f7ae51..e44f12e69 100644
--- a/tests/e2e/quick-access.pw.e2e.js
+++ b/tests/e2e/quick-access.pw.e2e.js
@@ -12,6 +12,7 @@ import {
clickOn,
createNewDirectory,
expectElementExist,
+ getGridFileSelector,
setInputKeys,
takeScreenshot
} from './general.helpers';
@@ -103,7 +104,7 @@ test.describe('TST09 - Quick access', () => {
const bookmarkFileTitle = 'sample.txt';
const bookmarkFileTid = dataTidFormat(bookmarkFileTitle);
await openContextEntryMenu(
- '[data-tid="fsEntryName_' + bookmarkFileTitle + '"]', // todo rethink selector here contain dot
+ getGridFileSelector(bookmarkFileTitle), // todo rethink selector here contain dot
'fileMenuOpenFile'
);
@@ -164,7 +165,7 @@ test.describe('TST09 - Quick access', () => {
const bookmarks = ['sample.txt', 'sample.jpg'];
for (let i = 0; i < bookmarks.length; i++) {
await openContextEntryMenu(
- '[data-tid="fsEntryName_' + bookmarks[i] + '"]',
+ getGridFileSelector(bookmarks[i]),
'fileMenuOpenFile'
);
@@ -195,7 +196,7 @@ test.describe('TST09 - Quick access', () => {
const fileTitle = 'sample.jpg';
const fileTid = dataTidFormat(fileTitle);
await openContextEntryMenu(
- '[data-tid="fsEntryName_' + fileTitle + '"]', // todo rethink selector here contain dot
+ getGridFileSelector(fileTitle),
'fileMenuOpenFile'
);
await clickOn('[data-tid=fileContainerCloseOpenedFile]');
@@ -227,7 +228,7 @@ test.describe('TST09 - Quick access', () => {
// Add
const fileTid = dataTidFormat(files[i]);
await openContextEntryMenu(
- '[data-tid="fsEntryName_' + files[i] + '"]',
+ getGridFileSelector(files[i]),
'fileMenuOpenFile'
);
await clickOn('[data-tid=fileContainerCloseOpenedFile]');
@@ -255,7 +256,7 @@ test.describe('TST09 - Quick access', () => {
const fileTitle = 'sample.txt';
const fileTid = dataTidFormat(fileTitle);
await openContextEntryMenu(
- '[data-tid="fsEntryName_' + fileTitle + '"]', // todo rethink selector here contain dot
+ getGridFileSelector(fileTitle),
'fileMenuOpenFile'
);
await clickOn('[data-tid=fileContainerEditFile]');
diff --git a/tests/e2e/search.pw.e2e.js b/tests/e2e/search.pw.e2e.js
index ea6c83de4..c4f978eb4 100644
--- a/tests/e2e/search.pw.e2e.js
+++ b/tests/e2e/search.pw.e2e.js
@@ -156,10 +156,7 @@ test.describe('TST06 - Test Search in file structure:', () => {
test('TST0623 - Search actions - history [web,electron,_pro]', async () => {
const file = 'sample.txt';
// add file to history
- await openContextEntryMenu(
- '[data-tid="fsEntryName_' + file + '"]',
- 'fileMenuOpenFile'
- );
+ await openContextEntryMenu(getGridFileSelector(file), 'fileMenuOpenFile');
await closeFileProperties();
await addSearchCommand('h:', false);
@@ -173,7 +170,7 @@ test.describe('TST06 - Test Search in file structure:', () => {
test('TST0624 - Search actions - bookmarks [web,electron,_pro]', async () => {
const bookmarkFileTitle = 'sample.txt';
await openContextEntryMenu(
- '[data-tid="fsEntryName_' + bookmarkFileTitle + '"]',
+ getGridFileSelector(bookmarkFileTitle),
'fileMenuOpenFile'
);
@@ -215,25 +212,19 @@ test.describe('TST06 - Test Search in file structure:', () => {
const tags1 = ['test-tag1'];
const tags2 = ['test-tag1', 'test-tag2'];
const tags3 = ['test-tag2', 'test-tag3'];
- await clickOn('[data-tid="fsEntryName_sample.' + file1 + '"]');
+ await clickOn(getGridFileSelector('sample.' + file1));
await AddRemoveTagsToSelectedFiles('grid', tags1, true);
const file2 = 'jpg';
- await clickOn('[data-tid="fsEntryName_sample.' + file2 + '"]');
+ await clickOn(getGridFileSelector('sample.' + file2));
await AddRemoveTagsToSelectedFiles('grid', tags2, true);
const file3 = 'gif';
- await clickOn('[data-tid="fsEntryName_sample.' + file3 + '"]');
+ await clickOn(getGridFileSelector('sample.' + file3));
await AddRemoveTagsToSelectedFiles('grid', tags3, true);
function getFileName(fileExt, tags) {
- return (
- '[data-tid="fsEntryName_sample[' +
- tags.join(' ') +
- '].' +
- fileExt +
- '"]'
- );
+ return getGridFileSelector('sample[' + tags.join(' ') + '].' + fileExt);
}
// Search for + one tag only: test-tag2
await addSearchCommand('+' + tags1[0], true);
diff --git a/tests/e2e/viewer-audiovideo.pw.e2e.js b/tests/e2e/viewer-audiovideo.pw.e2e.js
index 8f7c98325..fb6bdf51d 100644
--- a/tests/e2e/viewer-audiovideo.pw.e2e.js
+++ b/tests/e2e/viewer-audiovideo.pw.e2e.js
@@ -12,6 +12,7 @@ import {
import {
clickOn,
expectAudioPlay,
+ getGridFileSelector,
isDisplayed,
takeScreenshot
} from './general.helpers';
@@ -48,7 +49,7 @@ test.beforeEach(async () => {
test.describe('TST59 - Media player', () => {
test('TST5901 - Play ogg file [web,minio,electron]', async () => {
await openContextEntryMenu(
- '[data-tid="fsEntryName_sample.ogg"]',
+ getGridFileSelector('sample.ogg'),
'fileMenuOpenFile'
);
await expectAudioPlay();
@@ -56,7 +57,7 @@ test.describe('TST59 - Media player', () => {
test('TST5902 - Play ogv file [web,minio,electron]', async () => {
await openContextEntryMenu(
- '[data-tid="fsEntryName_sample.ogv"]',
+ getGridFileSelector('sample.ogv'),
'fileMenuOpenFile'
);
await expectAudioPlay();
@@ -64,7 +65,7 @@ test.describe('TST59 - Media player', () => {
test('TST5903 - Open and close about dialog [web,minio,electron]', async () => {
await openContextEntryMenu(
- '[data-tid="fsEntryName_sample.mp4"]',
+ getGridFileSelector('sample.mp4'),
'fileMenuOpenFile'
);
@@ -96,7 +97,7 @@ test.describe('TST59 - Media player', () => {
test('TST5904 - Play mp3 [web,minio,electron]', async () => {
await openContextEntryMenu(
- '[data-tid="fsEntryName_sample.mp3"]',
+ getGridFileSelector('sample.mp3'),
'fileMenuOpenFile'
);
await expectAudioPlay();
@@ -107,7 +108,7 @@ test.describe('TST59 - Media player', () => {
*/
test('TST5905 - Play webm [web,minio,electron]', async () => {
await openContextEntryMenu(
- '[data-tid="fsEntryName_sample.webm"]',
+ getGridFileSelector('sample.webm'),
'fileMenuOpenFile'
);
@@ -125,7 +126,7 @@ test.describe('TST59 - Media player', () => {
test('TST5906 - Play flac [web,minio,electron]', async () => {
await openContextEntryMenu(
- '[data-tid="fsEntryName_sample.flac"]',
+ getGridFileSelector('sample.flac'),
'fileMenuOpenFile'
);
await expectAudioPlay();