DocSpace-client/web/ASC.Web.Client/tests/render_tests.js

41 lines
939 B
JavaScript
Raw Normal View History

const Endpoints = require("./mocking/endpoints.js");
2022-02-14 12:06:27 +00:00
const browser = process.env.profile || "chromium";
const deviceType = process.env.DEVICE_TYPE || "desktop";
const isModel = !!process.env.MODEL;
const featureName = isModel
? `Client render on '${browser}' with '${deviceType}' dimension (model)`
: `Client render on '${browser}' with '${deviceType}' dimension`;
Feature(featureName);
Scenario("TfaAuth page render test", async ({ I }) => {
I.mockEndpoint(Endpoints.confirm, "confirm");
I.amOnPage(
"/confirm/TfaAuth?type=TfaAuth&key=EXAMPLEKEY1&email=test%40example.com"
);
2022-02-14 12:06:27 +00:00
I.see("Enter code from authentication app");
I.seeElement({
react: "TextInput",
props: {
id: "code",
},
});
I.seeElement({
react: "Button",
});
I.saveScreenshot(`1.tfa-auth.png`);
if (!isModel) {
I.seeVisualDiff(`1.tfa-auth.png`, {
tolerance: 1,
prepareBaseImage: false,
});
}
});