@@ -268,8 +268,6 @@ export class FileRowObject {
268268 constructor ( ) {
269269 }
270270
271- public row : WebdriverIO . Element ;
272- public checkbox : WebdriverIO . Element ;
273271 public id : number ;
274272 public createDate : string ;
275273 public fileName : string ;
@@ -282,41 +280,27 @@ export class FileRowObject {
282280
283281 public async getRow ( rowNum : number ) : Promise < FileRowObject > {
284282 rowNum = rowNum - 1 ;
285- this . row = ( await $$ ( 'tbody > tr' ) ) [ rowNum ] ;
286- if ( this . row ) {
287- this . checkbox = await this . row . $ ( '.mat-column-select .column-select' ) ;
288- this . id = + await ( await this . row . $ ( '.mat-column-id span' ) ) . getText ( ) ;
289- this . createDate = await ( await this . row . $ ( '.mat-column-createDate span' ) ) . getText ( ) ;
290- this . fileName = await ( await this . row . $ ( '.mat-column-fileName span' ) ) . getText ( ) ;
291- const properties = await this . row . $$ ( '.mat-column-property mat-chip' ) ;
292- this . properties = [ ] ;
293- for ( let i = 0 ; i < properties . length ; i ++ ) {
294- const text = await properties [ i ] . getText ( ) ;
295- this . properties . push ( text . toString ( ) ) ;
296- }
297- // if (properties.length > 0) {
298- // properties[properties.length - 1] = properties[properties.length - 1].replace('edit', ''); // delete button
299- // this.properties = properties
300- // .filter(x => x) // delete empty strings
301- // .map(x => x.replaceAll('\n', '')); // delete enters
302- // }
303- const tags = await this . row . $$ ( '.mat-column-tags mat-chip' ) ;
304- this . tags = [ ] ;
305- for ( let i = 0 ; i < tags . length ; i ++ ) {
306- const text = await tags [ i ] . getText ( ) ;
307- this . tags . push ( text . toString ( ) ) ;
308- }
309- // if (tags.length > 0) {
310- // // tags[tags.length - 1] = tags[tags.length - 1].replace('edit', ''); // delete button
311- // this.tags = tags
312- // //.filter(x => x.te) // delete empty strings
313- // .map(x => (await x.getText()).replaceAll('\n', '')); // delete enters
314- // }
315- this . editTagsBtn = await this . row . $ ( '.mat-column-tags button' ) ;
316- this . viewPDFBtn = await this . row . $$ ( '.mat-column-actions button' ) [ 0 ] ;
317- this . editFileNameBtn = await this . row . $$ ( '.mat-column-actions button' ) [ 1 ] ;
318- this . deleteFileBtn = await this . row . $$ ( '.mat-column-actions button' ) [ 2 ] ;
283+ this . id = + await ( await $ ( '#fileId-' + rowNum ) ) . getText ( ) ;
284+ this . createDate = await ( await $ ( '#fileCreateDate-' + rowNum ) ) . getText ( ) ;
285+ this . fileName = await ( await $ ( '#fileName-' + rowNum ) ) . getText ( ) ;
286+ // Get properties from mat-chip elements - need to use row context since it's dynamic
287+ const row = ( await $$ ( 'tbody > tr' ) ) [ rowNum ] ;
288+ const properties = await row . $$ ( '.mat-column-property mat-chip' ) ;
289+ this . properties = [ ] ;
290+ for ( let i = 0 ; i < properties . length ; i ++ ) {
291+ const text = await properties [ i ] . getText ( ) ;
292+ this . properties . push ( text . toString ( ) ) ;
293+ }
294+ const tags = await row . $$ ( '.mat-column-tags mat-chip' ) ;
295+ this . tags = [ ] ;
296+ for ( let i = 0 ; i < tags . length ; i ++ ) {
297+ const text = await tags [ i ] . getText ( ) ;
298+ this . tags . push ( text . toString ( ) ) ;
319299 }
300+ this . editTagsBtn = await $ ( '#editTagsBtn-' + rowNum ) ;
301+ this . viewPDFBtn = await $ ( '#viewPdfBtn-' + rowNum ) ;
302+ this . editFileNameBtn = await $ ( '#editFilenameBtn-' + rowNum ) ;
303+ this . deleteFileBtn = await $ ( '#deleteFileBtn-' + rowNum ) ;
320304 return this ;
321305 }
322306
0 commit comments