Conversation
Add end-to-end testing infrastructure with smoke tests for basic application health checks
✅ Deploy Preview for dreamy-gates-ad44c0 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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$/, '')}` |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
cypress.config.ts
Outdated
| e2e: { | ||
| baseUrl: 'http://localhost:3000', | ||
| setupNodeEvents(on, config) { | ||
| // setupNodeEvents can be used for custom plugins in the future |
There was a problem hiding this comment.
Let's avoid "in the future" assumptions (YAGNI)
cypress/e2e/smoke.cy.ts
Outdated
| it(`should load ${name} (${path})`, () => { | ||
| cy.visit(path, { timeout: 5000 }) | ||
|
|
||
| // Verify page body renders |
There was a problem hiding this comment.
Let's avoid self-explanatory commentary, and leave it for exceptional situations where the code alone is not readable enough
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 |
cypress/e2e/smoke.cy.ts
Outdated
| // Verify page body renders | ||
| cy.get('body').should('be.visible') | ||
|
|
||
| // Verify navigation exists |
cypress/e2e/wallet-connection.cy.ts
Outdated
|
|
||
| describe('Wallet Connection UI Flow', () => { | ||
| beforeEach(() => { | ||
| cy.visit('/explore?rpc=ws://localhost:8000', { timeout: 30000 }); |
There was a problem hiding this comment.
This timeout seems excessive. If the visit fails, the suite can take a long time to fail
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); |
There was a problem hiding this comment.
This wait can be excessive too, especially inside a beforeEach
cypress.config.ts
Outdated
| viewportHeight: 720, | ||
|
|
||
| // Video and screenshot settings | ||
| video: true, |
There was a problem hiding this comment.
Video can significantly increase suite execution times. In my experience, screenshots are usually good enough
| name: cypress-artifacts | ||
| path: | | ||
| cypress/screenshots/ | ||
| cypress/videos/ |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Just curious: why such a long sleep here?
There was a problem hiding this comment.
Lots of failures due to timeout, even with only "sleep 3."
5b3bcaf to
32eee79
Compare
32eee79 to
a98ca17
Compare
Add E2E testing infrastructure with Cypress for Polkadot wallet testing