Triple the speed of E2E tests and stop them exploding if a circular datastructure is logged (#8095)

* stop e2e tests exploding if a circular datastructure is logged

it's valid for the webapp to log datastructures to the console which happen to be circular
but the e2e test running explodes badly with a runtime exception and bombs out before
logging anything or providing a sensible stacktrace. you can trap the exception though and
get a sensible error however.

* don't barf on circular refs in return vals either

and log timestamps

* log timestamps

* speed up roomDir & E2EE tests by 3x

use timeouts correctly, so the first set
of scenarios take 42s to run rather than 2m21s

* speed up space test by 20s
This commit is contained in:
Matthew Hodgson 2022-03-21 10:26:26 +00:00 committed by GitHub
parent 026ca1ab64
commit b8b5dd82aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 42 additions and 12 deletions

View file

@ -64,7 +64,9 @@ export async function inviteSpace(session: ElementSession, spaceName: string, us
await inviteButton.click();
try {
const button = await session.query('.mx_SpacePublicShare_inviteButton');
// You only get this interstitial if it's a public space, so give up after 200ms
// if it hasn't appeared
const button = await session.query('.mx_SpacePublicShare_inviteButton', 200);
await button.click();
} catch (e) {
// ignore

View file

@ -17,11 +17,14 @@ limitations under the License.
import { ElementSession } from "../session";
export async function openRoomRightPanel(session: ElementSession): Promise<void> {
try {
await session.query('.mx_RoomHeader .mx_RightPanel_headerButton_highlight[aria-label="Room Info"]');
} catch (e) {
// block until we have a roomSummaryButton
const roomSummaryButton = await session.query('.mx_RoomHeader .mx_AccessibleButton[aria-label="Room Info"]');
// check if it's highlighted
const highlightedRoomSummaryButton = await session.queryWithoutWaiting(
'.mx_RoomHeader .mx_RightPanel_headerButton_highlight[aria-label="Room Info"]',
);
if (!highlightedRoomSummaryButton) {
// If the room summary is not yet open, open it
const roomSummaryButton = await session.query('.mx_RoomHeader .mx_AccessibleButton[aria-label="Room Info"]');
await roomSummaryButton.click();
}
}

View file

@ -156,7 +156,8 @@ export async function checkRoomSettings(session: ElementSession, expectedSetting
async function getValidationError(session: ElementSession): Promise<string | undefined> {
try {
const validationDetail = await session.query(".mx_Validation_detail");
// give it 500ms to fail to produce a validation error
const validationDetail = await session.query(".mx_Validation_detail", 500);
return session.innerText(validationDetail);
} catch (e) {
// no validation tooltips