Skip to content

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

e2e fixes for web

sytolkd1bd876d9a11
diff --git a/app/components/EntryProperties.tsx b/app/components/EntryProperties.tsx
index a9cbcc994..2a81f35ca 100644
--- a/app/components/EntryProperties.tsx
+++ b/app/components/EntryProperties.tsx
@@ -1075,6 +1075,7 @@ function EntryProperties(props: Props) {
>
<Grid item xs={showLinkForDownloading ? 8 : 12}>
<TextField
+ data-tid="sharingLinkTID"
margin="dense"
name="path"
label={
diff --git a/tests/e2e/fileopener.pw.e2e.js b/tests/e2e/fileopener.pw.e2e.js
index 4bef108ac..003b45748 100644
--- a/tests/e2e/fileopener.pw.e2e.js
+++ b/tests/e2e/fileopener.pw.e2e.js
@@ -317,15 +317,17 @@ test.describe('TST08 - File folder properties', () => {
const fileName = 'sample.jpg';
await clickOn(getGridFileSelector(fileName));
await clickOn('[data-tid=fileContainerToggleProperties]');
- await clickOn('[data-tid=copyLinkToClipboardTID]');
+
+ const sharingLink = await global.client.$(
+ '[data-tid=sharingLinkTID] input'
+ );
+ const sharingLinkValue = await sharingLink.getAttribute('value');
+
await clickOn('[data-tid=fileContainerCloseOpenedFile]');
await clickOn('[data-tid=locationManagerMenu]');
await clickOn('[data-tid=locationManagerMenuOpenLink]');
- const clipboardContent = await global.client.evaluate(() =>
- navigator.clipboard.readText()
- );
- await setInputKeys('directoryName', clipboardContent);
+ await setInputKeys('directoryName', sharingLinkValue);
await clickOn('[data-tid=confirmOpenLink]');
await expectElementExist(
'[data-tid=OpenedTID' + dataTidFormat(fileName) + ']',
diff --git a/tests/e2e/folderprops.pw.e2e.js b/tests/e2e/folderprops.pw.e2e.js
index 8c3af7055..db6d51b3f 100644
--- a/tests/e2e/folderprops.pw.e2e.js
+++ b/tests/e2e/folderprops.pw.e2e.js
@@ -190,14 +190,21 @@ test.describe('TST02 - Folder properties', () => {
});
test('TST0215 - Link for internal sharing + copy [web,minio,electron]', async () => {
- await clickOn('[data-tid=copyLinkToClipboardTID]');
+ // await clickOn('[data-tid=copyLinkToClipboardTID]');
+ const sharingLink = await global.client.$(
+ '[data-tid=sharingLinkTID] input'
+ );
+ const sharingLinkValue = await sharingLink.getAttribute('value');
await clickOn('[data-tid=locationManagerMenu]');
await clickOn('[data-tid=locationManagerMenuOpenLink]');
- const clipboardContent = await global.client.evaluate(() =>
+ /*const clipboardContent = await global.client.evaluate(() =>
navigator.clipboard.readText()
);
- await setInputKeys('directoryName', clipboardContent);
+ expect(clipboardContent.length > 0).toBe(true);*/
+ //await setInputKeys('directoryName', clipboardContent);
+ await setInputValue('[data-tid=directoryName] input', sharingLinkValue);
+ await clickOn('[data-tid=directoryName] input');
await clickOn('[data-tid=confirmOpenLink]');
await expectElementExist('[data-tid=currentDir_empty_folder]', true, 5000);
/*
@@ -217,7 +224,10 @@ test.describe('TST02 - Folder properties', () => {
test('TST0216 - Set gallery perspective as default for folder [web,minio,electron,_pro]', async () => {
const fileName = 'sample.jpg';
- await openContextEntryMenu(getGridFileSelector(fileName), 'fileMenuMoveCopyFile');
+ await openContextEntryMenu(
+ getGridFileSelector(fileName),
+ 'fileMenuMoveCopyFile'
+ );
await clickOn('[data-tid=MoveTargetempty_folder]');
await clickOn('[data-tid=confirmCopyFiles]');
@@ -225,6 +235,10 @@ test.describe('TST02 - Folder properties', () => {
await clickOn('[data-value=gallery]');
await global.client.dblclick('[data-tid=fsEntryName_empty_folder]');
- await expectElementExist('[data-tid=perspectiveGalleryToolbar]', true, 5000);
+ await expectElementExist(
+ '[data-tid=perspectiveGalleryToolbar]',
+ true,
+ 5000
+ );
});
});
diff --git a/tests/e2e/search.pw.e2e.js b/tests/e2e/search.pw.e2e.js
index 0748afcf5..4e0d7b22d 100644
--- a/tests/e2e/search.pw.e2e.js
+++ b/tests/e2e/search.pw.e2e.js
@@ -137,11 +137,9 @@ test.describe('TST06 - Test Search in file structure:', () => {
//const firstLocationTID = await getPwLocationTid(0);
await closeLocation(); //lastLocationTID);
await expectElementExist('[data-tid=WelcomePanelTID]', true);
- await searchEngine('l:', {}, false);
+ await addSearchCommand('l:', false);
await clickOn('#textQuery-option-0');
- await clickOn('[data-tid=folderContainerOpenDirMenu]');
- await clickOn('[data-tid=showProperties]');
- await expectElementExist('[data-tid=OpenedTIDempty_folder]', true);
+ await expectElementExist('[data-tid=currentDir_empty_folder]', true, 5000);
});
test('TST0622 - Search actions - filter [web,electron]', async () => {