-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support specifying the config location manually (outside of the user'…
…s profile) (#1921) * Add support for loading the config from a given config location. * Support using an env variable too. * Add docs. * Add test for configuration arguments * remove .only
- Loading branch information
Showing
5 changed files
with
80 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
Copyright 2024 New Vector Ltd. | ||
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only | ||
Please see LICENSE files in the repository root for full details. | ||
*/ | ||
|
||
import { resolve } from "node:path"; | ||
|
||
import { test, expect } from "../../element-desktop-test"; | ||
|
||
test.describe("App config options", () => { | ||
test.describe("Should load custom config via env", () => { | ||
test.slow(); | ||
test.use({ | ||
extraEnv: { | ||
ELEMENT_DESKTOP_CONFIG_JSON: resolve(__dirname, "../..", "fixtures/custom-config.json"), | ||
}, | ||
}); | ||
test("should launch and use configured homeserver", async ({ page }) => { | ||
await page.locator("#matrixchat").waitFor(); | ||
await page.locator(".mx_Welcome").waitFor(); | ||
await expect(page).toHaveURL("vector://vector/webapp/#/welcome"); | ||
await page.getByText("Sign in").click(); | ||
await page.getByText("matrix.example.org", { exact: true }).waitFor(); | ||
}); | ||
}); | ||
test.describe("Should load custom config via argument", () => { | ||
test.slow(); | ||
test.use({ | ||
extraArgs: ["--config", resolve(__dirname, "../..", "fixtures/custom-config.json")], | ||
}); | ||
test("should launch and use configured homeserver", async ({ page }) => { | ||
await page.locator("#matrixchat").waitFor(); | ||
await page.locator(".mx_Welcome").waitFor(); | ||
await expect(page).toHaveURL("vector://vector/webapp/#/welcome"); | ||
await page.getByText("Sign in").click(); | ||
await page.getByText("matrix.example.org", { exact: true }).waitFor(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"default_server_config": { | ||
"m.homeserver": { | ||
"base_url": "https://matrix.example.org" | ||
}, | ||
"m.identity_server": { | ||
"base_url": "https://identity.example.org" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters