Skip to content

E2e tests#189

Open
nomadbitcoin wants to merge 8 commits intoKappaSigmaMu:mainfrom
nomadbitcoin:e2e-tests
Open

E2e tests#189
nomadbitcoin wants to merge 8 commits intoKappaSigmaMu:mainfrom
nomadbitcoin:e2e-tests

Conversation

@nomadbitcoin
Copy link

Add E2E testing infrastructure with Cypress for Polkadot wallet testing

  • Set up Cypress with TypeScript configuration optimized for blockchain operations (15s timeouts, 2x retries in CI)
  • Add GitHub Actions workflow for automated E2E testing with Chopsticks fork
  • Implement comprehensive smoke tests covering all routes (primary, explore, POI)
  • Create wallet connection tests with UI flow validation
  • Add connectWallet() custom command for reusable wallet testing
  • Add data-testid attributes to wallet components for reliable test selectors
  • Replace legacy Cypress setup (commands.js/index.js) with modern TypeScript support file

@netlify
Copy link

netlify bot commented Feb 9, 2026

Deploy Preview for dreamy-gates-ad44c0 ready!

Name Link
🔨 Latest commit 2b1ea96
🔍 Latest deploy log https://app.netlify.com/projects/dreamy-gates-ad44c0/deploys/698b9f389bb896000898a020
😎 Deploy Preview https://deploy-preview-189--dreamy-gates-ad44c0.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nomadbitcoin nomadbitcoin reopened this Feb 9, 2026
Copy link
Member

@laurogripa laurogripa left a comment

Choose a reason for hiding this comment

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

Good job!

Made a few requests, mostly related to keeping comments down to a minimum and reducing timeouts/waits whenever possible.

)
const Wallet = ({ wallet, setSelectedWallet }: { wallet: WalletType; setSelectedWallet: any }) => {
// Generate data-testid based on wallet title (e.g., "polkadot-js" -> "wallet-polkadot")
const testId = `wallet-${wallet.title.toLowerCase().replace(/[.\s]+/g, '-').replace(/-js$/, '')}`
Copy link
Member

Choose a reason for hiding this comment

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

Auxiliary test logic inside the component can be confusing (breaks SRP).
WDYT of extracting this into a helper file, so we can just import walletTestId and use it here?

Copy link
Author

Choose a reason for hiding this comment

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

We don't know how many elements are going to need such a thing, so I'm gonna create a more generic helper and include this one.

e2e: {
baseUrl: 'http://localhost:3000',
setupNodeEvents(on, config) {
// setupNodeEvents can be used for custom plugins in the future
Copy link
Member

Choose a reason for hiding this comment

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

Let's avoid "in the future" assumptions (YAGNI)

it(`should load ${name} (${path})`, () => {
cy.visit(path, { timeout: 5000 })

// Verify page body renders
Copy link
Member

Choose a reason for hiding this comment

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

Let's avoid self-explanatory commentary, and leave it for exceptional situations where the code alone is not readable enough

it(`should load ${name} page (${path})`, () => {
cy.visit(`${path}?rpc=ws://localhost:8000`, { timeout: 10000 })

// Verify page body renders
Copy link
Member

Choose a reason for hiding this comment

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

Same here

// Verify page body renders
cy.get('body').should('be.visible')

// Verify navigation exists
Copy link
Member

Choose a reason for hiding this comment

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

And here


describe('Wallet Connection UI Flow', () => {
beforeEach(() => {
cy.visit('/explore?rpc=ws://localhost:8000', { timeout: 30000 });
Copy link
Member

Choose a reason for hiding this comment

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

This timeout seems excessive. If the visit fails, the suite can take a long time to fail

describe('Wallet Connection UI Flow', () => {
beforeEach(() => {
cy.visit('/explore?rpc=ws://localhost:8000', { timeout: 30000 });
cy.wait(2000);
Copy link
Member

Choose a reason for hiding this comment

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

This wait can be excessive too, especially inside a beforeEach

viewportHeight: 720,

// Video and screenshot settings
video: true,
Copy link
Member

Choose a reason for hiding this comment

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

Video can significantly increase suite execution times. In my experience, screenshots are usually good enough

name: cypress-artifacts
path: |
cypress/screenshots/
cypress/videos/
Copy link
Member

Choose a reason for hiding this comment

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

I think we can remove videos and add the chopsticks logs to the artifacts

CHOPSTICKS_PID=$!
echo "CHOPSTICKS_PID=$CHOPSTICKS_PID" >> $GITHUB_ENV
echo "Chopsticks started with PID: $CHOPSTICKS_PID"
sleep 5
Copy link
Member

Choose a reason for hiding this comment

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

Just curious: why such a long sleep here?

Copy link
Author

Choose a reason for hiding this comment

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

Lots of failures due to timeout, even with only "sleep 3."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants