@@ -154,9 +154,15 @@ test.describe(`@quick-actions @fe-v2 @list-report`, () => {
154154 }
155155 ] ,
156156 fragments : {
157- 'table-action.fragment.xml' : new RegExp (
158- `<!-- Use stable and unique IDs!-->\\s*<core:FragmentDefinition xmlns:core='sap.ui.core' xmlns='sap.m'>\\s*<!-- viewName: sap.suite.ui.generic.template.ListReport.view.ListReport -->\\s*<!-- controlType: sap.m.OverflowToolbar -->\\s*<!-- targetAggregation: content -->\\s*<!--\\s*add your xml here -->\\s*<Button text="New Button" id="btn-[a-z0-9]+"><\\/Button>\\s*<\\/core:FragmentDefinition>`
159- )
157+ 'table-action.fragment.xml' : `<!-- Use stable and unique IDs!-->
158+ <core:FragmentDefinition xmlns:core='sap.ui.core' xmlns='sap.m'>
159+ <!-- viewName: sap.suite.ui.generic.template.ListReport.view.ListReport -->
160+ <!-- controlType: sap.m.OverflowToolbar -->
161+ <!-- targetAggregation: content -->
162+ <!-- add your xml here -->
163+ <Button text="New Button" id="btn-[a-z0-9]+"></Button>
164+ </core:FragmentDefinition>
165+ `
160166 }
161167 } ) ;
162168 }
@@ -210,34 +216,31 @@ test.describe(`@quick-actions @fe-v2 @list-report`, () => {
210216 }
211217 ] ,
212218 fragments : {
213- 'table-cell.fragment.xml' : new RegExp (
214- `<core:FragmentDefinition xmlns:core='sap.ui.core' xmlns='sap.m'>\\s*` +
215- `<!-- viewName: sap.suite.ui.generic.template.ListReport.view.ListReport -->\\s*` +
216- `<!-- controlType: sap.m.Table -->\\s*` +
217- `<!-- targetAggregation: cells -->\\s*` +
218- `<!--\\s*add your xml here -->\\s*` +
219- `<Text id="cell-text-[a-z0-9]+" text="Sample data" \/>\\s*` +
220- `<\\/core:FragmentDefinition>`
221- ) ,
222- 'table-column.fragment.xml' : new RegExp (
223- `<!-- Use stable and unique IDs!-->\\s*` +
224- `<core:FragmentDefinition xmlns:core='sap.ui.core' xmlns='sap.m'>\\s*` +
225- `<!-- viewName: sap.suite.ui.generic.template.ListReport.view.ListReport -->\\s*` +
226- `<!-- controlType: sap.m.Table -->\\s*` +
227- `<!-- targetAggregation: columns -->\\s*` +
228- `<!--\\s*add your xml here -->\\s*` +
229- `<Column id="column-[a-z0-9]+"\\s*` +
230- `width="12em"\\s*` +
231- `hAlign="Left"\\s*` +
232- `vAlign="Middle">\\s*` +
233- `<Text id="column-title-[a-z0-9]+" text="New column" \/>\\s*` +
234- `<customData>\\s*` +
235- `<core:CustomData key="p13nData" id="custom-data-[a-z0-9]+"\\s*` +
236- `value='.*"columnKey": "column-[a-z0-9]+", "columnIndex": "3".*' \/>\\s*` +
237- `<\\/customData>\\s*` +
238- `<\\/Column>\\s*` +
239- `<\\/core:FragmentDefinition>`
240- )
219+ 'table-cell.fragment.xml' : `<core:FragmentDefinition xmlns:core='sap.ui.core' xmlns='sap.m'>
220+ <!-- viewName: sap.suite.ui.generic.template.ListReport.view.ListReport -->
221+ <!-- controlType: sap.m.Table -->
222+ <!-- targetAggregation: cells -->
223+ <!-- add your xml here -->
224+ <Text id="cell-text-[a-z0-9]+" text="Sample data" />
225+ </core:FragmentDefinition>` ,
226+ 'table-column.fragment.xml' : `<!-- Use stable and unique IDs!-->
227+ <core:FragmentDefinition xmlns:core='sap.ui.core' xmlns='sap.m'>
228+ <!-- viewName: sap.suite.ui.generic.template.ListReport.view.ListReport -->
229+ <!-- controlType: sap.m.Table -->
230+ <!-- targetAggregation: columns -->
231+ <!-- add your xml here -->
232+ <Column id="column-[a-z0-9]+"
233+ width="12em"
234+ hAlign="Left"
235+ vAlign="Middle">
236+ <Text id="column-title-[a-z0-9]+" text="New column" />
237+
238+ <customData>
239+ <core:CustomData key="p13nData" id="custom-data-[a-z0-9]+"
240+ value='\\\\{"columnKey": "column-[a-z0-9]+", "columnIndex": "3"}' />
241+ </customData>
242+ </Column>
243+ </core:FragmentDefinition>`
241244 }
242245 } ) ;
243246 await expect ( lr . goButton ) . toBeVisible ( ) ;
@@ -470,4 +473,42 @@ test.describe(`@quick-actions @fe-v2 @list-report`, () => {
470473 ) . toBeVisible ( ) ;
471474 }
472475 ) ;
476+ test ( '10. Add Custom Page Action' , { } , async ( { page, previewFrame, ui5Version, projectCopy } ) => {
477+ const dialog = new AdpDialog ( previewFrame , ui5Version ) ;
478+ const editor = new AdaptationEditorShell ( page , ui5Version ) ;
479+
480+ await editor . reloadCompleted ( ) ;
481+ await editor . quickActions . addCustomPageAction . click ( ) ;
482+
483+ await dialog . fillField ( 'Fragment Name' , 'page-action' ) ;
484+ await dialog . clickCreateButton ( ) ;
485+
486+ await editor . toolbar . saveAndReloadButton . click ( ) ;
487+
488+ await editor . toolbar . isDisabled ( ) ;
489+
490+ await verifyChanges ( projectCopy , {
491+ changes : [
492+ {
493+ fileType : 'change' ,
494+ changeType : 'addXML' ,
495+ content : {
496+ targetAggregation : 'actions' ,
497+ fragmentPath : 'fragments/page-action.fragment.xml'
498+ }
499+ }
500+ ] ,
501+ fragments : {
502+ 'page-action.fragment.xml' : `<!-- Use stable and unique IDs!-->
503+ <core:FragmentDefinition xmlns:core='sap.ui.core' xmlns='sap.m'>
504+ <!-- viewName: sap.suite.ui.generic.template.ListReport.view.ListReport -->
505+ <!-- controlType: sap.f.DynamicPageTitle -->
506+ <!-- targetAggregation: actions -->
507+ <!-- add your xml here -->
508+ <Button text="New Button" id="btn-[a-z0-9]+"></Button>
509+ </core:FragmentDefinition>
510+ `
511+ }
512+ } ) ;
513+ } ) ;
473514} ) ;
0 commit comments