65 lines
1.6 KiB
JavaScript
65 lines
1.6 KiB
JavaScript
const Endpoints = require("./mocking/endpoints.js");
|
|
|
|
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"
|
|
);
|
|
|
|
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,
|
|
});
|
|
}
|
|
});
|
|
|
|
Scenario("Profile Remove page render test", async ({ I }) => {
|
|
I.mockEndpoint(Endpoints.settings, "settings");
|
|
I.mockEndpoint(Endpoints.confirm, "confirm");
|
|
I.amOnPage(
|
|
"/confirm/ProfileRemove?type=ProfileRemove&key=EXAMPLEKEY1&email=test%40example.com&uid=EXAMPLEUID"
|
|
);
|
|
|
|
I.see("Web Office");
|
|
I.see("Attention! You are about to delete your account.");
|
|
I.see('By clicking "Delete my account" you agree with our Privacy policy.');
|
|
|
|
I.seeElement({
|
|
react: "Button",
|
|
});
|
|
|
|
I.saveScreenshot(`2.profile-remove.png`);
|
|
if (!isModel) {
|
|
I.seeVisualDiff(`2.profile-remove.png`, {
|
|
tolerance: 1,
|
|
prepareBaseImage: false,
|
|
});
|
|
}
|
|
});
|