@@ -51,6 +51,46 @@ class PerpsMarketListView {
5151 return Matchers . getElementByID ( / ^ p e r p s - m a r k e t - r o w - i t e m - .* / , 0 ) ;
5252 }
5353
54+ // Generic getter for market row item by index (0-based)
55+ getMarketRowItemAt ( index : number ) {
56+ return Matchers . getElementByID ( / ^ p e r p s - m a r k e t - r o w - i t e m - .* / , index ) ;
57+ }
58+
59+ async getMarketRowItem ( symbol : string ) {
60+ // Match any element with testID that starts with 'perps-market-row-item-' and get the first one
61+ return await Matchers . getElementByID ( `perps-market-row-item-${ symbol } ` ) ;
62+ }
63+
64+ // Tap specific market by symbol
65+ async tapMarketRowItem ( symbol : string ) {
66+ const target = Matchers . getElementByID (
67+ getPerpsMarketRowItemSelector . rowItem ( symbol ) ,
68+ ) ;
69+ await Gestures . scrollToElement ( target , this . scrollableContainer , {
70+ direction : 'down' ,
71+ scrollAmount : 200 ,
72+ elemDescription : `Perps Market Row ${ symbol } ` ,
73+ } ) ;
74+ await Gestures . waitAndTap ( target , {
75+ elemDescription : `Perps Market Row ${ symbol } ` ,
76+ checkStability : true ,
77+ } ) ;
78+ }
79+
80+ // // Generic action to tap market row item by index (scrolls into view, then taps)
81+ // async tapMarketRowItemAt(index: number) {
82+ // const target = this.getMarketRowItemAt(index);
83+ // await Gestures.scrollToElement(target, this.scrollableContainer, {
84+ // direction: 'down',
85+ // scrollAmount: 200,
86+ // elemDescription: `Perps Market Row at index ${index}`,
87+ // });
88+ // await Gestures.waitAndTap(target, {
89+ // elemDescription: `Perps Market Row at index ${index}`,
90+ // checkStability: true,
91+ // });
92+ // }
93+
5494 get tokenSelectorContainer ( ) {
5595 return Matchers . getElementByID ( PerpsTokenSelectorSelectorsIDs . CONTAINER ) ;
5696 }
0 commit comments