Add dendrite support to cypress tests (#9884)

* Minimum hacks required to run cypress tests with dendrite

* Remove wget hack since dendrite containers now have curl

* Add basic dendritedocker plugin & hack into login spec for testing

* Add generic HomeserverInstance interface

* Add env var to configure which homeserver to use

* Remove synapse specific homeserver support api

* Update the rest of the tests to use HomeserverInstance

* Update cypress docs to reference new homeserver abstraction

* Fix formatting issues

* Change dendrite to use main branch container
This commit is contained in:
devonh 2023-01-10 23:29:56 +00:00 committed by GitHub
parent b642df98e9
commit 79033eb034
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 947 additions and 362 deletions

View file

@ -16,10 +16,10 @@ limitations under the License.
/// <reference types="cypress" />
import { SynapseInstance } from "../../plugins/synapsedocker";
import { HomeserverInstance } from "../../plugins/utils/homeserver";
function seedLabs(synapse: SynapseInstance, labsVal: boolean | null): void {
cy.initTestUser(synapse, "Sally", () => {
function seedLabs(homeserver: HomeserverInstance, labsVal: boolean | null): void {
cy.initTestUser(homeserver, "Sally", () => {
// seed labs flag
cy.window({ log: false }).then((win) => {
if (typeof labsVal === "boolean") {
@ -61,30 +61,30 @@ describe("Hidden Read Receipts Setting Migration", () => {
// For a security-sensitive feature like hidden read receipts, it's absolutely vital
// that we migrate the setting appropriately.
let synapse: SynapseInstance;
let homeserver: HomeserverInstance;
beforeEach(() => {
cy.startSynapse("default").then((data) => {
synapse = data;
cy.startHomeserver("default").then((data) => {
homeserver = data;
});
});
afterEach(() => {
cy.stopSynapse(synapse);
cy.stopHomeserver(homeserver);
});
it("should not migrate the lack of a labs flag", () => {
seedLabs(synapse, null);
seedLabs(homeserver, null);
testForVal(null);
});
it("should migrate labsHiddenRR=false as sendRR=true", () => {
seedLabs(synapse, false);
seedLabs(homeserver, false);
testForVal(true);
});
it("should migrate labsHiddenRR=true as sendRR=false", () => {
seedLabs(synapse, true);
seedLabs(homeserver, true);
testForVal(false);
});
});