Playwright: Convert sliding-sync test to playwright (#11989)

* Add method to send text message

* Add dockerUrl to HomeServerConfig

* Implement sliding sync proxy

* Convert tests

* Reload page after applying labs feature

* Remove converted files

* Remove timeout

* Remove sliding-sync

* Remove proxy import

* Remove reference to proxy

* wait for load

* Update date

* Convert enableLabsFeature to separate fixture

* Enable feature in fixture

* Skip over config and just write to local-storage

* Rename fixture

* Fix room header test

* Use type inference

* Override config instead of setting localstorage

* Set default language

* Always add labs feature

* Put this one test into a separate describe block

* Move labs lag within describe block
This commit is contained in:
R Midhun Suresh
2023-12-16 10:01:26 +00:00
committed by GitHub
parent de5931d5a8
commit 7b3d5b5f21
16 changed files with 547 additions and 770 deletions
@@ -74,9 +74,11 @@ export class Dendrite extends Synapse implements Homeserver, HomeserverInstance
"http://localhost:8008/_matrix/client/versions",
]);
const dockerUrl = `http://${await this.docker.getContainerIp()}:8008`;
this.config = {
...denCfg,
serverId: dendriteId,
dockerUrl,
};
return this;
}
@@ -107,7 +109,10 @@ export class Pinecone extends Dendrite {
protected entrypoint = "/usr/bin/dendrite-demo-pinecone";
}
async function cfgDirFromTemplate(dendriteImage: string, opts: StartHomeserverOpts): Promise<HomeserverConfig> {
async function cfgDirFromTemplate(
dendriteImage: string,
opts: StartHomeserverOpts,
): Promise<Omit<HomeserverConfig, "dockerUrl">> {
const template = "default"; // XXX: for now we only have one template
const templateDir = path.join(__dirname, "templates", template);
+1
View File
@@ -19,6 +19,7 @@ export interface HomeserverConfig {
readonly baseUrl: string;
readonly port: number;
readonly registrationSecret: string;
readonly dockerUrl: string;
}
export interface HomeserverInstance {
@@ -25,7 +25,7 @@ import { Docker } from "../../docker";
import { HomeserverConfig, HomeserverInstance, Homeserver, StartHomeserverOpts, Credentials } from "..";
import { randB64Bytes } from "../../utils/rand";
async function cfgDirFromTemplate(opts: StartHomeserverOpts): Promise<HomeserverConfig> {
async function cfgDirFromTemplate(opts: StartHomeserverOpts): Promise<Omit<HomeserverConfig, "dockerUrl">> {
const templateDir = path.join(__dirname, "templates", opts.template);
const stats = await fse.stat(templateDir);
@@ -146,10 +146,11 @@ export class Synapse implements Homeserver, HomeserverInstance {
"--silent",
"http://localhost:8008/health",
]);
const dockerUrl = `http://${await this.docker.getContainerIp()}:8008`;
this.config = {
...synCfg,
serverId: synapseId,
dockerUrl,
};
return this;
}