should fix admin e2e test
This commit is contained in:
parent
0b27da21ac
commit
ab34412a2e
4 changed files with 17 additions and 15 deletions
|
|
@ -39,6 +39,8 @@ services:
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
retries: 60
|
retries: 60
|
||||||
|
ports:
|
||||||
|
- 4000:4000
|
||||||
|
|
||||||
e2e:
|
e2e:
|
||||||
build:
|
build:
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,7 @@ export const promisedRequest = async ({
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
if (error.name === 'StatusCodeError') throw error
|
||||||
throw new Error(error, { url, options }, response)
|
throw new Error(error, { url, options }, response)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,22 +87,19 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
|
||||||
loadAdminStuff() {
|
loadAdminStuff() {
|
||||||
getInstanceDBConfig({
|
getInstanceDBConfig({
|
||||||
credentials: useOAuthStore().token,
|
credentials: useOAuthStore().token,
|
||||||
}).then(({ data: backendDbConfig }) => {
|
})
|
||||||
if (backendDbConfig.error) {
|
.then(({ data: backendDbConfig }) =>
|
||||||
if (backendDbConfig.error.status === 400) {
|
|
||||||
backendDbConfig.error.json().then((errorJson) => {
|
|
||||||
if (/configurable_from_database/.test(errorJson.error)) {
|
|
||||||
this.setInstanceAdminNoDbConfig()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.setInstanceAdminSettings({
|
this.setInstanceAdminSettings({
|
||||||
credentials: useOAuthStore().token,
|
credentials: useOAuthStore().token,
|
||||||
backendDbConfig,
|
backendDbConfig,
|
||||||
})
|
}))
|
||||||
}
|
.catch(({ statusCode, statusText }) => {
|
||||||
})
|
if (statusCode === 400) {
|
||||||
|
if (/configurable_from_database/.test(statusText)) {
|
||||||
|
this.setInstanceAdminNoDbConfig()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
if (this.descriptions === null) {
|
if (this.descriptions === null) {
|
||||||
getInstanceConfigDescriptions({
|
getInstanceConfigDescriptions({
|
||||||
credentials: useOAuthStore().token,
|
credentials: useOAuthStore().token,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/* global process */
|
/* global process */
|
||||||
import { defineConfig, devices } from 'playwright/test'
|
import { defineConfig, devices } from 'playwright/test'
|
||||||
|
|
||||||
const baseURL = process.env.E2E_BASE_URL || 'http://localhost:8080'
|
const baseURL = process.env.E2E_BASE_URL || 'http://localhost:8099'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
testDir: './specs',
|
testDir: './specs',
|
||||||
|
|
@ -25,12 +25,14 @@ export default defineConfig({
|
||||||
video: 'retain-on-failure',
|
video: 'retain-on-failure',
|
||||||
},
|
},
|
||||||
webServer: {
|
webServer: {
|
||||||
command: 'yarn dev -- --host 0.0.0.0 --port 8080 --strictPort',
|
command: 'yarn dev -- --host 0.0.0.0 --strictPort',
|
||||||
url: baseURL,
|
url: baseURL,
|
||||||
reuseExistingServer: !process.env.CI,
|
reuseExistingServer: !process.env.CI,
|
||||||
timeout: 120_000,
|
timeout: 120_000,
|
||||||
env: {
|
env: {
|
||||||
...process.env,
|
...process.env,
|
||||||
|
PORT:
|
||||||
|
process.env.PORT || '8099',
|
||||||
VITE_PROXY_TARGET:
|
VITE_PROXY_TARGET:
|
||||||
process.env.VITE_PROXY_TARGET || 'http://localhost:4000',
|
process.env.VITE_PROXY_TARGET || 'http://localhost:4000',
|
||||||
VITE_PROXY_ORIGIN:
|
VITE_PROXY_ORIGIN:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue