-
-
Notifications
You must be signed in to change notification settings - Fork 2
fix: correct corrupted README.md and CONTRIBUTING.md documentation #400
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Review completed. Found 2 issues with incorrect API usage in code examples. Issues Found
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
README.md
Outdated
| test('connect wallet and interact', async () => { | ||
| const { page, wallet } = await createOnchainTest(config); | ||
|
|
||
| await page.goto('https://your-dapp.com'); | ||
| await wallet.connect(); | ||
|
|
||
| // Your test logic here | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Quick Start example contains incorrect API usage. Based on the source code in src/createOnchainTest.ts, createOnchainTest() returns a Playwright test instance, not a direct object with page and wallet. The correct pattern is:
const test = createOnchainTest(config);
test('connect wallet and interact', async ({ page, metamask }) => {
await page.goto('https://your-dapp.com');
await metamask.handleAction('connect', { shouldApprove: true });
// Your test logic here
});Key differences: (1) Don't await createOnchainTest() - it returns a test instance, (2) Access fixtures via test callback parameters, (3) The wallet fixture is named metamask not wallet, (4) Use handleAction('connect', ...) instead of .connect().
Fix it with Roo Code or mention @roomote and request a fix.
Review completed. Found 1 issue with incorrect API usage in the Quick Start example that needs correction. Issues Found
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
README.md
Outdated
| test('connect wallet and interact', async () => { | ||
| const { page, wallet } = await createOnchainTest(config); | ||
|
|
||
| await page.goto('https://your-dapp.com'); | ||
| await wallet.connect(); | ||
|
|
||
| // Your test logic here | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Quick Start example contains incorrect API usage. Based on createOnchainTest(), it returns a Playwright test instance, not an object with page and wallet. The correct pattern is:
const test = createOnchainTest(config);
test('connect wallet and interact', async ({ page, metamask }) => {
await page.goto('https://your-dapp.com');
await metamask.handleAction('connect', { shouldApprove: true });
// Your test logic here
});Key differences: (1) Don't await createOnchainTest() - it returns a test instance, (2) Access fixtures via test callback parameters, (3) The wallet fixture is named metamask not wallet, (4) Use handleAction('connect', ...) instead of .connect().
Fix it with Roo Code or mention @roomote and request a fix.
| test('should connect MetaMask wallet successfully', async () => { | ||
| // Arrange - Set up test conditions | ||
| const config = configure() | ||
| .withMetaMask() | ||
| .withSeedPhrase({ | ||
| seedPhrase: process.env.E2E_TEST_SEED_PHRASE!, | ||
| password: 'TestPassword123' | ||
| }) | ||
| .build(); | ||
|
|
||
| // Act - Perform the action | ||
| const { page, wallet } = await createOnchainTest(config); | ||
| await page.goto('https://test-dapp.com'); | ||
| await wallet.connect(); | ||
|
|
||
| // Assert - Verify the outcome | ||
| expect(await wallet.isConnected()).toBe(true); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test example contains incorrect API usage. Based on createOnchainTest(), it returns a Playwright test instance, not an object with page and wallet. The correct pattern is:
const test = createOnchainTest(config);
test('should connect MetaMask wallet successfully', async ({ page, metamask }) => {
// Arrange - Set up test conditions
await page.goto('https://test-dapp.com');
// Act - Perform the action
await metamask.handleAction('connect', { shouldApprove: true });
// Assert - Verify the outcome
expect(await metamask.isConnected()).toBe(true);
});Key differences: (1) Don't await createOnchainTest() - it returns a test instance, (2) Access fixtures via test callback parameters, (3) The wallet fixture is named metamask not wallet, (4) Use handleAction('connect', ...) instead of .connect().
Fix it with Roo Code or mention @roomote and request a fix.
Description
Fixed severely corrupted README.md and CONTRIBUTING.md files that contained completely incorrect content from an unrelated project. The README contained Python/Java/C++ enterprise development content, while the CONTRIBUTING guide referenced a different project (learnxinyminutes).
Type of Change
Changes Made
Testing
Test Commands Run
New Tests Added
Documentation
Wallet Compatibility
If this PR affects wallet functionality, confirm testing with:
Configuration Changes
If this PR changes configuration APIs:
Breaking Changes
If this is a breaking change:
Checklist
Additional Context
The README.md and CONTRIBUTING.md files were severely corrupted with content from completely different projects:
This PR restores proper OnChainTestKit documentation based on:
Related Issues
Fixes documentation corruption issue
View task on Roo Code Cloud