Skip to content

E2e tests#189

Merged
laurogripa merged 9 commits intoKappaSigmaMu:mainfrom
nomadbitcoin:e2e-tests
Mar 24, 2026
Merged

E2e tests#189
laurogripa merged 9 commits intoKappaSigmaMu:mainfrom
nomadbitcoin:e2e-tests

Conversation

@nomadbitcoin
Copy link
Copy Markdown
Contributor

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
Copy Markdown

netlify bot commented Feb 9, 2026

Deploy Preview for dreamy-gates-ad44c0 ready!

Name Link
🔨 Latest commit 27820e7
🔍 Latest deploy log https://app.netlify.com/projects/dreamy-gates-ad44c0/deploys/69c30527c48091000764d8e3
😎 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
Copy Markdown
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.

Comment thread src/components/Wallets.tsx Outdated
)
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
Copy Markdown
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
Copy Markdown
Contributor 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.

Comment thread cypress.config.ts Outdated
e2e: {
baseUrl: 'http://localhost:3000',
setupNodeEvents(on, config) {
// setupNodeEvents can be used for custom plugins in the future
Copy link
Copy Markdown
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)

Comment thread cypress/e2e/smoke.cy.ts Outdated
it(`should load ${name} (${path})`, () => {
cy.visit(path, { timeout: 5000 })

// Verify page body renders
Copy link
Copy Markdown
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

Comment thread cypress/e2e/smoke.cy.ts Outdated
it(`should load ${name} page (${path})`, () => {
cy.visit(`${path}?rpc=ws://localhost:8000`, { timeout: 10000 })

// Verify page body renders
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same here

Comment thread cypress/e2e/smoke.cy.ts Outdated
// Verify page body renders
cy.get('body').should('be.visible')

// Verify navigation exists
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

And here

Comment thread cypress/e2e/wallet-connection.cy.ts Outdated

describe('Wallet Connection UI Flow', () => {
beforeEach(() => {
cy.visit('/explore?rpc=ws://localhost:8000', { timeout: 30000 });
Copy link
Copy Markdown
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

Comment thread cypress/e2e/wallet-connection.cy.ts Outdated
describe('Wallet Connection UI Flow', () => {
beforeEach(() => {
cy.visit('/explore?rpc=ws://localhost:8000', { timeout: 30000 });
cy.wait(2000);
Copy link
Copy Markdown
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

Comment thread cypress.config.ts Outdated
viewportHeight: 720,

// Video and screenshot settings
video: true,
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor 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."

@laurogripa laurogripa merged commit 556214f into KappaSigmaMu:main Mar 24, 2026
6 checks passed
@nomadbitcoin nomadbitcoin deleted the e2e-tests branch March 27, 2026 09:49
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