-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change: test cases updated for packages!
- Loading branch information
Showing
6 changed files
with
122 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,107 @@ | ||
import { test } from '../fixture/synpress' | ||
import { GatewayAction } from '../lib/gatewayAction' | ||
import { BasePage } from '../pages/basePage' | ||
|
||
const amountToBridge: string = '0.0001' | ||
let amountToBridge: string = '0.0001' | ||
|
||
const TEST_TIMEOUT = 120000 | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto('/') | ||
}) | ||
|
||
test.describe('Gateway BNB (Testnet)', () => { | ||
test.skip() | ||
test.describe('Classic Bridge', () => { | ||
test.describe('Deposit', () => { | ||
test('tBNB', async ({ page }) => { | ||
test.setTimeout(120000) | ||
const bridgeAction = new GatewayAction(page) | ||
await bridgeAction.addAndConnectBNBTestnet() | ||
await bridgeAction.classicBridgeDeposit({ | ||
amountToBridge, | ||
tokenSymbol: 'tBNB', | ||
networkKey: 'bnb', | ||
}) | ||
}) | ||
test('BOBA', async ({ page }) => { | ||
test.setTimeout(120000) | ||
const bridgeAction = new GatewayAction(page) | ||
await bridgeAction.addAndConnectBNBTestnet() | ||
await bridgeAction.classicBridgeDeposit({ | ||
amountToBridge, | ||
tokenSymbol: 'BOBA', | ||
approveAllowance: true, | ||
networkKey: 'bnb', | ||
}) | ||
}) | ||
}) | ||
test.describe('Withdraw', () => { | ||
test.skip('BOBA', async ({ page }) => { | ||
test.setTimeout(120000) | ||
const basePage = new BasePage(page) | ||
const bridgeAction = new GatewayAction(page) | ||
await bridgeAction.addAndConnectBNBTestnet() | ||
await bridgeAction.switchL2Network() | ||
page.waitForTimeout(2000) | ||
await basePage.connectToMetamask(true) | ||
await bridgeAction.classicBridgeWithdrawal({ | ||
amountToBridge: '0.00001', | ||
tokenSymbol: 'tBNB', | ||
networkKey: 'bnb', | ||
}) | ||
}) | ||
test.describe('BNB', () => { | ||
let gatewayAction | ||
|
||
test.beforeEach(async ({ page }) => { | ||
gatewayAction = new GatewayAction(page) | ||
await gatewayAction.addAndConnectBNBTestnet() | ||
test.setTimeout(TEST_TIMEOUT) | ||
}) | ||
|
||
test('should deposit tBNB token with classic bridge', async () => { | ||
await gatewayAction.classicBridge({ | ||
amountToBridge, | ||
tokenSymbol: 'tBNB', | ||
estimatedTime: '13 ~ 14mins.', | ||
}) | ||
await gatewayAction.doDepositClassicBridge({ | ||
amountToBridge, | ||
}) | ||
}) | ||
|
||
// fix conflicting MM popup raise or update to new synpress 4 -beta. | ||
test.fixme('should deposit BOBA token with classic bridge', async () => { | ||
await gatewayAction.classicBridge({ | ||
amountToBridge, | ||
tokenSymbol: 'BOBA', | ||
estimatedTime: '13 ~ 14mins.', | ||
}) | ||
await gatewayAction.doDepositClassicBridge({ | ||
amountToBridge, | ||
approveAllowance: true, | ||
}) | ||
}) | ||
|
||
test('should withdraw tBNB token with classic bridge', async () => { | ||
await gatewayAction.switchToL2AndReset() | ||
await gatewayAction.connect() | ||
await gatewayAction.classicBridge({ | ||
amountToBridge, | ||
estimatedTime: '7 days', | ||
tokenSymbol: 'tBNB', | ||
}) | ||
await gatewayAction.doWithdrawClassicBridgeBnb(amountToBridge) | ||
}) | ||
|
||
test('should withdraw BOBA token with classic bridge', async () => { | ||
await gatewayAction.switchToL2AndReset() | ||
await gatewayAction.connect() | ||
await gatewayAction.classicBridge({ | ||
amountToBridge, | ||
estimatedTime: '7 days', | ||
tokenSymbol: 'BOBA', | ||
}) | ||
await gatewayAction.doWithdrawClassicBridge() | ||
}) | ||
|
||
// as of now no supported tokens for teleportation on BNB | ||
test.fixme('should deposit tBNB token with light bridge', async () => { | ||
await gatewayAction.lightBridge({ | ||
amountToBridge: '0.01', | ||
tokenSymbol: 'tBNB', | ||
}) | ||
}) | ||
// as of now no supported tokens for teleportation on BNB | ||
test.fixme('should deposit BOBA token with light bridge', async () => { | ||
await gatewayAction.lightBridge({ | ||
amountToBridge: '20.021', | ||
tokenSymbol: 'BOBA', | ||
approveAllowance: true, | ||
}) | ||
}) | ||
|
||
// as of now no supported tokens for teleportation on BNB | ||
test.fixme('should withdraw tBNB token with light bridge', async () => { | ||
amountToBridge = '0.01' | ||
await gatewayAction.switchToL2AndReset() | ||
const receivableAmt = Number(amountToBridge) * ((100 - 1) / 100) | ||
await gatewayAction.lightBridge({ | ||
amountToBridge, | ||
receivableAmt, | ||
tokenSymbol: 'tBNB', | ||
}) | ||
}) | ||
|
||
// as of now no supported tokens for teleportation on BNB | ||
test.fixme('should withdraw BOBA token with light bridge', async () => { | ||
amountToBridge = '20.0211' | ||
await gatewayAction.switchToL2AndReset() | ||
const receivableAmt = Number(amountToBridge) * ((100 - 1) / 100) | ||
await gatewayAction.lightBridge({ | ||
amountToBridge, | ||
receivableAmt, | ||
tokenSymbol: 'BOBA', | ||
approveAllowance: true, | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters