Move room directory Puppeteer tests over to Cypress (#8832)

* Fix user view percy test by sticking the user avatar colour

* Move room directory Puppeteer tests over to Cypress

* Consolidate import

* Fix tests

* Grab default widths

* Tweak Percy CSS mechanism
This commit is contained in:
Michael Telatynski 2022-06-13 19:25:39 +01:00 committed by GitHub
parent dfdba46d57
commit b03aa2ebf5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 150 additions and 58 deletions

View file

@ -18,7 +18,6 @@ limitations under the License.
import { range } from './util';
import { signup } from './usecases/signup';
import { toastScenarios } from './scenarios/toast';
import { roomDirectoryScenarios } from './scenarios/directory';
import { lazyLoadingScenarios } from './scenarios/lazy-loading';
import { e2eEncryptionScenarios } from './scenarios/e2e-encryption';
import { ElementSession } from "./session";
@ -45,7 +44,6 @@ export async function scenario(createSession: (s: string) => Promise<ElementSess
const bob = await createUser("bob");
await toastScenarios(alice, bob);
await roomDirectoryScenarios(alice, bob);
await e2eEncryptionScenarios(alice, bob);
console.log("create REST users:");
const charlies = await createRestUsers(restCreator);

View file

@ -1,46 +0,0 @@
/*
Copyright 2018 New Vector Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { join } from '../usecases/join';
import { sendMessage } from '../usecases/send-message';
import { receiveMessage } from '../usecases/timeline';
import { createRoom } from '../usecases/create-room';
import { changeRoomSettings, checkRoomSettings } from '../usecases/room-settings';
import { ElementSession } from "../session";
export async function roomDirectoryScenarios(alice: ElementSession, bob: ElementSession) {
console.log(" creating a public room and join through directory:");
const room = 'test';
await createRoom(alice, room);
const settings = {
directory: true,
visibility: "public",
alias: "#test:localhost",
publishedAlias: "#test:localhost",
};
await changeRoomSettings(alice, settings);
await join(bob, room); //looks up room in directory
await checkRoomSettings(bob, settings);
const bobMessage = "hi Alice!";
await sendMessage(bob, bobMessage);
await receiveMessage(alice, { sender: "bob", body: bobMessage });
const aliceMessage = "hi Bob, welcome!";
await sendMessage(alice, aliceMessage);
await receiveMessage(bob, { sender: "alice", body: aliceMessage });
}