Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: add e2e test
  • Loading branch information
salimtb committed Jul 18, 2025
commit 977041efec004a12e7c8698d5a90965891adf20d
50 changes: 49 additions & 1 deletion test/e2e/tests/bridge/bridge-positive-cases.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Suite } from 'mocha';
import { unlockWallet, withFixtures } from '../../helpers';
import { largeDelayMs, unlockWallet, withFixtures } from '../../helpers';
import HomePage from '../../page-objects/pages/home/homepage';
import {
switchToNetworkFromSendFlow,
Expand All @@ -8,6 +8,10 @@ import {
import { disableStxSetting } from '../../page-objects/flows/toggle-stx-setting.flow';
import { DEFAULT_BRIDGE_FEATURE_FLAGS } from './constants';
import { bridgeTransaction, getBridgeFixtures } from './bridge-test-utils';
import BridgeQuotePage from '../../page-objects/pages/bridge/quote-page';
import NetworkManager, {
NetworkId,
} from '../../page-objects/pages/network-manager';

describe('Bridge tests', function (this: Suite) {
this.timeout(160000); // This test is very long, so we need an unusually high timeout
Expand Down Expand Up @@ -90,4 +94,48 @@ describe('Bridge tests', function (this: Suite) {
},
);
});

it('Execute bridge transactions on non enabled networks', async function () {
await withFixtures(
getBridgeFixtures(
this.test?.fullTitle(),
DEFAULT_BRIDGE_FEATURE_FLAGS,
false,
),
async ({ driver }) => {
await unlockWallet(driver);

// disable Linea network
const networkManager = new NetworkManager(driver);
await networkManager.openNetworkManager();
await networkManager.deselectNetwork(NetworkId.LINEA);
await networkManager.closeNetworkManager();

await driver.delay(largeDelayMs);

// disable smart transactions step by step for all bridge flows
// we cannot use fixtures because migration 135 overrides the opt in value to true
await disableStxSetting(driver);

// Navigate to Bridge page
const homePage = new HomePage(driver);
await homePage.startBridgeFlow();

const bridgePage = new BridgeQuotePage(driver);
await bridgePage.enterBridgeQuote({
amount: '25',
tokenFrom: 'ETH',
tokenTo: 'DAI',
fromChain: 'Linea',
toChain: 'Ethereum',
});

await bridgePage.goBack();

// check if the Linea network is selected
await networkManager.openNetworkManager();
await networkManager.checkNetworkIsSelected(NetworkId.LINEA);
},
);
});
});
Loading