@@ -76,6 +76,7 @@ test.describe.serial(' Phantom wallet ', () => {
7676 await newPage2 . waitForLoadState ( )
7777
7878 const phantomPage2 = new PhantomPage ( newPage2 )
79+ await phantomPage2 . connectBtn . waitFor ( { state : 'visible' } )
7980 await phantomPage2 . connectBtn . click ( { delay : 1000 } )
8081
8182 await page . waitForTimeout ( 10_000 )
@@ -103,16 +104,17 @@ test.describe.serial(' Phantom wallet ', () => {
103104 await expect ( depositPage . errorAmountMsg ) . toBeVisible ( )
104105 } )
105106
106- test . skip ( 'Verify that the withdraw can be executed with other wallets address' , async ( ) => {
107+ test ( 'Verify that the withdraw can be executed with other wallets address' , async ( ) => {
107108 const depositPage = new DepositPage ( page )
108109 await depositPage . depositBtn . click ( )
109- await depositPage . myBrowerWallet . click ( )
110+ // await depositPage.myBrowerWallet.click()
110111
111112 const homePage = new HomePage ( page )
112113 await homePage . withdrawnTab . click ( )
113114
114115 const withdrawPage = new WithdrawPage ( page )
115- await withdrawPage . carbonGroupUSD . click ( )
116+ //await withdrawPage.carbonGroupUSD.click()
117+ await withdrawPage . selectToken . click ( )
116118 await withdrawPage . swthTokenOption . click ( )
117119 await withdrawPage . recipientAddrTextbox . fill ( leapSwthAddress )
118120 await withdrawPage . amountTextbox . fill ( '1' )
@@ -131,6 +133,8 @@ test.describe.serial(' Phantom wallet ', () => {
131133 } )
132134
133135 test ( 'TC_DEMEX_TO_1: Place a buy order, verify appearance in order book' , async ( ) => {
136+ const homePage = new HomePage ( page )
137+ await homePage . goToHomePage ( )
134138 const tradePage = new TradeTradePage ( page )
135139 await tradePage . opTokenOption . click ( )
136140 await tradePage . spotTab . click ( )
@@ -155,7 +159,6 @@ test.describe.serial(' Phantom wallet ', () => {
155159 {
156160 'Market' : 'SWTH / USD' ,
157161 'Type' : 'Limit|Buy' ,
158- 'Size' : '1,000 SWTH$1.24' ,
159162 'Filled' : '0 SWTH$0.00' ,
160163 }
161164 ]
@@ -164,6 +167,8 @@ test.describe.serial(' Phantom wallet ', () => {
164167 } )
165168
166169 test ( 'TC_DEMEX_TO_4: Cancel an active order and confirm removal' , async ( ) => {
170+ await page . reload ( )
171+ await page . waitForLoadState ( )
167172 const tradePage = new TradeTradePage ( page )
168173
169174 const [ newPage3 ] = await Promise . all ( [
@@ -178,4 +183,54 @@ test.describe.serial(' Phantom wallet ', () => {
178183
179184 await expect ( tradePage . orderedCancelledPopup ) . toBeVisible ( { timeout : 10_000 } )
180185 } )
186+
187+ test ( 'TC_DEMEX_TO_2: Place a sell order, verify appearance in order book' , async ( ) => {
188+ await page . reload ( )
189+ await page . waitForLoadState ( )
190+ const tradePage = new TradeTradePage ( page )
191+ await tradePage . amountToken . fill ( '1000' )
192+ await tradePage . switchingBtn . click ( )
193+ await tradePage . sellBtn . click ( )
194+
195+ const [ newPage2 ] = await Promise . all ( [
196+ browserContext . waitForEvent ( 'page' ) ,
197+ await tradePage . confirmBtn . click ( )
198+ ] ) ;
199+ await newPage2 . waitForLoadState ( )
200+
201+ const phantomPage2 = new PhantomPage ( newPage2 )
202+ await phantomPage2 . connectBtn . waitFor ( { state : 'visible' } )
203+ await phantomPage2 . connectBtn . click ( { delay : 1000 } )
204+
205+ await expect ( tradePage . orderedPopup ) . toBeVisible ( { timeout : 10_000 } )
206+
207+ const expectedTableData = [
208+ {
209+ 'Market' : 'SWTH / USD' ,
210+ 'Type' : 'Limit|Sell' ,
211+ 'Filled' : '0 SWTH$0.00' ,
212+ }
213+ ]
214+ await tradePage . verifyTableData ( expectedTableData )
215+
216+ } )
217+ } )
218+
219+ test . afterAll ( 'Reset data' , async ( ) => {
220+ const tradePage = new TradeTradePage ( page )
221+ try {
222+ await tradePage . cancelAllBtn . click ( { timeout : 5000 } )
223+ } catch ( e ) { }
224+
225+ const [ newPage2 ] = await Promise . all ( [
226+ browserContext . waitForEvent ( 'page' ) ,
227+ await tradePage . confirmBtn . click ( )
228+ ] ) ;
229+ await newPage2 . waitForLoadState ( )
230+
231+ const phantomPage2 = new PhantomPage ( newPage2 )
232+ await phantomPage2 . connectBtn . waitFor ( { state : 'visible' } )
233+ await phantomPage2 . connectBtn . click ( { delay : 1000 } )
234+
235+ await expect ( tradePage . orderedCancelledPopup ) . toBeVisible ( { timeout : 10_000 } )
181236} )
0 commit comments