test(e2e): add for onboarding and lldap authorization (#1834)
* test(e2e): add for onboarding and lldap authorization * ci: add playwright chrome installation to e2e test * fix(e2e): timeout between lldap login redirect to short * test(e2e): add oidc azure test * fix(e2e): lldap test fails * wip: add temporary error log for failed ldap server connection * fix(e2e): github actions don't support host.docker.internal * chore: address pull request feedback * refactor(e2e): move onboarding steps to onboarding actions and assertions * fix(e2e): increase timeout for navigating back from azure login * fix: wait for url network changed error * fix: revert to wait for url * fix(e2e): remove oidc test * refactor(e2e): remove env validation * ci: remove azure oidc env variables
This commit is contained in:
@@ -1,18 +1,43 @@
|
||||
import { GenericContainer, Wait } from "testcontainers";
|
||||
import { Environment } from "testcontainers/build/types";
|
||||
|
||||
export const createHomarrContainer = () => {
|
||||
export const createHomarrContainer = (
|
||||
options: {
|
||||
environment?: Environment;
|
||||
mounts?: {
|
||||
"/appdata"?: string;
|
||||
"/var/run/docker.sock"?: string;
|
||||
};
|
||||
} = {},
|
||||
) => {
|
||||
if (!process.env.CI) {
|
||||
throw new Error("This test should only be run in CI or with a homarr image named 'homarr-e2e'");
|
||||
}
|
||||
|
||||
return withLogs(
|
||||
new GenericContainer("homarr-e2e")
|
||||
.withExposedPorts(7575)
|
||||
.withEnvironment({
|
||||
SECRET_ENCRYPTION_KEY: "0".repeat(64),
|
||||
})
|
||||
.withWaitStrategy(Wait.forHttp("/api/health/ready", 7575)),
|
||||
);
|
||||
const container = new GenericContainer("homarr-e2e")
|
||||
.withExposedPorts(7575)
|
||||
.withEnvironment({
|
||||
...options.environment,
|
||||
SECRET_ENCRYPTION_KEY: "0".repeat(64),
|
||||
})
|
||||
.withBindMounts(
|
||||
Object.entries(options.mounts ?? {})
|
||||
.filter((item) => item?.[0] !== undefined)
|
||||
.map(([container, local]) => ({
|
||||
source: local,
|
||||
target: container,
|
||||
})),
|
||||
)
|
||||
.withWaitStrategy(Wait.forHttp("/api/health/ready", 7575))
|
||||
.withExtraHosts([
|
||||
{
|
||||
// This enabled the usage of host.docker.internal as hostname in the container
|
||||
host: "host.docker.internal",
|
||||
ipAddress: "host-gateway",
|
||||
},
|
||||
]);
|
||||
|
||||
return withLogs(container);
|
||||
};
|
||||
|
||||
export const withLogs = (container: GenericContainer) => {
|
||||
|
||||
Reference in New Issue
Block a user