@@ -4,11 +4,13 @@ import dashboardPage from '../../page-objects/dashboard/dashboard';
44import entityPage from '../../page-objects/entities/entities' ;
55import flowPage from '../../page-objects/flows/flows' ;
66import appPage from '../../page-objects/appPage' ;
7+ import settingsPage from '../../page-objects/settings/settings' ;
8+ const fs = require ( 'fs-extra' ) ;
79
810const selectCardinalityOneToOneOption = 'select option:nth-child(1)' ;
911const selectCardinalityOneToManyOption = 'select option:nth-child(2)' ;
1012
11- export default function ( ) {
13+ export default function ( tmpDir ) {
1214 describe ( 'create entities' , ( ) => {
1315 beforeAll ( ( ) => {
1416 loginPage . isLoaded ( ) ;
@@ -146,6 +148,14 @@ export default function() {
146148 entityPage . getPropertyType ( lastProperty ) . element ( by . cssContainingText ( 'option' , 'decimal' ) ) . click ( ) ;
147149 entityPage . getPropertyDescription ( lastProperty ) . sendKeys ( 'price description' ) ;
148150 entityPage . getPropertyRangeIndex ( lastProperty ) . click ( ) ;
151+ // add titlePii property
152+ console . log ( 'add titlePii property' ) ;
153+ entityPage . addProperty . click ( ) ;
154+ lastProperty = entityPage . lastProperty ;
155+ entityPage . getPropertyName ( lastProperty ) . sendKeys ( 'titlePii' ) ;
156+ entityPage . getPropertyType ( lastProperty ) . element ( by . cssContainingText ( 'option' , 'string' ) ) . click ( ) ;
157+ entityPage . getPropertyDescription ( lastProperty ) . sendKeys ( 'titlePii description' ) ;
158+ entityPage . getPropertyPii ( lastProperty ) . click ( ) ;
149159 entityPage . saveEntity . click ( ) ;
150160 browser . wait ( EC . elementToBeClickable ( entityPage . confirmDialogYesButton ) ) ;
151161 expect ( entityPage . confirmDialogYesButton . isPresent ( ) ) . toBe ( true ) ;
@@ -209,6 +219,11 @@ export default function() {
209219 expect ( entityPage . getPropertyType ( priceProperty ) . getAttribute ( 'value' ) ) . toContain ( 'decimal' ) ;
210220 expect ( entityPage . getPropertyDescription ( priceProperty ) . getAttribute ( 'value' ) ) . toEqual ( 'price description' ) ;
211221 expect ( entityPage . hasClass ( entityPage . getPropertyRangeIndex ( priceProperty ) , 'active' ) ) . toBe ( true ) ;
222+ let titlePiiProperty = entityPage . getPropertyByPosition ( 3 ) ;
223+ expect ( entityPage . getPropertyName ( titlePiiProperty ) . getAttribute ( 'value' ) ) . toEqual ( 'titlePii' ) ;
224+ expect ( entityPage . getPropertyType ( titlePiiProperty ) . getAttribute ( 'value' ) ) . toContain ( 'string' ) ;
225+ expect ( entityPage . getPropertyDescription ( titlePiiProperty ) . getAttribute ( 'value' ) ) . toEqual ( 'titlePii description' ) ;
226+ expect ( entityPage . hasClass ( entityPage . getPropertyPii ( titlePiiProperty ) , 'active' ) ) . toBe ( true ) ;
212227 entityPage . cancelEntity . click ( ) ;
213228 browser . wait ( EC . invisibilityOf ( entityPage . entityEditor ) ) ;
214229 } ) ;
@@ -606,6 +621,25 @@ export default function() {
606621 browser . actions ( ) . dragAndDrop ( entityPage . entityBox ( 'WorldBank' ) , { x : 750 , y : 750 } ) . perform ( ) ;
607622 } ) ;
608623
624+ it ( 'should copy attachment-pii.json file to protect title on attachment' , function ( ) {
625+ //copy attachment-pii.json
626+ console . log ( 'copy attachment-pii.json' ) ;
627+ let attachmentPiiFilePath = 'e2e/qa-data/protected-paths/attachment-pii.json' ;
628+ fs . copy ( attachmentPiiFilePath , tmpDir + '/src/main/ml-config/security/protected-paths/attachment-pii.json' ) ;
629+ } ) ;
630+
631+ it ( 'should redeploy hub to make the pii takes effect' , function ( ) {
632+ appPage . settingsTab . click ( ) ;
633+ settingsPage . isLoaded ( ) ;
634+ settingsPage . redeployButton . click ( ) ;
635+ browser . wait ( EC . elementToBeClickable ( settingsPage . redeployConfirmation ) ) ;
636+ settingsPage . redeployConfirmation . click ( ) ;
637+ browser . wait ( EC . visibilityOf ( settingsPage . redeployStatus ) ) ;
638+ expect ( settingsPage . redeployStatus . isDisplayed ( ) ) . toBe ( true ) ;
639+ browser . sleep ( 120000 ) ;
640+ browser . wait ( EC . invisibilityOf ( settingsPage . redeployStatus ) ) ;
641+ } ) ;
642+
609643 it ( 'should go to the flow page' , function ( ) {
610644 appPage . flowsTab . click ( ) ;
611645 flowPage . isLoaded ( ) ;
0 commit comments