2022-02-18 11:03:55 +00:00
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 } ) => {
2022-02-18 11:03:55 +00:00
I . mockEndpoint ( Endpoints . confirm , "confirm" ) ;
2022-02-22 11:34:45 +00:00
I . amOnPage ( "/confirm/TfaAuth" ) ;
2022-02-18 11:03:55 +00:00
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 ,
} ) ;
}
} ) ;
2022-02-18 14:55:15 +00:00
Scenario ( "Profile Remove page render test" , async ( { I } ) => {
I . mockEndpoint ( Endpoints . settings , "settings" ) ;
I . mockEndpoint ( Endpoints . confirm , "confirm" ) ;
2022-02-22 11:34:45 +00:00
I . amOnPage ( "/confirm/ProfileRemove" ) ;
2022-02-18 14:55:15 +00:00
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 ,
} ) ;
}
} ) ;
2022-02-21 19:01:36 +00:00
Scenario ( "Change phone page render test" , async ( { I } ) => {
I . mockEndpoint ( Endpoints . settings , "settings" ) ;
I . mockEndpoint ( Endpoints . confirm , "confirm" ) ;
2022-02-22 11:34:45 +00:00
I . amOnPage ( "/confirm/PhoneActivation" ) ;
2022-02-21 19:01:36 +00:00
I . see ( "Enter mobile phone number" ) ;
I . seeElement ( {
react : "TextInput" ,
} ) ;
I . seeElement ( {
react : "Button" ,
} ) ;
I . saveScreenshot ( ` 3.change-phone.png ` ) ;
if ( ! isModel ) {
I . seeVisualDiff ( ` 3.change-phone.png ` , {
tolerance : 1 ,
prepareBaseImage : false ,
} ) ;
}
} ) ;
2022-02-21 19:12:45 +00:00
Scenario ( "Create user page render test" , async ( { I } ) => {
2022-03-18 20:40:24 +00:00
I . mockEndpoint ( Endpoints . confirm , "confirm" ) ;
2022-02-21 19:12:45 +00:00
I . mockEndpoint ( Endpoints . settings , "settings" ) ;
I . mockEndpoint ( Endpoints . build , "build" ) ;
2022-03-18 20:40:24 +00:00
I . mockEndpoint ( Endpoints . settings , "settings" ) ;
2022-02-21 19:12:45 +00:00
I . mockEndpoint ( Endpoints . password , "password" ) ;
2022-03-18 20:40:24 +00:00
I . mockEndpoint ( Endpoints . user , "user" ) ;
2022-02-21 19:12:45 +00:00
I . mockEndpoint ( Endpoints . providers , "providers" ) ;
2022-03-18 20:40:24 +00:00
I . mockEndpoint ( Endpoints . capabilities , "capabilities" ) ;
2022-02-21 19:12:45 +00:00
2022-03-18 20:40:24 +00:00
I . amOnPage ( "/confirm/LinkInvite?type=LinkInvite&key=KEY&uid=user&emplType=1" ) ;
2022-02-21 19:12:45 +00:00
I . see ( "Web Office" ) ;
2022-03-18 20:50:28 +00:00
I . see ( "Test Test" ) ;
2022-03-18 20:40:24 +00:00
I . seeElement ( {
react : "SocialButton" ,
} ) ;
2022-03-18 20:50:28 +00:00
if ( deviceType === "desktop" ) {
I . seeElement ( {
react : "EmailInput" ,
} ) ;
2022-03-18 20:40:24 +00:00
2022-03-18 20:50:28 +00:00
I . seeElement ( {
react : "TextInput" ,
props : {
name : "first-name" ,
} ,
} ) ;
2022-03-18 20:40:24 +00:00
2022-03-18 20:50:28 +00:00
I . seeElement ( {
react : "TextInput" ,
props : {
name : "last-name" ,
} ,
} ) ;
2022-03-18 20:40:24 +00:00
2022-03-18 20:50:28 +00:00
I . seeElement ( {
react : "PasswordInput" ,
} ) ;
}
2022-03-18 20:40:24 +00:00
I . seeElement ( {
react : "Button" ,
} ) ;
2022-02-21 19:12:45 +00:00
I . saveScreenshot ( ` 4.create-user.png ` ) ;
if ( ! isModel ) {
I . seeVisualDiff ( ` 4.create-user.png ` , {
tolerance : 1 ,
prepareBaseImage : false ,
} ) ;
}
} ) ;
2022-02-21 19:20:08 +00:00
Scenario ( "Change owner page render test" , async ( { I } ) => {
I . mockEndpoint ( Endpoints . settings , "settings" ) ;
I . mockEndpoint ( Endpoints . confirm , "confirm" ) ;
I . amOnPage ( "/confirm/PortalOwnerChange" ) ;
I . see ( "Web Office" ) ;
I . see ( "Please confirm that you want to change portal owner" ) ;
I . seeElement ( {
react : "Button" ,
} ) ;
I . seeElement ( {
react : "Button" ,
} ) ;
I . saveScreenshot ( ` 5.change-owner.png ` ) ;
if ( ! isModel ) {
I . seeVisualDiff ( ` 5.change-owner.png ` , {
tolerance : 1 ,
prepareBaseImage : false ,
} ) ;
}
} ) ;
2022-02-21 19:43:22 +00:00
Scenario ( "Activate user page render test" , async ( { I } ) => {
I . mockEndpoint ( Endpoints . settings , "settings" ) ;
I . mockEndpoint ( Endpoints . build , "build" ) ;
I . mockEndpoint ( Endpoints . password , "password" ) ;
I . mockEndpoint ( Endpoints . providers , "providers" ) ;
I . mockEndpoint ( Endpoints . confirm , "confirm" ) ;
I . amOnPage ( "/confirm/Activation" ) ;
I . see ( "Web Office" ) ;
I . seeElement ( {
react : "TextInput" ,
props : {
id : "name" ,
} ,
} ) ;
I . seeElement ( {
react : "TextInput" ,
props : {
id : "surname" ,
} ,
} ) ;
I . seeElement ( {
react : "PasswordInput" ,
props : {
id : "password" ,
} ,
} ) ;
I . seeElement ( {
react : "Button" ,
} ) ;
I . saveScreenshot ( ` 6.activate-user.png ` ) ;
if ( ! isModel ) {
I . seeVisualDiff ( ` 6.activate-user.png ` , {
tolerance : 1 ,
prepareBaseImage : false ,
} ) ;
}
} ) ;
2022-02-22 11:33:22 +00:00
Scenario ( "Change password page render test" , async ( { I } ) => {
I . mockEndpoint ( Endpoints . settings , "settings" ) ;
I . mockEndpoint ( Endpoints . password , "password" ) ;
I . mockEndpoint ( Endpoints . confirm , "confirm" ) ;
I . amOnPage ( "/confirm/PasswordChange" ) ;
I . see ( "Web Office" ) ;
I . see ( "Now you can create a new password" ) ;
I . seeElement ( {
react : "PasswordInput" ,
} ) ;
I . seeElement ( {
react : "Button" ,
} ) ;
I . saveScreenshot ( ` 7.change-password.png ` ) ;
if ( ! isModel ) {
I . seeVisualDiff ( ` 7.change-password.png ` , {
tolerance : 1 ,
prepareBaseImage : false ,
} ) ;
}
} ) ;
2022-02-24 19:45:17 +00:00
Scenario ( "TfaActivation page render test" , async ( { I } ) => {
I . mockEndpoint ( Endpoints . confirm , "confirm" ) ;
I . mockEndpoint ( Endpoints . setup , "setup" ) ;
2022-03-31 13:02:36 +00:00
I . mockEndpoint ( Endpoints . settings , "settings" ) ;
I . mockEndpoint ( Endpoints . build , "build" ) ;
2022-02-24 19:45:17 +00:00
I . amOnPage ( "/confirm/TfaActivation" ) ;
I . see ( "Configure your authenticator application" ) ;
I . see (
"To connect the app, scan the QR code or manually enter your secret key KRWVMTLBNVDGWZCG, and then enter a 6-digit code from your app in the field below."
) ;
I . seeElement ( {
react : "TextInput" ,
props : {
name : "code" ,
} ,
} ) ;
I . seeElement ( {
react : "Button" ,
} ) ;
I . saveScreenshot ( ` 8.tfa-activation.png ` ) ;
if ( ! isModel ) {
I . seeVisualDiff ( ` 8.tfa-activation.png ` , {
tolerance : 1 ,
prepareBaseImage : false ,
} ) ;
}
} ) ;
2022-03-30 20:09:58 +00:00
Scenario (
"Language and Time Zone Settings page mobile render test" ,
async ( { I } ) => {
I . mockEndpoint ( Endpoints . common , "common" ) ;
I . mockEndpoint ( Endpoints . cultures , "cultures" ) ;
I . mockEndpoint ( Endpoints . timezones , "timezones" ) ;
I . mockEndpoint ( Endpoints . settings , "settingsCustomization" ) ;
I . mockEndpoint ( Endpoints . build , "build" ) ;
I . mockEndpoint ( Endpoints . info , "infoSettings" ) ;
I . mockEndpoint ( Endpoints . self , "selfSettings" ) ;
2022-03-31 19:46:25 +00:00
I . amOnPage ( "/settings/common/customization/language-and-time-zone" ) ;
2022-03-31 13:03:39 +00:00
2022-03-31 19:46:25 +00:00
if ( deviceType === "mobile" ) {
2022-03-30 20:09:58 +00:00
I . see ( "Language and Time Zone Settings" ) ;
I . seeElement ( "div" , ".settings-block" ) ;
I . seeElement ( {
react : "Button" ,
props : {
label : "Save" ,
isDisabled : true ,
} ,
} ) ;
I . seeElement ( {
react : "Button" ,
props : {
label : "Cancel" ,
isDisabled : true ,
} ,
} ) ;
I . saveScreenshot ( ` 9.language-and-time-zone-settings-mobile.png ` ) ;
if ( ! isModel ) {
I . seeVisualDiff ( ` 9.language-and-time-zone-settings-mobile.png ` , {
tolerance : 1 ,
prepareBaseImage : false ,
} ) ;
}
}
}
) ;
2022-04-01 10:11:18 +00:00
if ( deviceType === "mobile" ) {
Scenario ( "Tfa settings page mobile render test" , async ( { I } ) => {
I . mockEndpoint ( Endpoints . common , "common" ) ;
I . mockEndpoint ( Endpoints . settings , "settings" ) ;
I . mockEndpoint ( Endpoints . build , "build" ) ;
I . mockEndpoint ( Endpoints . info , "infoSettings" ) ;
I . mockEndpoint ( Endpoints . self , "selfSettings" ) ;
I . mockEndpoint ( Endpoints . tfaapp , "tfaapp" ) ;
I . mockEndpoint ( Endpoints . tfaconfirm , "tfaconfirm" ) ;
I . mockEndpoint ( Endpoints . confirm , "confirm" ) ;
I . amOnPage ( "/settings/security/access-portal/tfa" ) ;
I . see ( "Two-factor authentication" ) ;
I . seeElement ( {
react : "RadioButtonGroup" ,
props : {
className : "box" ,
} ,
} ) ;
I . seeElement ( {
react : "Button" ,
props : {
label : "Save" ,
isDisabled : true ,
} ,
} ) ;
I . seeElement ( {
react : "Button" ,
props : {
label : "Cancel" ,
isDisabled : true ,
} ,
} ) ;
} ) ;
}
2022-04-04 12:52:41 +00:00
Scenario ( "Welcome Page Settings mobile render test" , async ( { I } ) => {
I . mockEndpoint ( Endpoints . common , "common" ) ;
I . mockEndpoint ( Endpoints . cultures , "cultures" ) ;
I . mockEndpoint ( Endpoints . timezones , "timezones" ) ;
I . mockEndpoint ( Endpoints . settings , "settingsCustomization" ) ;
I . mockEndpoint ( Endpoints . build , "build" ) ;
I . mockEndpoint ( Endpoints . info , "infoSettings" ) ;
I . mockEndpoint ( Endpoints . self , "selfSettings" ) ;
I . amOnPage ( "/settings/common/customization/welcome-page-settings" ) ;
if ( deviceType === "mobile" ) {
I . see ( "Welcome Page Settings" ) ;
I . seeElement ( "div" , ".settings-block" ) ;
I . seeElement ( {
react : "Button" ,
props : {
label : "Save" ,
isDisabled : true ,
} ,
} ) ;
I . seeElement ( {
react : "Button" ,
props : {
label : "Restore to Default" ,
} ,
} ) ;
I . saveScreenshot ( ` 10.welcome-page-settings-mobile.png ` ) ;
if ( ! isModel ) {
I . seeVisualDiff ( ` 10.welcome-page-settings-mobile.png ` , {
tolerance : 1 ,
prepareBaseImage : false ,
} ) ;
}
}
} ) ;
2022-04-22 14:38:47 +00:00
Scenario ( "Portal Renaming mobile render test" , async ( { I } ) => {
I . mockEndpoint ( Endpoints . common , "common" ) ;
I . mockEndpoint ( Endpoints . cultures , "cultures" ) ;
I . mockEndpoint ( Endpoints . timezones , "timezones" ) ;
I . mockEndpoint ( Endpoints . settings , "settingsCustomization" ) ;
I . mockEndpoint ( Endpoints . build , "build" ) ;
I . mockEndpoint ( Endpoints . info , "infoSettings" ) ;
I . mockEndpoint ( Endpoints . self , "selfSettings" ) ;
I . amOnPage ( "/settings/common/customization/portal-renaming" ) ;
if ( deviceType === "mobile" ) {
I . see ( "Portal Renaming" ) ;
I . seeElement ( "div" , ".settings-block" ) ;
I . see ( "New portal name" ) ;
I . seeElement ( {
react : "Button" ,
props : {
label : "Save" ,
isDisabled : true ,
} ,
} ) ;
I . seeElement ( {
react : "Button" ,
props : {
label : "Cancel" ,
isDisabled : true ,
} ,
} ) ;
I . saveScreenshot ( ` 11.portal-renaming-mobile.png ` ) ;
if ( ! isModel ) {
I . seeVisualDiff ( ` 11.portal-renaming-mobile.png ` , {
tolerance : 1 ,
prepareBaseImage : false ,
} ) ;
}
}
} ) ;