QA Challenge – RaylsToken Integration Tests#4
Open
Johws wants to merge 7 commits intoraylsnetwork:mainfrom
Open
QA Challenge – RaylsToken Integration Tests#4Johws wants to merge 7 commits intoraylsnetwork:mainfrom
Johws wants to merge 7 commits intoraylsnetwork:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request: RaylsToken E2E Tests
Overview
This PR implements a full End-to-End (E2E) test suite for the RaylsToken smart contract. The tests cover deployment, token minting, transfers, approvals, and burning, using three distinct accounts as required by the challenge:
Owner / Deployer (provided private key)
**User A (generated)
User B (generated)**
The test suite uses the Page Object Pattern (RaylsTokenPO) to abstract contract interactions, improving maintainability and readability.
How to Run the Tests
Locally (Hardhat network)
npx hardhat test
Uses the default Hardhat local network
The Owner account is configured with the provided private key
User A and User B are generated as local Ethereum addresses by Hardhat
All tests pass locally
On Rayls Devnet
npx hardhat test --network rayls_devnet
RPC, chain ID, and private keys for all three accounts must be configured
HardhatError: HH110: Invalid JSON-RPC response received: error code: 522
Local tests are passing and correctly simulate transfers, minting, approvals, and burning.
Design Patterns Used
Page Object Model (PO):
The RaylsTokenPO class abstracts direct interactions with the contract (mint, burn, approve, transferFrom), making tests cleaner.
Fixtures / Helpers:
Before each suite, wallets are instantiated and initial ETH transfers are performed to prepare accounts for testing.
Notes
Tests are written in TypeScript using Hardhat + Ethers v6 + Chai
The Owner account must have enough tokens on Devnet to fund User A and User B
Test Coverage
The following features are covered:
Deployment and initial supply assignment
Minting (owner only)
Token transfers and approvals
Burning tokens
Gas estimation for minting
Event emission validation (Transfer, Approval)
Summary
Tests pass locally
Devnet connection currently fails due to RPC 522 error
Code follows the challenge requirements and uses proper abstractions (PO model)