Cypress: skip tests known to fail when using Rust crypto (#10873)
* Cypress: skip tests known to fail when using Rust crypto ... which means we can then run the cypress test suite against Element Web R to check we aren't introducing regressions. * Update cypress/e2e/register/register.spec.ts * Use env var to detect rust crypto * Hoist `skipIfRustCrypto` call earlier
This commit is contained in:
@@ -20,6 +20,8 @@ limitations under the License.
|
||||
* we make requests to the live `matrix.org`, which makes our tests dependent on matrix.org being up and responsive.
|
||||
*/
|
||||
|
||||
import { isRustCryptoEnabled } from "./util";
|
||||
|
||||
const CONFIG_JSON = {
|
||||
// This is deliberately quite a minimal config.json, so that we can test that the default settings
|
||||
// actually work.
|
||||
@@ -40,7 +42,7 @@ beforeEach(() => {
|
||||
const configJson = CONFIG_JSON;
|
||||
|
||||
// configure element to use rust crypto if the env var tells us so
|
||||
if (Cypress.env("RUST_CRYPTO")) {
|
||||
if (isRustCryptoEnabled()) {
|
||||
configJson["features"] = {
|
||||
feature_rust_crypto: true,
|
||||
};
|
||||
|
||||
+17
-2
@@ -56,5 +56,20 @@ cy.all = function all(commands): Cypress.Chainable {
|
||||
return cy.wrap(resultArray, { log: false });
|
||||
};
|
||||
|
||||
// Needed to make this file a module
|
||||
export {};
|
||||
/**
|
||||
* Check if Cypress has been configured to enable rust crypto, and bail out if so.
|
||||
*/
|
||||
export function skipIfRustCrypto() {
|
||||
if (isRustCryptoEnabled()) {
|
||||
cy.log("Skipping due to rust crypto");
|
||||
//@ts-ignore: 'state' is a secret internal command
|
||||
cy.state("runnable").skip();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if Cypress has been configured to enable rust crypto (by checking the environment variable)
|
||||
*/
|
||||
export function isRustCryptoEnabled(): boolean {
|
||||
return !!Cypress.env("RUST_CRYPTO");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user