-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/UI nodes UI tests #5
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
Conversation
WalkthroughAdds NodeProtocol and NodeConfig to control_panel/node.py and exposes them via the Node constructor; and introduces a full UI test suite for node deployment: new test constants, locators, a NodeDeploymentPage page object, and multiple end-to-end tests for wizard flows, creation, verification, listing, and deletion. Changes
Sequence DiagramsequenceDiagram
participant User
participant UI as Node Deployment UI
participant Page as NodeDeploymentPage
participant API as ApiClient
User->>UI: Open Nodes list
User->>UI: Click "Add node"
UI->>Page: Load protocol selection
User->>Page: Search/select protocol
Page->>Page: Enable configuration selection
User->>Page: Select configuration
User->>Page: Click "Show summary"
Page->>Page: Verify summary and click "Create node"
Page->>API: POST create node (capture node id)
API-->>Page: Return node id/info
Page->>Page: Poll status (Bootstrapping → Running)
API-->>Page: Provide status updates
Page->>Page: Fetch node details for UI/API cross-check
User->>UI: Search/list nodes
User->>Page: Delete node (confirm)
Page->>API: DELETE node
API-->>Page: Acknowledge deletion
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@tests/ui/pages/node_deployment_page.py`:
- Around line 39-45: The method verify_protocol_selected currently creates
card_selector via self.locators.protocol_card_by_name(protocol_name) but never
uses it, causing a lint error and not validating the UI; update
verify_protocol_selected to use the card_selector locator to assert the protocol
card is visible/selected (for example, call
expect(self.page.locator(card_selector)).to_be_visible() or check a selected
state like to_have_attribute("aria-selected", "true") /
to_have_class("selected") as appropriate) and keep the existing check for
SELECT_CONFIG_BUTTON to_be_enabled(); use the symbols verify_protocol_selected,
card_selector, locators.protocol_card_by_name, and SELECT_CONFIG_BUTTON to
locate the code to change.
- Around line 316-384: The get_node_list_info method calls
text_content().strip() on several locators which can return None; update each
extraction in get_node_list_info to guard against None by using
(row.locator(...).text_content() or "").strip() for "name", "network",
"created_at", "updated_at", and "status" so .strip() never runs on None; no
changes needed in verify_node_list_info other than relying on the updated
get_node_list_info output.
🧹 Nitpick comments (2)
tests/ui/pages/node_deployment_page.py (1)
213-223: PreferNODE_STATUS_MAX_WAITfor the default timeout.Avoid the magic number to keep wait settings centralized in
ui_constants.♻️ Suggested update
-from tests.ui.constants.ui_constants import TIMEOUT_MAX +from tests.ui.constants.ui_constants import TIMEOUT_MAX, NODE_STATUS_MAX_WAIT-def wait_for_particular_status(self, expected_status: str, timeout: int = 120000): +def wait_for_particular_status(self, expected_status: str, timeout: int = NODE_STATUS_MAX_WAIT):tests/ui/test_node_deployment_e2e.py (1)
134-252: UseNodeProtocol/NodeConfigconstants for test inputs.This keeps UI labels centralized and reduces drift across tests.
♻️ Suggested update
- protocol_name = "Ethereum Sepolia Reth Prysm" + protocol_name = NodeProtocol.ETH_SEPOLIA ... - config_name = "Ethereum Sepolia Reth Prysm Nano" + config_name = NodeConfig.ETH_SEPOLIA_NANO ... - deployment_page.select_protocol("Ethereum Sepolia Reth Prysm") + deployment_page.select_protocol(NodeProtocol.ETH_SEPOLIA) ... - deployment_page.select_configuration("Ethereum Sepolia Reth Prysm Nano") + deployment_page.select_configuration(NodeConfig.ETH_SEPOLIA_NANO)
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.