TagSpaces is an offline, open source, document manager with tagging support
Test extconfig fixes (#1267)
Stanimir92d3fc97f393
diff --git a/tests/e2e/general.helpers.js b/tests/e2e/general.helpers.jsindex b7769f7c3..a85f515ab 100644--- a/tests/e2e/general.helpers.js+++ b/tests/e2e/general.helpers.js@@ -30,6 +30,32 @@ export async function clickOn(selector, options = {}) {await element.click(options);}+/**+ *+ * @param selector+ * @param className+ * @returns {Promise<void>} newClassName+ */+export async function waitUntilClassChanged(selector, className) {+ const element = await global.client.$(selector);+ await element.waitUntil(+ async function() {+ const newClassName = await this.getAttribute('class');+ return newClassName !== className;+ },+ {+ timeout: 5000,+ timeoutMsg:+ 'waitUntilClassChanged selector ' ++ selector ++ ' className:' ++ className ++ ' to changed after 5s'+ }+ );+ return await element.getAttribute('class');+}+export async function doubleClickOn(selector) {const element = await global.client.$(selector);await element.waitUntil(@@ -192,6 +218,7 @@ export async function expectElementExist(selector, exist = true) {});expect(await element.isDisplayedInViewport()).toBe(exist);+ return element;}export async function createLocation(diff --git a/tests/e2e/perspective-grid.e2e.js b/tests/e2e/perspective-grid.e2e.jsindex 7a2c48f73..fa166c70d 100644--- a/tests/e2e/perspective-grid.e2e.js+++ b/tests/e2e/perspective-grid.e2e.js@@ -29,7 +29,8 @@ import {getGridFileName,selectorFile,selectorFolder,- setInputKeys+ setInputKeys,+ waitUntilClassChanged} from './general.helpers';const subFolderName = '/test-perspective-grid';@@ -139,8 +140,13 @@ describe('TST50 - Perspective Grid', () => {//SelectAllFilesawait clickOn('[data-tid=gridPerspectiveSelectAllFiles]');- await global.client.pause(500); // TODO- const classSelected = await getGridCellClass(0);++ const classSelected = await waitUntilClassChanged(+ perspectiveGridTable + firstFile + '/div/div',+ classNotSelected+ );+ // await global.client.pause(1000); // TODO+ // const classSelected = await getGridCellClass(0);expect(classNotSelected).not.toBe(classSelected);const filesList = await global.client.$$(perspectiveGridTable + firstFile);@@ -310,12 +316,15 @@ describe('TST50** - Right button on a file', () => {);// Check if the file is opened// await delay(1500);- const webViewer = await global.client.$('#FileViewer');- await webViewer.waitForDisplayed();+ const webViewer = await expectElementExist('#FileViewer');+ // const webViewer = await global.client.$('#FileViewer');+ // await webViewer.waitForDisplayed();//await delay(5000);- expect(await webViewer.isDisplayed()).toBe(true);+ // expect(await webViewer.isDisplayed()).toBe(true);await global.client.switchToFrame(webViewer);+ await global.client.pause(500);const iframeBody = await global.client.$('body');+ await iframeBody.waitForDisplayed();const bodyTxt = await iframeBody.getText();await global.client.switchToParentFrame();