Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Add CCTP synpress config #1861

Merged
merged 19 commits into from
Sep 2, 2024
Merged

Conversation

chrstph-dvx
Copy link
Contributor

Summary

Steps to test

Copy link

vercel bot commented Aug 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
arbitrum-token-bridge ✅ Ready (Inspect) Visit Preview Sep 2, 2024 1:41pm

params: Parameters<typeof cy.confirmMetamaskPermissionToSpend>[0]
) {
cy.confirmMetamaskPermissionToSpend(params)
cy.confirmMetamaskPermissionToSpend(params)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this being called twice? typo? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish, but no, it's actually the reasonning behind this command

packages/arb-token-bridge-ui/tests/support/commands.ts Outdated Show resolved Hide resolved
Comment on lines 43 to 45
cy.confirmSpending({ spendLimit: '1' })
cy.wait(10_000)
cy.confirmMetamaskTransaction(undefined)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this changed and changed to a different way from the cctp approval?

packages/arb-token-bridge-ui/synpress.cctp.config.ts Outdated Show resolved Hide resolved
packages/arb-token-bridge-ui/synpress.cctp.config.ts Outdated Show resolved Hide resolved
packages/arb-token-bridge-ui/synpress.cctp.config.ts Outdated Show resolved Hide resolved
Comment on lines +33 to +35
if (!process.env.PRIVATE_KEY_CCTP) {
throw new Error('PRIVATE_KEY_CCTP variable missing.')
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is checked twice, see L42-44

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they are different keys, but the checks should be grouped together.

@fionnachan
Copy link
Member

additionally, is this PR meant to break the existing CCTP tests?

image

@chrstph-dvx chrstph-dvx marked this pull request as ready for review August 27, 2024 16:20
sourceWallet: Wallet
amount?: BigNumber
}) {
console.log(`Funding ETH to user wallet ${address}...`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs networkType in this function. We should add it again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably move the log outside then, it feels weird to pass a parameter only to log it

sourceWallet: Wallet
networkType: NetworkType
}) {
console.log('Funding USDC to user wallet...')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs networkType in log

cy.confirmMetamaskPermissionToSpend('1')
cy.confirmSpending('5')
cy.wait(10_000)
cy.rejectMetamaskTransaction()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we want to reject the transaction? We can assert by confirming the next metamask transaction too, right? That way we wouldn't need to wait and it'd be cleaner too!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to wait whether we reject or confirm

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the wait, but why are we rejecting the tx +1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rejecting is more likely to succeed than confirming. I don't mind accepting it though

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on our slack discussion, this is a hack that works best among all hacky options (checking for a UI element / try to confirm on the popup again / try to reject on the popup)

can we also add a comment here for our future selves and other teammates?

Comment on lines +33 to +35
if (!process.env.PRIVATE_KEY_CCTP) {
throw new Error('PRIVATE_KEY_CCTP variable missing.')
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they are different keys, but the checks should be grouped together.

@fionnachan fionnachan merged commit 476230d into master Sep 2, 2024
34 checks passed
@fionnachan fionnachan deleted the fs-729-add-cct-synpress-config branch September 2, 2024 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants