1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-03 00:33:22 +03:00

Improve cypress logging output (#10845)

... by grouping together the output from some custom commands.
This commit is contained in:
Richard van der Hoff
2023-05-11 11:46:50 +01:00
committed by GitHub
parent 2d58489309
commit 9aade5a4d5
3 changed files with 81 additions and 4 deletions

View File

@@ -18,6 +18,7 @@ limitations under the License.
import Chainable = Cypress.Chainable;
import { HomeserverInstance } from "../plugins/utils/homeserver";
import { collapseLastLogGroup } from "./log";
export interface UserCredentials {
accessToken: string;
@@ -100,6 +101,7 @@ Cypress.Commands.add(
prelaunchFn?: () => void,
userIdPrefix = "user_",
): Chainable<UserCredentials> => {
Cypress.log({ name: "initTestUser", groupStart: true });
// XXX: work around Cypress not clearing IDB between tests
cy.window({ log: false }).then((win) => {
win.indexedDB.databases()?.then((databases) => {
@@ -140,6 +142,13 @@ Cypress.Commands.add(
// wait for the app to load
return cy.get(".mx_MatrixChat", { timeout: 30000 });
})
.then(() => {
Cypress.log({
groupEnd: true,
emitOnly: true,
});
collapseLastLogGroup();
})
.then(() => ({
password,
username,