원클릭으로
e2e-tests
This skill should be used every time you create, update, or review end-to-end tests in this repository.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
This skill should be used every time you create, update, or review end-to-end tests in this repository.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | e2e-tests |
| description | This skill should be used every time you create, update, or review end-to-end tests in this repository. |
| compatibility | opencode |
This project uses exclusively E2E (end-to-end) tests. We do not write unit tests or integration tests. E2E tests verify complete user-facing workflows using real services, real data, and real API calls.
skills/nexus/context-driven-development/SKILL.md).## E2E Test Scenarios table in each context file defines what tests to write.test_ prefix) and Description column. The test_ prefix is automatically added when generating filenames and test functions. Never use test_ in the Name column..context/nexus-tui/TUI_001-sidebar-navigation.md → crates/nexus-tui/tests/tui_001_sidebar_navigation/.context/nexus-llm/RIG_001-oauth-authentication.md → crates/nexus-llm/tests/rig_001_oauth_authentication/TUI_001 → tui_001)test_<name>.rs where <name> is from the Name column.mod.rs that declares all test modules.Example context scenario table:
## Next Actions
| Description | Test |
|-------------|------|
| User creates session and knowledge is extracted | `session_creates_knowledge` |
| Malformed session is skipped with warning logged | `malformed_session_skipped` |
| Rate-limited API request retries with backoff | `rate_limit_retry` |
This produces the following test structure:
crates/nexus-rag/tests/ # Inside the crate directory
└── rag_002_session_watcher/ # Context ID (lowercase, underscores)
├── mod.rs # Declares: mod test_session_creates_knowledge;
├── test_session_creates_knowledge.rs
├── test_malformed_session_skipped.rs
└── test_rate_limit_retry.rs
Run tests with: cargo test -p nexus-rag --test rag_002_session_watcher
Each file contains a test function with the test_ prefix added:
#[test]
fn test_session_creates_knowledge() {
// Test implementation
}
CRITICAL: Never use test_ prefix in the Name column
The test_ prefix is automatically added to:
session_creates_knowledge → test_session_creates_knowledge.rstest_session_creates_knowledge()Using test_ in the Name column causes double-prefix errors:
test_menu_opens_view → test_test_menu_opens_view.rs ❌menu_opens_view → test_menu_opens_view.rs ✓The test-sync tool validates this and will report mismatches if found.
Example skip annotation (Rust):
#[test]
#[ignore = "Requires manual OAuth login - run with --ignored when credentials available"]
fn test_third_party_oauth_flow() {
// Test implementation
}
Example prompt pattern:
fn get_oauth_token() -> String {
if let Ok(token) = std::env::var("OAUTH_TOKEN") {
token
} else {
eprintln!("OAUTH_TOKEN not set. Please authenticate and provide token:");
// Read from stdin or fail gracefully
}
}
pub items exported from lib.rs). Never access private modules, internal constants, or unexported functions.BULLET_MARKERS, verify the rendered output contains the expected characters (●, ○, ◆, ◇).src/ if truly testing internal logic.Example - Wrong (accesses private constant):
use nexus_tui::markdown::styled_line::BULLET_MARKERS; // ❌ Private module
#[test]
fn test_bullet_markers() {
assert_eq!(BULLET_MARKERS[0], "● "); // ❌ Testing implementation
}
Example - Correct (tests observable output):
use nexus_tui::markdown::render_markdown_to_styled_lines;
#[test]
fn test_bullet_markers() {
let lines = render_markdown_to_styled_lines("- Item\n");
let rendered = lines[0].render(80);
let text: String = rendered[0].spans.iter()
.map(|s| s.content.to_string()).collect();
assert!(text.contains("●"), "Should render with bullet marker"); // ✓ Observable
}
mod::internal::*) are testing implementation, not behavior.~/.config/, ~/.local/, etc.)./tmp/ or similar.tests/test_utils.rs to set up isolated test environments consistently.setup_test_env() function returns a guard that automatically cleans up environment variables when dropped.Tests should override these paths to prevent touching real user data:
| Variable | Purpose | Test Value |
|---|---|---|
NEXUS_CONTEXT_DIR | Context file storage | /tmp/nexus_test_context/ |
NEXUS_STATE_FILE | TUI state persistence | /tmp/nexus_test/state.json |
NEXUS_SETTINGS_FILE | User settings | /tmp/nexus_test/settings.json |
NEXUS_RIG_TOKEN_PATH | OAuth tokens | /tmp/nexus_test/tokens.json |
NEXUS_RIG_SESSION_PATH | Chat session storage | /tmp/nexus_test/sessions |
Every E2E test that interacts with persisted state must use the shared isolation:
mod test_utils;
#[test]
fn test_something() {
let _guard = test_utils::setup_test_env();
// Test code here - all paths automatically redirected to /tmp/
// Guard cleanup happens automatically when test ends
}
All E2E tests run via justfile recipes:
just test-e2e # Run all E2E tests
just test-e2e-verbose # Run with detailed output
Comprehensive guide for the ratkit Rust TUI component library built on ratatui 0.29, including feature flags, APIs, and implementation patterns. Use when building, debugging, or extending ratkit applications and examples.
Use this skill for all context planning, creation, updates, review, search, and sync work in this repository.
This skill should be used every time you generate, refresh, or validate codebase-derived SKILL.md documentation for this repository.
Use this skill when working on Nexus context workflows, CDD specifications, or deriving reusable skills from repository code.
This skill should be used every time you work on justfile projects or just command changes in this repository.
This skill should be used every time you work on Next.js projects or Next.js app code changes in this repository.