2022-02-09 12:57:19 +00:00
|
|
|
const Endpoints = require("./mocking/endpoints.js");
|
2021-12-21 07:59:11 +00:00
|
|
|
|
2022-02-09 12:57:19 +00:00
|
|
|
const browser = process.env.profile || "chromium";
|
|
|
|
const deviceType = process.env.DEVICE_TYPE || "desktop";
|
2021-12-21 07:59:11 +00:00
|
|
|
|
|
|
|
const isModel = !!process.env.MODEL;
|
|
|
|
|
|
|
|
const featureName = isModel
|
|
|
|
? `Login render on '${browser}' with '${deviceType}' dimension (model)`
|
|
|
|
: `Login render on '${browser}' with '${deviceType}' dimension`;
|
|
|
|
|
|
|
|
Feature(featureName);
|
|
|
|
|
|
|
|
// doing it before others scenario
|
|
|
|
Before(async ({ I }) => {
|
2022-02-09 12:57:19 +00:00
|
|
|
I.mockEndpoint(Endpoints.settings, "settings");
|
|
|
|
I.mockEndpoint(Endpoints.build, "build");
|
|
|
|
I.mockEndpoint(Endpoints.providers, "providers");
|
|
|
|
I.mockEndpoint(Endpoints.capabilities, "capabilities");
|
|
|
|
I.mockEndpoint(Endpoints.people, "");
|
|
|
|
I.amOnPage("/login");
|
2021-12-21 07:59:11 +00:00
|
|
|
I.wait(2);
|
|
|
|
});
|
|
|
|
|
2022-02-09 12:57:19 +00:00
|
|
|
Scenario("Login page components render test", async ({ I }) => {
|
|
|
|
I.see("Web Office");
|
2021-12-21 07:59:11 +00:00
|
|
|
I.seeElement({
|
2022-02-09 12:57:19 +00:00
|
|
|
react: "TextInput",
|
2021-12-21 07:59:11 +00:00
|
|
|
props: {
|
2022-02-09 12:57:19 +00:00
|
|
|
id: "login",
|
|
|
|
name: "login",
|
|
|
|
type: "email",
|
|
|
|
autoComplete: "username",
|
2021-12-21 07:59:11 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
I.seeElement({
|
2022-02-09 12:57:19 +00:00
|
|
|
react: "PasswordInput",
|
2021-12-21 07:59:11 +00:00
|
|
|
props: {
|
2022-02-09 12:57:19 +00:00
|
|
|
id: "password",
|
|
|
|
inputName: "password",
|
|
|
|
type: "password",
|
|
|
|
autoComplete: "current-password",
|
2021-12-21 07:59:11 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
I.seeElement({
|
2022-02-09 12:57:19 +00:00
|
|
|
react: "Checkbox",
|
2021-12-21 07:59:11 +00:00
|
|
|
props: {
|
2022-02-09 12:57:19 +00:00
|
|
|
className: "login-checkbox",
|
2021-12-21 07:59:11 +00:00
|
|
|
isChecked: false,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
I.seeElement({
|
2022-02-09 12:57:19 +00:00
|
|
|
react: "HelpButton",
|
2021-12-21 07:59:11 +00:00
|
|
|
props: {
|
2022-02-09 12:57:19 +00:00
|
|
|
className: "login-tooltip",
|
2021-12-21 07:59:11 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
I.seeElement({
|
2022-02-09 12:57:19 +00:00
|
|
|
react: "Link",
|
2021-12-21 07:59:11 +00:00
|
|
|
props: {
|
2022-02-09 12:57:19 +00:00
|
|
|
className: "login-link",
|
|
|
|
type: "page",
|
2021-12-21 07:59:11 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
I.seeElement({
|
2022-02-09 12:57:19 +00:00
|
|
|
react: "Button",
|
2021-12-21 07:59:11 +00:00
|
|
|
props: {
|
2022-02-09 12:57:19 +00:00
|
|
|
className: "login-button",
|
|
|
|
type: "page",
|
2021-12-21 07:59:11 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2022-02-09 12:57:19 +00:00
|
|
|
I.see("Sign in with Facebook");
|
|
|
|
I.see("Sign in with Google");
|
|
|
|
I.see("Sign in with LinkedIn");
|
2021-12-21 07:59:11 +00:00
|
|
|
|
2022-02-09 12:57:19 +00:00
|
|
|
I.see("Register");
|
2021-12-21 07:59:11 +00:00
|
|
|
|
|
|
|
I.saveScreenshot(`1.login-page-render.png`);
|
|
|
|
if (!isModel) {
|
|
|
|
I.seeVisualDiff(`1.login-page-render.png`, {
|
|
|
|
tolerance: 1,
|
2022-04-28 10:38:16 +00:00
|
|
|
prepareBaseImage: true,
|
2021-12-21 07:59:11 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2022-02-09 12:57:19 +00:00
|
|
|
Scenario("Reset mail tab render test", async ({ I }) => {
|
2021-12-21 07:59:11 +00:00
|
|
|
I.seeElement({
|
2022-02-09 12:57:19 +00:00
|
|
|
react: "Link",
|
2021-12-21 07:59:11 +00:00
|
|
|
props: {
|
2022-02-09 12:57:19 +00:00
|
|
|
className: "login-link",
|
|
|
|
type: "page",
|
2021-12-21 07:59:11 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2022-02-09 12:57:19 +00:00
|
|
|
I.click("Forgot your password?");
|
2021-12-21 07:59:11 +00:00
|
|
|
|
2022-02-09 12:57:19 +00:00
|
|
|
I.see("Password recovery");
|
2021-12-21 07:59:11 +00:00
|
|
|
I.see(
|
2022-02-09 12:57:19 +00:00
|
|
|
"Please, enter the email you used for registration. The password recovery instructions will be sent to it."
|
2021-12-21 07:59:11 +00:00
|
|
|
);
|
|
|
|
I.seeElement({
|
2022-02-09 12:57:19 +00:00
|
|
|
react: "TextInput",
|
2021-12-21 07:59:11 +00:00
|
|
|
});
|
2022-02-09 12:57:19 +00:00
|
|
|
I.see("Send");
|
2021-12-21 07:59:11 +00:00
|
|
|
|
|
|
|
I.saveScreenshot(`2.reset-mail-tab.png`);
|
|
|
|
if (!isModel) {
|
|
|
|
I.seeVisualDiff(`2.reset-mail-tab.png`, {
|
|
|
|
tolerance: 1,
|
2022-04-28 10:38:16 +00:00
|
|
|
prepareBaseImage: true,
|
2021-12-21 07:59:11 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2022-02-10 14:17:13 +00:00
|
|
|
//TODO: check help button test on mobile chromium/ff
|
|
|
|
if (browser === "webkit" || deviceType === "desktop") {
|
|
|
|
Scenario("Help button modal render test", async ({ I }) => {
|
|
|
|
I.seeElement({
|
|
|
|
react: "HelpButton",
|
|
|
|
props: {
|
|
|
|
className: "login-tooltip",
|
|
|
|
},
|
|
|
|
});
|
2021-12-21 07:59:11 +00:00
|
|
|
|
2022-02-10 14:17:13 +00:00
|
|
|
I.click({
|
|
|
|
react: "HelpButton",
|
|
|
|
props: {
|
|
|
|
className: "login-tooltip",
|
|
|
|
},
|
2021-12-21 07:59:11 +00:00
|
|
|
});
|
2022-02-10 14:17:13 +00:00
|
|
|
I.see(
|
|
|
|
"The default session lifetime is 20 minutes. Check this option to set it to 1 year. To set your own value, go to Settings."
|
|
|
|
);
|
|
|
|
|
2022-04-28 10:38:16 +00:00
|
|
|
I.saveScreenshot(`3.help-button-modal.png`);
|
2022-02-10 14:17:13 +00:00
|
|
|
if (!isModel) {
|
2022-04-28 10:38:16 +00:00
|
|
|
I.seeVisualDiff(`3.help-button-modal.png`, {
|
2022-02-10 14:17:13 +00:00
|
|
|
tolerance: 1,
|
2022-04-28 10:38:16 +00:00
|
|
|
prepareBaseImage: true,
|
2022-02-10 14:17:13 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2022-02-09 12:57:19 +00:00
|
|
|
|
2022-04-28 10:38:16 +00:00
|
|
|
Scenario("Modal - Password recovery test", async ({ I }) => {
|
2022-02-09 12:57:19 +00:00
|
|
|
I.seeElement({
|
|
|
|
react: "Link",
|
|
|
|
props: {
|
2022-04-28 10:38:16 +00:00
|
|
|
className: "login-link",
|
2022-02-09 12:57:19 +00:00
|
|
|
},
|
|
|
|
});
|
2022-04-28 10:38:16 +00:00
|
|
|
|
2022-02-09 12:57:19 +00:00
|
|
|
I.click({
|
2022-04-28 10:38:16 +00:00
|
|
|
react: "Link",
|
|
|
|
props: {
|
|
|
|
className: "login-link",
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
I.wait(2);
|
|
|
|
|
|
|
|
I.see("Password recovery");
|
|
|
|
I.see(
|
|
|
|
"Please, enter the email you used for registration. The password recovery instructions will be sent to it."
|
|
|
|
);
|
|
|
|
I.seeElement({
|
|
|
|
react: "EmailInput",
|
|
|
|
});
|
|
|
|
I.see("Send");
|
|
|
|
I.see("Cancel");
|
|
|
|
|
|
|
|
I.saveScreenshot(`4.modal-password-recovery.png`);
|
|
|
|
if (!isModel) {
|
|
|
|
I.seeVisualDiff(`4.modal-password-recovery.png`, {
|
|
|
|
tolerance: 1,
|
|
|
|
prepareBaseImage: true,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
Scenario("Modal - Registration test", async ({ I }) => {
|
|
|
|
I.click({
|
|
|
|
react: "Register",
|
|
|
|
});
|
|
|
|
|
|
|
|
I.wait(2);
|
|
|
|
|
|
|
|
I.see("Registration request");
|
|
|
|
I.seeElement({
|
|
|
|
react: "EmailInput",
|
|
|
|
});
|
|
|
|
I.see("Send request");
|
|
|
|
I.see("Cancel");
|
|
|
|
|
|
|
|
I.saveScreenshot(`5.modal-registration-request.png`);
|
|
|
|
if (!isModel) {
|
|
|
|
I.seeVisualDiff(`6.modal-registration-request.png`, {
|
|
|
|
tolerance: 1,
|
|
|
|
prepareBaseImage: true,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
Scenario("Modal - Authorization test", async ({ I }) => {
|
|
|
|
I.seeElement({
|
2022-02-09 12:57:19 +00:00
|
|
|
react: "Link",
|
|
|
|
props: {
|
|
|
|
className: "more-label",
|
|
|
|
},
|
|
|
|
});
|
2022-04-28 10:38:16 +00:00
|
|
|
I.click("Show more");
|
2022-02-09 12:57:19 +00:00
|
|
|
|
2022-02-28 13:16:30 +00:00
|
|
|
I.wait(2);
|
|
|
|
|
2022-02-09 12:57:19 +00:00
|
|
|
I.see("Authorization");
|
|
|
|
I.see("Sign in with SSO");
|
|
|
|
I.see("Sign in with Google");
|
|
|
|
I.see("Sign in with Facebook");
|
|
|
|
I.see("Sign in with LinkedIn");
|
|
|
|
|
2022-04-28 10:38:16 +00:00
|
|
|
I.saveScreenshot(`7.modal-authorization.png`);
|
2022-02-09 12:57:19 +00:00
|
|
|
if (!isModel) {
|
2022-04-28 10:38:16 +00:00
|
|
|
I.seeVisualDiff(`7.modal-authorization.png`, {
|
2022-02-09 12:57:19 +00:00
|
|
|
tolerance: 1,
|
2022-04-28 10:38:16 +00:00
|
|
|
prepareBaseImage: true,
|
2022-02-09 12:57:19 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|