Skip to content

Commit

Permalink
rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
brtkx committed Dec 23, 2024
1 parent 7929fdc commit af65c68
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions packages/arb-token-bridge-ui/tests/e2e/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
findGasFeeSummary,
findGasFeeForChain,
findMoveFundsButton,
startTransfer,
clickMoveFundsButton,
findSelectTokenButton,
openTransactionDetails,
closeTransactionDetails,
Expand Down Expand Up @@ -66,7 +66,7 @@ declare global {
findGasFeeForChain: typeof findGasFeeForChain
findGasFeeSummary: typeof findGasFeeSummary
findMoveFundsButton: typeof findMoveFundsButton
startTransfer: typeof startTransfer
clickMoveFundsButton: typeof clickMoveFundsButton
findSelectTokenButton: typeof findSelectTokenButton
openTransactionDetails: typeof openTransactionDetails
closeTransactionDetails: typeof closeTransactionDetails
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('Approve token for deposit', () => {
timeout: 50000,
interval: 500
})
cy.startTransfer({ shouldConfirmInMetamask: false })
cy.clickMoveFundsButton({ shouldConfirmInMetamask: false })
cy.findByText(/pay a one-time approval fee/).click()
cy.findByRole('button', {
name: /Pay approval fee of/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ describe('Batch Deposit', () => {
}

context('should deposit successfully', () => {
cy.startTransfer()
cy.clickMoveFundsButton()
cy.findTransactionInTransactionHistory({
...txData,
duration: depositTime
Expand Down Expand Up @@ -238,7 +238,7 @@ describe('Batch Deposit', () => {
}

context('should deposit successfully', () => {
cy.startTransfer()
cy.clickMoveFundsButton()
cy.findTransactionInTransactionHistory({
...txData,
duration: depositTime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('Deposit USDC through CCTP', () => {
})

it('should initiate depositing USDC to the same address through CCTP successfully', () => {
cy.findMoveFundsButton().click()
cy.clickMoveFundsButton().click()

confirmAndApproveCctpDeposit()
cy.confirmSpending(USDCAmountToSend.toString())
Expand Down Expand Up @@ -122,7 +122,7 @@ describe('Deposit USDC through CCTP', () => {
*/
it.skip('should initiate depositing USDC to custom destination address through CCTP successfully', () => {
cy.fillCustomDestinationAddress()
cy.findMoveFundsButton().click()
cy.clickMoveFundsButton().click()
confirmAndApproveCctpDeposit()

cy.confirmSpending(USDCAmountToSend.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('Deposit Token', () => {
})

context('should deposit successfully', () => {
cy.startTransfer()
cy.clickMoveFundsButton()
cy.findTransactionInTransactionHistory({
duration: depositTime,
amount: ERC20AmountToSend,
Expand Down Expand Up @@ -130,7 +130,7 @@ describe('Deposit Token', () => {
})

context('should deposit successfully', () => {
cy.startTransfer()
cy.clickMoveFundsButton()
const txData = {
amount: ERC20AmountToSend,
symbol: testCase.symbol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('Deposit native token', () => {
cy.findGasFeeSummary(zeroToLessThanOneEth)
cy.findGasFeeForChain(getL1NetworkName(), zeroToLessThanOneEth)
cy.findGasFeeForChain(getL2NetworkName(), zeroToLessThanOneNativeToken)
cy.startTransfer()
cy.clickMoveFundsButton()
cy.findTransactionInTransactionHistory({
duration: depositTime,
amount: ETHAmountToDeposit,
Expand All @@ -53,7 +53,7 @@ describe('Deposit native token', () => {
cy.findGasFeeSummary(zeroToLessThanOneEth)
cy.findGasFeeForChain(getL1NetworkName(), zeroToLessThanOneEth)
cy.findGasFeeForChain(getL2NetworkName(), zeroToLessThanOneNativeToken)
cy.startTransfer()
cy.clickMoveFundsButton()

const txData = {
amount: ETHAmountToDeposit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('Withdraw USDC through CCTP', () => {
'be.visible'
)
cy.findGasFeeForChain(/You'll have to pay Sepolia gas fee upon claiming./i)
cy.findMoveFundsButton().click()
cy.clickMoveFundsButton().click()

confirmAndApproveCctpWithdrawal()
cy.confirmSpending(USDCAmountToSend.toString())
Expand Down Expand Up @@ -109,7 +109,7 @@ describe('Withdraw USDC through CCTP', () => {
)
cy.findGasFeeForChain(/You'll have to pay Sepolia gas fee upon claiming./i)
cy.fillCustomDestinationAddress()
cy.findMoveFundsButton().click()
cy.clickMoveFundsButton().click()

confirmAndApproveCctpWithdrawal()
cy.confirmSpending(USDCAmountToSend.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe('Withdraw ERC20 Token', () => {
})

context('should show clickable withdraw button', () => {
cy.startTransfer({ shouldConfirmInMetamask: false })
cy.clickMoveFundsButton({ shouldConfirmInMetamask: false })
})

context('should withdraw successfully', () => {
Expand Down Expand Up @@ -218,7 +218,7 @@ describe('Withdraw ERC20 Token', () => {
})

context('should show clickable withdraw button', () => {
cy.startTransfer({ shouldConfirmInMetamask: false })
cy.clickMoveFundsButton({ shouldConfirmInMetamask: false })
})

context('should initiate withdrawal successfully', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('Withdraw native token', () => {
ETHToWithdraw = Number((Math.random() * 0.001).toFixed(5)) // generate a new withdrawal amount for each test-run attempt so that findAllByText doesn't stall coz of prev transactions
cy.login({ networkType: 'childChain' })
cy.typeAmount(ETHToWithdraw)
cy.startTransfer({ shouldConfirmInMetamask: false })
cy.clickMoveFundsButton({ shouldConfirmInMetamask: false })
cy.findByText(/Arbitrum’s bridge/i).should('be.visible')

// the Continue withdrawal button should be disabled at first
Expand Down Expand Up @@ -146,7 +146,7 @@ describe('Withdraw native token', () => {

cy.typeAmount(ETHToWithdraw)
cy.fillCustomDestinationAddress()
cy.startTransfer({ shouldConfirmInMetamask: false })
cy.clickMoveFundsButton({ shouldConfirmInMetamask: false })
cy.findByText(/Arbitrum’s bridge/i).should('be.visible')

// the Continue withdrawal button should be disabled at first
Expand Down
4 changes: 2 additions & 2 deletions packages/arb-token-bridge-ui/tests/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export function findMoveFundsButton(): Cypress.Chainable<JQuery<HTMLElement>> {
.should('be.visible')
}

export function startTransfer({
export function clickMoveFundsButton({
shouldConfirmInMetamask = true
}: {
shouldConfirmInMetamask?: boolean
Expand Down Expand Up @@ -401,7 +401,7 @@ Cypress.Commands.addAll({
findGasFeeForChain,
findGasFeeSummary,
findMoveFundsButton,
startTransfer,
clickMoveFundsButton,
findSelectTokenButton,
switchToTransferPanelTab,
switchToTransactionHistoryTab,
Expand Down

0 comments on commit af65c68

Please sign in to comment.