Skip to content

Commit b2e1a93

Browse files
test(ui): remove deprecated IMX (StarkEx) E2E scenarios
1 parent 4266e0f commit b2e1a93

3 files changed

Lines changed: 4 additions & 346 deletions

File tree

sample/Tests/test/test_android.py

Lines changed: 1 addition & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -106,127 +106,5 @@ def test_2_other_functions(self):
106106
def test_3_passport_functions(self):
107107
self.test_1_passport_functions()
108108

109-
def test_4_imx_functions(self):
110-
self.test_2_imx_functions()
111-
112109
def test_5_zkevm_functions(self):
113-
self.test_3_zkevm_functions()
114-
115-
def test_6_pkce_relogin(self):
116-
driver = self.appium_driver
117-
118-
self.close_and_open_app()
119-
120-
# Restart AltTester
121-
self.altdriver.stop()
122-
self.altdriver = AltDriver()
123-
time.sleep(5)
124-
125-
# # Select use PKCE auth
126-
self.altdriver.find_object(By.NAME, "PKCE").tap()
127-
# Wait for unauthenticated screen
128-
self.altdriver.wait_for_current_scene_to_be("UnauthenticatedScene")
129-
130-
# Relogin
131-
print("Re-logging in...")
132-
self.altdriver.wait_for_object(By.NAME, "ReloginBtn").tap()
133-
134-
# Wait for authenticated screen
135-
self.altdriver.wait_for_current_scene_to_be("AuthenticatedScene")
136-
print("Re-logged in")
137-
138-
# Get access token
139-
self.altdriver.find_object(By.NAME, "GetAccessTokenBtn").tap()
140-
output = self.altdriver.find_object(By.NAME, "Output")
141-
self.assertTrue(len(output.get_text()) > 50)
142-
143-
# Click Connect to IMX button
144-
self.altdriver.find_object(By.NAME, "ConnectBtn").tap()
145-
time.sleep(5)
146-
self.assertEqual("Connected to IMX", output.get_text())
147-
148-
self.altdriver.stop()
149-
150-
def test_7_pkce_reconnect(self):
151-
self.close_and_open_app()
152-
153-
# Restart AltTester
154-
self.altdriver.stop()
155-
self.altdriver = AltDriver()
156-
time.sleep(5)
157-
158-
# Select use PKCE auth
159-
self.altdriver.find_object(By.NAME, "PKCE").tap()
160-
# Wait for unauthenticated screen
161-
self.altdriver.wait_for_current_scene_to_be("UnauthenticatedScene")
162-
163-
# Reconnect
164-
print("Reconnecting...")
165-
self.altdriver.wait_for_object(By.NAME, "ReconnectBtn").tap()
166-
167-
# Wait for authenticated screen
168-
self.altdriver.wait_for_current_scene_to_be("AuthenticatedScene")
169-
print("Reconnected")
170-
171-
# Get access token
172-
self.altdriver.find_object(By.NAME, "GetAccessTokenBtn").tap()
173-
output = self.altdriver.find_object(By.NAME, "Output")
174-
self.assertTrue(len(output.get_text()) > 50)
175-
176-
# Get address without having to click Connect to IMX button
177-
self.altdriver.find_object(By.NAME, "GetAddressBtn").tap()
178-
self.assertEqual(TestConfig.WALLET_ADDRESS, output.get_text())
179-
180-
# Logout
181-
print("Logging out...")
182-
self.altdriver.find_object(By.NAME, "LogoutBtn").tap()
183-
time.sleep(5)
184-
185-
# Wait for authenticated screen
186-
self.altdriver.wait_for_current_scene_to_be("UnauthenticatedScene")
187-
time.sleep(5)
188-
print("Logged out")
189-
190-
self.altdriver.stop()
191-
192-
def test_8_pkce_connect_imx(self):
193-
self.close_and_open_app()
194-
195-
# Restart AltTester
196-
self.altdriver.stop()
197-
self.altdriver = AltDriver()
198-
time.sleep(5)
199-
200-
# Select use PKCE auth
201-
self.altdriver.find_object(By.NAME, "PKCE").tap()
202-
# Wait for unauthenticated screen
203-
self.altdriver.wait_for_current_scene_to_be("UnauthenticatedScene")
204-
205-
# Connect IMX
206-
print("Logging in and connecting to IMX...")
207-
self.altdriver.wait_for_object(By.NAME, "ConnectBtn").tap()
208-
209-
self.login()
210-
211-
# Wait for authenticated screen
212-
self.altdriver.wait_for_current_scene_to_be("AuthenticatedScene")
213-
print("Logged in and connected to IMX")
214-
215-
# Get access token
216-
self.altdriver.find_object(By.NAME, "GetAccessTokenBtn").tap()
217-
output = self.altdriver.find_object(By.NAME, "Output")
218-
self.assertTrue(len(output.get_text()) > 50)
219-
220-
# Get address without having to click Connect to IMX button
221-
self.altdriver.find_object(By.NAME, "GetAddressBtn").tap()
222-
self.assertEqual(TestConfig.WALLET_ADDRESS, output.get_text())
223-
224-
# Logout
225-
print("Logging out...")
226-
self.altdriver.find_object(By.NAME, "LogoutBtn").tap()
227-
time.sleep(5)
228-
229-
# Wait for authenticated screen
230-
self.altdriver.wait_for_current_scene_to_be("UnauthenticatedScene")
231-
time.sleep(5)
232-
print("Logged out")
110+
self.test_3_zkevm_functions()

sample/Tests/test/test_mac.py

Lines changed: 2 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import sys
22
import time
3+
import unittest
34
import os
45
import subprocess
56
from pathlib import Path
@@ -229,99 +230,5 @@ def test_2_other_functions(self):
229230
def test_3_passport_functions(self):
230231
self.test_1_passport_functions()
231232

232-
def test_4_imx_functions(self):
233-
self.test_2_imx_functions()
234-
235233
def test_5_zkevm_functions(self):
236-
self.test_3_zkevm_functions()
237-
238-
def test_6_relogin(self):
239-
# Close and reopen app
240-
stop_sample_app()
241-
open_sample_app()
242-
243-
# Restart AltTester
244-
self.altdriver.stop()
245-
self.__class__.altdriver = AltDriver()
246-
time.sleep(5)
247-
248-
# Wait for unauthenticated screen
249-
self.altdriver.wait_for_current_scene_to_be("UnauthenticatedScene")
250-
251-
# Relogin
252-
print("Re-logging in...")
253-
self.altdriver.wait_for_object(By.NAME, "ReloginBtn").tap()
254-
255-
# Wait for authenticated screen
256-
self.altdriver.wait_for_current_scene_to_be("AuthenticatedScene")
257-
print("Re-logged in")
258-
259-
# Get access token
260-
self.altdriver.find_object(By.NAME, "GetAccessTokenBtn").tap()
261-
output = self.altdriver.find_object(By.NAME, "Output")
262-
self.assertTrue(len(output.get_text()) > 50)
263-
264-
# Click Connect to IMX button
265-
self.altdriver.find_object(By.NAME, "ConnectBtn").tap()
266-
time.sleep(5)
267-
self.assertEqual("Connected to IMX", output.get_text())
268-
269-
self.altdriver.stop()
270-
271-
def test_7_reconnect_connect_imx(self):
272-
# Close and reopen app
273-
stop_sample_app()
274-
open_sample_app()
275-
276-
# Restart AltTester
277-
self.altdriver.stop()
278-
self.__class__.altdriver = AltDriver()
279-
time.sleep(5)
280-
281-
# Wait for unauthenticated screen
282-
self.altdriver.wait_for_current_scene_to_be("UnauthenticatedScene")
283-
284-
# Reconnect
285-
print("Reconnecting...")
286-
self.altdriver.wait_for_object(By.NAME, "ReconnectBtn").tap()
287-
288-
# Wait for authenticated screen
289-
self.altdriver.wait_for_current_scene_to_be("AuthenticatedScene")
290-
print("Reconnected")
291-
292-
# Get access token
293-
self.altdriver.find_object(By.NAME, "GetAccessTokenBtn").tap()
294-
output = self.altdriver.find_object(By.NAME, "Output")
295-
self.assertTrue(len(output.get_text()) > 50)
296-
297-
# Get address without having to click Connect to IMX button
298-
self.altdriver.find_object(By.NAME, "GetAddressBtn").tap()
299-
self.assertEqual(TestConfig.WALLET_ADDRESS, output.get_text())
300-
301-
# Logout
302-
self.logout()
303-
304-
# Connect IMX
305-
time.sleep(5)
306-
print("Logging in and connecting to IMX...")
307-
self.launch_browser()
308-
bring_sample_app_to_foreground()
309-
self.altdriver.wait_for_object(By.NAME, "ConnectBtn").tap()
310-
self.login()
311-
312-
self.altdriver.wait_for_current_scene_to_be("AuthenticatedScene")
313-
314-
self.stop_browser()
315-
print("Logged in and connected to IMX")
316-
317-
# Get access token
318-
self.altdriver.find_object(By.NAME, "GetAccessTokenBtn").tap()
319-
output = self.altdriver.find_object(By.NAME, "Output")
320-
self.assertTrue(len(output.get_text()) > 50)
321-
322-
# Get address without having to click Connect to IMX button
323-
self.altdriver.find_object(By.NAME, "GetAddressBtn").tap()
324-
self.assertEqual(TestConfig.WALLET_ADDRESS, output.get_text())
325-
326-
# Logout
327-
self.logout()
234+
self.test_3_zkevm_functions()

sample/Tests/test/test_windows.py

Lines changed: 1 addition & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"""
99

1010
import time
11+
import unittest
1112

1213
from alttester import *
1314

@@ -197,138 +198,10 @@ def test_3_passport_functions(self):
197198
print("COMPLETED TEST: test_3_passport_functions")
198199
print("=" * 60)
199200

200-
def test_4_imx_functions(self):
201-
print("=" * 60)
202-
print("STARTING TEST: test_4_imx_functions")
203-
print("=" * 60)
204-
self.test_2_imx_functions()
205-
print("COMPLETED TEST: test_4_imx_functions")
206-
print("=" * 60)
207-
208201
def test_5_zkevm_functions(self):
209202
print("=" * 60)
210203
print("STARTING TEST: test_5_zkevm_functions")
211204
print("=" * 60)
212205
self.test_3_zkevm_functions()
213206
print("COMPLETED TEST: test_5_zkevm_functions")
214207
print("=" * 60)
215-
216-
def test_6_relogin(self):
217-
print("=" * 60)
218-
print("STARTING TEST: test_6_relogin")
219-
print("=" * 60)
220-
self.restart_app_and_altdriver()
221-
222-
# Relogin
223-
print("Re-logging in...")
224-
self.get_altdriver().wait_for_object(By.NAME, "ReloginBtn").tap()
225-
226-
# Wait for authenticated screen
227-
self.get_altdriver().wait_for_current_scene_to_be("AuthenticatedScene")
228-
print("Re-logged in")
229-
230-
# Get access token
231-
self.get_altdriver().find_object(By.NAME, "GetAccessTokenBtn").tap()
232-
output = self.get_altdriver().find_object(By.NAME, "Output")
233-
self.assertTrue(len(output.get_text()) > 50)
234-
235-
# Click Connect to IMX button
236-
self.get_altdriver().find_object(By.NAME, "ConnectBtn").tap()
237-
time.sleep(5)
238-
self.assertEqual("Connected to IMX", output.get_text())
239-
240-
print("COMPLETED TEST: test_6_relogin")
241-
print("=" * 60)
242-
243-
def test_7_reconnect_connect_imx(self):
244-
print("=" * 60)
245-
print("STARTING TEST: test_7_reconnect_connect_imx")
246-
print("=" * 60)
247-
self.restart_app_and_altdriver()
248-
249-
# Reconnect
250-
print("Reconnecting...")
251-
self.get_altdriver().wait_for_object(By.NAME, "ReconnectBtn").tap()
252-
253-
# Wait for authenticated screen
254-
self.get_altdriver().wait_for_current_scene_to_be("AuthenticatedScene")
255-
print("Reconnected")
256-
257-
# Get access token
258-
self.get_altdriver().find_object(By.NAME, "GetAccessTokenBtn").tap()
259-
output = self.get_altdriver().find_object(By.NAME, "Output")
260-
self.assertTrue(len(output.get_text()) > 50)
261-
262-
# Get address without having to click Connect to IMX button
263-
self.get_altdriver().find_object(By.NAME, "GetAddressBtn").tap()
264-
self.assertEqual(TestConfig.WALLET_ADDRESS, output.get_text())
265-
266-
# Logout
267-
print("Logging out...")
268-
launch_browser()
269-
bring_sample_app_to_foreground()
270-
self.get_altdriver().find_object(By.NAME, "LogoutBtn").tap()
271-
272-
# Use controlled browser logout instead of waiting for scene change
273-
logout_with_controlled_browser()
274-
275-
# Give Unity time to process the logout callback
276-
time.sleep(5)
277-
bring_sample_app_to_foreground()
278-
279-
# Wait for authenticated screen
280-
self.get_altdriver().wait_for_current_scene_to_be("UnauthenticatedScene")
281-
282-
stop_browser()
283-
print("Logged out")
284-
285-
print("COMPLETED TEST: test_7_reconnect_connect_imx")
286-
print("=" * 60)
287-
288-
def test_8_connect_imx(self):
289-
print("=" * 60)
290-
print("STARTING TEST: test_8_connect_imx")
291-
print("=" * 60)
292-
# Ensure clean state regardless of previous tests
293-
self.restart_app_and_altdriver()
294-
295-
# Wait for initial scene
296-
self.get_altdriver().wait_for_current_scene_to_be("UnauthenticatedScene")
297-
298-
# Connect IMX
299-
print("Logging in and connecting to IMX...")
300-
launch_browser()
301-
bring_sample_app_to_foreground()
302-
self.get_altdriver().wait_for_object(By.NAME, "ConnectBtn").tap()
303-
login()
304-
bring_sample_app_to_foreground()
305-
306-
# Wait for authenticated screen
307-
self.get_altdriver().wait_for_current_scene_to_be("AuthenticatedScene")
308-
print("Logged in and connected to IMX")
309-
stop_browser()
310-
311-
# Get access token
312-
self.get_altdriver().find_object(By.NAME, "GetAccessTokenBtn").tap()
313-
output = self.get_altdriver().find_object(By.NAME, "Output")
314-
self.assertTrue(len(output.get_text()) > 50)
315-
316-
# Get address without having to click Connect to IMX button
317-
self.get_altdriver().find_object(By.NAME, "GetAddressBtn").tap()
318-
self.assertEqual(TestConfig.WALLET_ADDRESS, output.get_text())
319-
320-
# Logout
321-
launch_browser()
322-
bring_sample_app_to_foreground()
323-
print("Logging out...")
324-
self.get_altdriver().find_object(By.NAME, "LogoutBtn").tap()
325-
logout_with_controlled_browser()
326-
time.sleep(5)
327-
bring_sample_app_to_foreground()
328-
329-
# Wait for authenticated screen
330-
self.get_altdriver().wait_for_current_scene_to_be("UnauthenticatedScene")
331-
stop_browser()
332-
print("Logged out")
333-
print("COMPLETED TEST: test_8_connect_imx")
334-
print("=" * 60)

0 commit comments

Comments
 (0)