@@ -194,7 +194,7 @@ class BackendConfigurationPropertiesPage extends PageWithNavbarPage {
194194 } else {
195195 cy . intercept ( 'POST' , '/api/backend-configuration-pn/properties/index' ) . as ( 'createProperty' ) ;
196196 this . propertyCreateSaveBtn ( ) . click ( ) ;
197- cy . wait ( '@createProperty' , { timeout : 60000 } ) ;
197+ cy . wait ( '@createProperty' , { timeout : 60000 } ) ;
198198 }
199199 cy . wait ( 500 ) ;
200200 this . propertyCreateBtn ( ) . should ( 'be.visible' ) . should ( 'be.enabled' ) ;
@@ -241,6 +241,7 @@ class BackendConfigurationPropertiesPage extends PageWithNavbarPage {
241241 }
242242 } ) ;
243243 }
244+
244245 goToPlanningPage ( ) {
245246 cy . intercept ( 'POST' , '**/api/items-planning-pn/plannings/index' ) . as ( 'getPlannings' ) ;
246247 this . planningsButton ( ) . then ( ( $ele ) => {
@@ -252,6 +253,7 @@ class BackendConfigurationPropertiesPage extends PageWithNavbarPage {
252253 cy . wait ( '@getPlannings' ) ;
253254 this . planningCreateBtn ( ) . should ( 'be.visible' ) . should ( 'be.enabled' ) ;
254255 }
256+
255257 public planningsButton ( ) {
256258 return cy . get ( '#items-planning-pn-plannings' ) ;
257259 }
@@ -275,6 +277,40 @@ export class PropertyRowObject {
275277 deleteBtn : ( ) => Cypress . Chainable < JQuery < HTMLElement > > ;
276278
277279
280+ // getRow(rowNum: number) {
281+ // const row = () => cy.get('.mat-mdc-row').eq(rowNum - 1);
282+ // this.row = row();
283+ //
284+ // row()
285+ // .should('exist')
286+ // .then($r => {
287+ // if ($r.length === 0) {
288+ // cy.log(`No row found at index ${rowNum} — skipping action menu click.`);
289+ // return;
290+ // }
291+ //
292+ // const $actionCell = $r.find('[id^="action-items"]').filter(':visible').first();
293+ //
294+ // if ($actionCell.length > 0) {
295+ // cy.wrap($actionCell)
296+ // .find('#actionMenu', { timeout: 500 })
297+ // .filter(':visible')
298+ // .first()
299+ // .should('be.visible')
300+ // .click({ force: true });
301+ // } else {
302+ // cy.log(`Row ${rowNum} has no [id^="action-items"], skipping click.`);
303+ // return;
304+ // }
305+ // });
306+ //
307+ // this.viewAreasBtn = () => cy.get('[id^=showPropertyAreasBtn]').should('be.visible').should('be.enabled');
308+ // this.editPropertyBtn = () => cy.get('[id^=editPropertyBtn]').should('be.visible').should('be.enabled');
309+ // this.deleteBtn = () => cy.get('[id^=deletePropertyBtn]').should('be.visible').should('be.enabled');
310+ // return this;
311+ // }
312+
313+
278314 getRow ( rowNum : number ) {
279315 const row = ( ) => cy . get ( '.mat-mdc-row' ) . eq ( rowNum - 1 ) ;
280316 this . row = row ( ) ;
@@ -291,20 +327,25 @@ export class PropertyRowObject {
291327
292328 if ( $actionCell . length > 0 ) {
293329 cy . wrap ( $actionCell )
294- . find ( '#actionMenu' , { timeout : 500 } )
330+ . find ( '#actionMenu' , { timeout : 1000 } )
295331 . filter ( ':visible' )
296332 . first ( )
333+ . should ( 'exist' )
297334 . should ( 'be.visible' )
298- . click ( { force : true } ) ;
335+ . click ( { force : true } ) ;
299336 } else {
300337 cy . log ( `Row ${ rowNum } has no [id^="action-items"], skipping click.` ) ;
301338 return ;
302339 }
303340 } ) ;
304341
305- this . viewAreasBtn = ( ) => cy . get ( '[id^=showPropertyAreasBtn]' ) . should ( 'be.visible' ) . should ( 'be.enabled' ) ;
306- this . editPropertyBtn = ( ) => cy . get ( '[id^=editPropertyBtn]' ) . should ( 'be.visible' ) . should ( 'be.enabled' ) ;
307- this . deleteBtn = ( ) => cy . get ( '[id^=deletePropertyBtn]' ) . should ( 'be.visible' ) . should ( 'be.enabled' ) ;
342+ this . viewAreasBtn = ( ) =>
343+ this . row . within ( ( ) => cy . get ( '[id^=showPropertyAreasBtn]' ) . first ( ) . should ( 'be.visible' ) . should ( 'be.enabled' ) ) ;
344+ this . editPropertyBtn = ( ) =>
345+ this . row . within ( ( ) => cy . get ( '[id^=editPropertyBtn]' ) . first ( ) . should ( 'be.visible' ) . should ( 'be.enabled' ) ) ;
346+ this . deleteBtn = ( ) =>
347+ this . row . within ( ( ) => cy . get ( '[id^=deletePropertyBtn]' ) . first ( ) . should ( 'be.visible' ) . should ( 'be.enabled' ) ) ;
348+
308349 return this ;
309350 }
310351
@@ -330,10 +371,10 @@ export class PropertyRowObject {
330371
331372 if ( $actionCell . length > 0 ) {
332373 cy . wrap ( $actionCell )
333- . find ( '#actionMenu' , { timeout : 500 } )
374+ . find ( '#actionMenu' , { timeout : 500 } )
334375 . filter ( ':visible' )
335376 . should ( 'be.visible' )
336- . click ( { force : true } ) ;
377+ . click ( { force : true } ) ;
337378 } else {
338379 cy . log ( `No action-items found in row for: ${ propertyName } , skipping menu click.` ) ;
339380 return ;
0 commit comments