Skip to content

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

add localStorage to failed tests

sytolkf44a30b339f6
diff --git a/tests/e2e/hook.js b/tests/e2e/hook.js
index 08313a286..05afa801e 100644
--- a/tests/e2e/hook.js
+++ b/tests/e2e/hook.js
@@ -15,6 +15,9 @@ export const delay = time => new Promise(resolve => setTimeout(resolve, time));
export const getRandomInt = (min, max) =>
Math.floor(Math.random() * (max - min + 1)) + min;
+export function writeFile(filePath, fileContent) {
+ fse.writeFileSync(filePath, fileContent);
+}
// use this pause only for visual debuging on places where you want to see the result after a given operation
// global.msDebugPause = 0;
diff --git a/tests/e2e/search.pw.e2e.js b/tests/e2e/search.pw.e2e.js
index c590bd140..efd0eb28b 100644
--- a/tests/e2e/search.pw.e2e.js
+++ b/tests/e2e/search.pw.e2e.js
@@ -11,7 +11,8 @@ import {
createEmptyFile,
startTestingApp,
stopApp,
- testDataRefresh
+ testDataRefresh,
+ writeFile
} from './hook';
import {
closeFileProperties,
@@ -48,6 +49,13 @@ test.afterAll(async () => {
test.afterEach(async ({ page }, testInfo) => {
if (testInfo.status !== testInfo.expectedStatus) {
await takeScreenshot(testInfo);
+ const localStorage = await global.client.evaluate(() =>
+ JSON.stringify(window.localStorage)
+ );
+ writeFile(
+ testInfo.outputPath(testInfo.title + '_localstorage.json'),
+ localStorage
+ );
}
await clearDataStorage();
});
@@ -256,7 +264,11 @@ test.describe('TST06 - Test Search in file structure:', () => {
await clickOn('#textQuery-option-0');
await global.client.keyboard.press('Enter');
await global.client.keyboard.press('Enter');
- await expectElementExist(getGridFileSelector('empty_file.html'), true, 5000);
+ await expectElementExist(
+ getGridFileSelector('empty_file.html'),
+ true,
+ 5000
+ );
});
test('TST0630 - Search q. comp - type [web,electron]', async () => {