Skip to content

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

e2e fixes

sytolk95789174d0c4
diff --git a/scripts/extconfig-two-locations.js b/scripts/extconfig-two-locations.js
index 28fd0a0ba..29cdd606a 100644
--- a/scripts/extconfig-two-locations.js
+++ b/scripts/extconfig-two-locations.js
@@ -19,7 +19,7 @@ window.ExtLocations = [
watchForChanges: false // activates the watching for changed files in the current location
},
{
- uuid: '30565f09-c7fd-2333-fc67-a75db27rt5ba', // an unique id of the location
+ uuid: '30565f09-c7fd-2333-fc67-a75db27rt5b1', // an unique id of the location
type: '0', // 1 defines the locations a cloud based
name: 'supported-filestypes', // the name of the location
path: './tests/testdata-tmp/file-structure/supported-filestypes', // the path to sub folder in the location
diff --git a/scripts/webextconfig-two-locations.js b/scripts/webextconfig-two-locations.js
index 28fd0a0ba..29cdd606a 100644
--- a/scripts/webextconfig-two-locations.js
+++ b/scripts/webextconfig-two-locations.js
@@ -19,7 +19,7 @@ window.ExtLocations = [
watchForChanges: false // activates the watching for changed files in the current location
},
{
- uuid: '30565f09-c7fd-2333-fc67-a75db27rt5ba', // an unique id of the location
+ uuid: '30565f09-c7fd-2333-fc67-a75db27rt5b1', // an unique id of the location
type: '0', // 1 defines the locations a cloud based
name: 'supported-filestypes', // the name of the location
path: './tests/testdata-tmp/file-structure/supported-filestypes', // the path to sub folder in the location
diff --git a/tests/e2e/folder.pw.e2e.js b/tests/e2e/folder.pw.e2e.js
index 685908609..f9c004add 100644
--- a/tests/e2e/folder.pw.e2e.js
+++ b/tests/e2e/folder.pw.e2e.js
@@ -157,10 +157,12 @@ test.describe('TST01 - Folder management', () => {
await clickOn('[data-tid=confirmMoveFiles]');
await clickOn('[data-tid=uploadCloseAndClearTID]');
await clickOn('[data-tid=location_' + defaultLocationName + ']');
- await expectElementExist('[data-tid=fsEntryName_empty_folder]', false, 5000);
- await global.client.dblclick(
- '[data-tid=fsEntryName_' + folderToMove + ']'
+ await expectElementExist(
+ '[data-tid=fsEntryName_empty_folder]',
+ false,
+ 5000
);
+ await global.client.dblclick('[data-tid=fsEntryName_' + folderToMove + ']');
await expectElementExist('[data-tid=fsEntryName_empty_folder]', true, 5000);
await testDataRefresh();
});
@@ -180,9 +182,7 @@ test.describe('TST01 - Folder management', () => {
await clickOn('[data-tid=uploadCloseAndClearTID]');
await clickOn('[data-tid=location_' + defaultLocationName + ']');
await expectElementExist('[data-tid=fsEntryName_empty_folder]', true, 5000);
- await global.client.dblclick(
- '[data-tid=fsEntryName_' + folderToCopy + ']'
- );
+ await global.client.dblclick('[data-tid=fsEntryName_' + folderToCopy + ']');
await expectElementExist('[data-tid=fsEntryName_empty_folder]', true, 5000);
await testDataRefresh();
});
diff --git a/tests/e2e/location.helpers.js b/tests/e2e/location.helpers.js
index 58999d064..fd2db5ff3 100644
--- a/tests/e2e/location.helpers.js
+++ b/tests/e2e/location.helpers.js
@@ -97,16 +97,26 @@ export async function openLocationMenu(locationName) {
await clickOn('[data-tid=locationMoreButton_' + locationName + ']');
}
-export async function closeLocation(locationName) {
- const locationSelector = '[data-tid=locationMoreButton_' + locationName + ']';
- //const element = await global.client.$(locationSelector);
- // if (!(await element.isDisplayed())) {
- if (!(await isDisplayed(locationSelector))) {
- await clickOn('[data-tid=mobileMenuButton]');
+/**
+ * @param locationName = undefined -> closeAll
+ * @returns {Promise<void>}
+ */
+export async function closeLocation(locationName = undefined) {
+ if (locationName) {
+ const locationSelector =
+ '[data-tid=locationMoreButton_' + locationName + ']';
+ //const element = await global.client.$(locationSelector);
+ // if (!(await element.isDisplayed())) {
+ if (!(await isDisplayed(locationSelector))) {
+ await clickOn('[data-tid=mobileMenuButton]');
+ }
+ // await global.client.pause(500);
+ await clickOn(locationSelector);
+ await clickOn('[data-tid=closeLocationTID]');
+ } else {
+ await clickOn('[data-tid=locationManagerMenu]');
+ await clickOn('[data-tid=locationManagerMenuCloseAll]');
}
- // await global.client.pause(500);
- await clickOn(locationSelector);
- await clickOn('[data-tid=closeLocationTID]');
}
/**
diff --git a/tests/e2e/search.pw.e2e.js b/tests/e2e/search.pw.e2e.js
index 0e54bfd79..df9db6205 100644
--- a/tests/e2e/search.pw.e2e.js
+++ b/tests/e2e/search.pw.e2e.js
@@ -134,15 +134,15 @@ test.describe('TST06 - Test Search in file structure:', () => {
});*/
test('TST0621 - Search actions - open location [web,electron]', async () => {
- const lastLocationTID = await getPwLocationTid(-1);
- await closeLocation(lastLocationTID);
+ const firstLocationTID = await getPwLocationTid(0);
+ await closeLocation(); //lastLocationTID);
await expectElementExist('[data-tid=WelcomePanelTID]', true);
await searchEngine('l:', {}, false);
await clickOn('#textQuery-option-0');
await clickOn('[data-tid=folderContainerOpenDirMenu]');
await clickOn('[data-tid=showProperties]');
await expectElementExist(
- '[data-tid=OpenedTID' + lastLocationTID + ']',
+ '[data-tid=OpenedTID' + firstLocationTID + ']',
true
);
});