TagSpaces is an offline, open source, document manager with tagging support
fix e2e exconfig.js for web tests
sytolkf066e3055fa1
diff --git a/playwright.config.common.js b/playwright.config.common.jsindex 0dd5a1c4e..e3e3cd94c 100644--- a/playwright.config.common.js+++ b/playwright.config.common.js@@ -13,7 +13,7 @@ const pwConfig = {ignoreSnapshots: !process.env.CI,retries: process.env.CI ? 3 : 0,// The maximum number of test failures for the whole test suite run. After reaching this number, testing will stop and exit with an error- maxFailures: process.env.CI ? 8 : 0,+ maxFailures: process.env.CI ? 20 : 0,globalSetup: './tests/global-setup.js',globalTeardown: './tests/global-teardown.js',/*use: {diff --git a/scripts/extconfig-demo-user.js b/scripts/extconfig-demo-user.jsindex 8ec96204e..01d8df910 100644--- a/scripts/extconfig-demo-user.js+++ b/scripts/extconfig-demo-user.js@@ -1,9 +1,4 @@-window.ExtLogoURL = 'assets/images/text-logo-dev.svg';-window.ExtShowAdvancedSearch = false;-window.ExtLightThemeLightColor = '#a6def4';-window.ExtLightThemeMainColor = '#3bc8ff';-window.ExtDarkThemeLightColor = '#a6def4';-window.ExtDarkThemeMainColor = '#3bc8ff';window.ExtIsFirstRun = false;+window.ExtCheckForUpdatesOnStartup = false;window.ExtUseGenerateThumbnails = true;window.ExtDemoUser = { email: '[email protected]' };diff --git a/scripts/extconfig-with-welcome.js b/scripts/extconfig-with-welcome.jsindex 758c7e496..b844fd99d 100644--- a/scripts/extconfig-with-welcome.js+++ b/scripts/extconfig-with-welcome.js@@ -1,10 +1,5 @@-window.ExtLogoURL = 'assets/images/text-logo-dev.svg';-window.ExtShowAdvancedSearch = false;-window.ExtLightThemeLightColor = '#a6def4';-window.ExtLightThemeMainColor = '#3bc8ff';-window.ExtDarkThemeLightColor = '#a6def4';-window.ExtDarkThemeMainColor = '#3bc8ff';window.ExtIsFirstRun = true;+window.ExtCheckForUpdatesOnStartup = false;window.ExtUseGenerateThumbnails = true;window.ExtLocations = [{@@ -23,7 +18,7 @@ window.ExtLocations = [watchForChanges: false // activates the watching for changed files in the current location}];-window.ExtSearches = [+/*window.ExtSearches = [{uuid: '16474266-0445-4f47-b092-25b884448d04', // an unique id of the searchtitle: 'search by tag 1star', // the name of the search@@ -42,4 +37,4 @@ window.ExtSearches = [maxSearchResults: 1000,forceIndexing: false}-];+];*/diff --git a/scripts/extconfig-without-locations.js b/scripts/extconfig-without-locations.jsindex b6400530f..3601c3849 100644--- a/scripts/extconfig-without-locations.js+++ b/scripts/extconfig-without-locations.js@@ -1,8 +1,3 @@-window.ExtLogoURL = 'assets/images/text-logo-dev.svg';-window.ExtShowAdvancedSearch = false;-window.ExtLightThemeLightColor = '#a6def4';-window.ExtLightThemeMainColor = '#3bc8ff';-window.ExtDarkThemeLightColor = '#a6def4';-window.ExtDarkThemeMainColor = '#3bc8ff';window.ExtIsFirstRun = false;+window.ExtCheckForUpdatesOnStartup = false;window.ExtUseGenerateThumbnails = true;diff --git a/scripts/extconfig.js b/scripts/extconfig.jsindex cb10d4147..512be84ef 100644--- a/scripts/extconfig.js+++ b/scripts/extconfig.js@@ -1,10 +1,5 @@-window.ExtLogoURL = 'assets/images/text-logo-dev.svg';-window.ExtShowAdvancedSearch = false;-window.ExtLightThemeLightColor = '#a6def4';-window.ExtLightThemeMainColor = '#3bc8ff';-window.ExtDarkThemeLightColor = '#a6def4';-window.ExtDarkThemeMainColor = '#3bc8ff';window.ExtIsFirstRun = false;+window.ExtCheckForUpdatesOnStartup = false;window.ExtUseGenerateThumbnails = true;window.ExtLocations = [{@@ -23,7 +18,7 @@ window.ExtLocations = [watchForChanges: false // activates the watching for changed files in the current location}];-window.ExtSearches = [+/*window.ExtSearches = [{uuid: '16474266-0445-4f47-b092-25b884448d04', // an unique id of the searchtitle: 'search by tag 1star', // the name of the search@@ -42,4 +37,4 @@ window.ExtSearches = [maxSearchResults: 1000,forceIndexing: false}-];+];*/diff --git a/scripts/webextconfig-demo-user.js b/scripts/webextconfig-demo-user.jsnew file mode 100644index 000000000..01d8df910--- /dev/null+++ b/scripts/webextconfig-demo-user.js@@ -0,0 +1,4 @@+window.ExtIsFirstRun = false;+window.ExtCheckForUpdatesOnStartup = false;+window.ExtUseGenerateThumbnails = true;+window.ExtDemoUser = { email: '[email protected]' };diff --git a/scripts/webextconfig-with-welcome.js b/scripts/webextconfig-with-welcome.jsnew file mode 100644index 000000000..84bb030ba--- /dev/null+++ b/scripts/webextconfig-with-welcome.js@@ -0,0 +1,41 @@+window.ExtIsFirstRun = true;+window.ExtCheckForUpdatesOnStartup = false;+window.ExtUseGenerateThumbnails = true;+window.ExtLocations = [+ {+ uuid: '30565f09-c7fd-2333-fc67-a75db27rt5ba', // an unique id of the location+ type: '1', // 1 defines the locations a cloud based+ name: 'supported-filestypes', // the name of the location+ path: '', // the path to sub folder in the location+ accessKeyId: 'minioadmin', // the access key of the user+ secretAccessKey: 'minioadmin', // the secret case of the user+ bucketName: 'supported-filestypes', // the name of the S3 bucket+ endpointURL: 'http://127.0.0.1:9000', // the name of the S3 bucket+ // region: 'eu-central-1', // the AWS region+ isDefault: false, // if true this location will be loaded by the application start+ isReadOnly: false, // if true the user interface of the application turns to read-only mode+ disableIndexing: false, // if true the search index will be persisted and loaded by default on location opening+ fullTextIndex: false, // activated the full-text search for TXT, MD and HTML files+ watchForChanges: false // activates the watching for changed files in the current location+ }+];+/*window.ExtSearches = [+ {+ uuid: '16474266-0445-4f47-b092-25b884448d04', // an unique id of the search+ title: 'search by tag 1star', // the name of the search+ tagsAND: [+ {+ id: '6040a658-5e95-44da-acd0-b48d7aade9ce',+ type: 'plain',+ title: '1star',+ color: '#ffcc24',+ textcolor: '#ffffff'+ }+ ], // the tagsAND+ searchBoxing: 'location',+ searchType: 'semistrict',+ fileTypes: ['files'],+ maxSearchResults: 1000,+ forceIndexing: false+ }+];*/diff --git a/scripts/webextconfig-without-locations.js b/scripts/webextconfig-without-locations.jsnew file mode 100644index 000000000..3601c3849--- /dev/null+++ b/scripts/webextconfig-without-locations.js@@ -0,0 +1,3 @@+window.ExtIsFirstRun = false;+window.ExtCheckForUpdatesOnStartup = false;+window.ExtUseGenerateThumbnails = true;diff --git a/scripts/webextconfig.js b/scripts/webextconfig.jsnew file mode 100644index 000000000..e5be28e58--- /dev/null+++ b/scripts/webextconfig.js@@ -0,0 +1,41 @@+window.ExtIsFirstRun = false;+window.ExtCheckForUpdatesOnStartup = false;+window.ExtUseGenerateThumbnails = true;+window.ExtLocations = [+ {+ uuid: '30565f09-c7fd-2333-fc67-a75db27rt5ba', // an unique id of the location+ type: '1', // 1 defines the locations a cloud based+ name: 'supported-filestypes', // the name of the location+ path: '', // the path to sub folder in the location+ accessKeyId: 'minioadmin', // the access key of the user+ secretAccessKey: 'minioadmin', // the secret case of the user+ bucketName: 'supported-filestypes', // the name of the S3 bucket+ endpointURL: 'http://127.0.0.1:9000', // the name of the S3 bucket+ // region: 'eu-central-1', // the AWS region+ isDefault: false, // if true this location will be loaded by the application start+ isReadOnly: false, // if true the user interface of the application turns to read-only mode+ disableIndexing: false, // if true the search index will be persisted and loaded by default on location opening+ fullTextIndex: false, // activated the full-text search for TXT, MD and HTML files+ watchForChanges: false // activates the watching for changed files in the current location+ }+];+/*window.ExtSearches = [+ {+ uuid: '16474266-0445-4f47-b092-25b884448d04', // an unique id of the search+ title: 'search by tag 1star', // the name of the search+ tagsAND: [+ {+ id: '6040a658-5e95-44da-acd0-b48d7aade9ce',+ type: 'plain',+ title: '1star',+ color: '#ffcc24',+ textcolor: '#ffffff'+ }+ ], // the tagsAND+ searchBoxing: 'location',+ searchType: 'semistrict',+ fileTypes: ['files'],+ maxSearchResults: 1000,+ forceIndexing: false+ }+];*/diff --git a/tests/e2e/hook.js b/tests/e2e/hook.jsindex 1a42929c7..6fa71486b 100644--- a/tests/e2e/hook.js+++ b/tests/e2e/hook.js@@ -63,13 +63,33 @@ export async function clearLocalStorage() {}export async function copyExtConfig(extconfig = 'extconfig-with-welcome.js') {- const srcDir = pathLib.join(__dirname, '..', '..', 'scripts', extconfig);- const destDir = pathLib.join(__dirname, '..', '..', 'app', 'extconfig.js');+ const srcDir = pathLib.join(+ __dirname,+ '..',+ '..',+ 'scripts',+ global.isWeb ? 'web' + extconfig : extconfig+ );+ const destDir = pathLib.join(+ __dirname,+ '..',+ '..',+ global.isWeb ? 'web' : 'app',+ 'extconfig.js'+ );await fse.copy(srcDir, destDir);}export async function removeExtConfig() {- await fse.remove(pathLib.join(__dirname, '..', '..', 'app', 'extconfig.js'));+ await fse.remove(+ pathLib.join(+ __dirname,+ '..',+ '..',+ global.isWeb ? 'web' : 'app',+ 'extconfig.js'+ )+ );}export async function startTestingApp(extconfig) {diff --git a/tests/e2e/location.helpers.js b/tests/e2e/location.helpers.jsindex 52bc001c2..58999d064 100644--- a/tests/e2e/location.helpers.js+++ b/tests/e2e/location.helpers.js@@ -17,16 +17,16 @@ export const defaultLocationPath =export const defaultLocationName = 'supported-filestypes';export const perspectiveGridTable = '//*[@data-tid="perspectiveGridFileTable"]';export const newLocationName = 'Location Name Changed';-const minioAccessKey = 'minioadmin';-const minioSecretAccessKey = 'minioadmin';-const minioEndpointURL = 'http://127.0.0.1:9000';+export const minioAccessKey = 'minioadmin';+export const minioSecretAccessKey = 'minioadmin';+export const minioEndpointURL = 'http://127.0.0.1:9000';export async function createPwMinioLocation(locationPath,locationName,isDefault = false) {- const lastLocationTID = global.isWeb ? undefined : await getPwLocationTid(-1);+ const lastLocationTID = await getPwLocationTid(-1);// Check if location not exist (from extconfig.js)if (locationName !== lastLocationTID) {await clickOn('[data-tid=locationManagerMenu]');