@@ -12,6 +12,7 @@ import {
1212import { DappVariants } from '../../../framework/Constants' ;
1313import Browser from '../../../page-objects/Browser/BrowserView' ;
1414import EnsWebsite from '../../../page-objects/Browser/ExternalWebsites/EnsWebsite' ;
15+ import RedirectWebsite from '../../../page-objects/Browser/ExternalWebsites/RedirectWebsite' ;
1516import { Assertions , Utilities } from '../../../framework' ;
1617import { TestSpecificMock } from '../../../framework/types' ;
1718import { setupMockRequest } from '../../../api-mocking/helpers/mockHelpers' ;
@@ -63,7 +64,7 @@ describe(SmokeWalletPlatform('Browser Navigation'), () => {
6364 jest . setTimeout ( 150000 ) ;
6465 } ) ;
6566
66- it ( 'should navigate back home after visiting an invalid URL' , async ( ) => {
67+ it ( 'navigates back home after visiting an invalid URL' , async ( ) => {
6768 await withFixtures (
6869 {
6970 fixture : new FixtureBuilder ( ) . build ( ) ,
@@ -81,7 +82,7 @@ describe(SmokeWalletPlatform('Browser Navigation'), () => {
8182 ) ;
8283 } ) ;
8384
84- it ( 'should resolve and display ENS website (vitalik.eth)' , async ( ) => {
85+ it ( 'resolves and displays ENS website (vitalik.eth)' , async ( ) => {
8586 const ensTestMock : TestSpecificMock = async ( mockServer ) => {
8687 await ensResolutionMock ( mockServer ) ;
8788 await setupMockRequest ( mockServer , {
@@ -125,7 +126,7 @@ describe(SmokeWalletPlatform('Browser Navigation'), () => {
125126 ) ;
126127 } ) ;
127128
128- it ( 'should display redirected URL after cross-origin redirect' , async ( ) => {
129+ it ( 'displays redirected URL after cross-origin redirect' , async ( ) => {
129130 await withFixtures (
130131 {
131132 dapps : [
@@ -162,16 +163,8 @@ describe(SmokeWalletPlatform('Browser Navigation'), () => {
162163 } ,
163164 ) ;
164165
165- // Navigate via runScript — Detox's WebView tap() does not
166- // reliably fire JavaScript handlers on <button> elements.
167166 const targetUrl = `${ getDappUrl ( 1 ) } /redirect-target.html` ;
168- const body = web ( by . id ( 'browser-webview' ) ) . element (
169- by . web . cssSelector ( 'body' ) ,
170- ) ;
171- // eslint-disable-next-line @typescript-eslint/no-explicit-any
172- await ( body as any ) . runScript (
173- `(el) => { window.location.href = '${ targetUrl } '; }` ,
174- ) ;
167+ await RedirectWebsite . navigateToTargetUrl ( targetUrl ) ;
175168 await Assertions . expectElementToHaveText (
176169 Browser . urlInputBoxID ,
177170 getOriginFromURL ( getDappUrl ( 1 ) ) ,
0 commit comments