Skip to content

Commit 10bd7f4

Browse files
author
Nitish [C] Dhok
committed
kiro-cli e2e tests: implemented test case automation for kiro-cli them,kiro-cli theme --list,kiro-cli theme --help
1 parent 8455285 commit 10bd7f4

File tree

4 files changed

+74
-0
lines changed

4 files changed

+74
-0
lines changed

e2etests/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,4 @@ sub_integrations = [] # Kiro-Cli integrations subcommand
5353
setup_subcommands = [] # KIRO-CLI setup subcommand
5454
diagnostics = [] # KIRO-CLI diagnostics subcommand
5555
init_subcommand = [] # KIRO-CLI init subcommand
56+
theme_subcommand = [] # KIRO-CLI thenme subcomnmand

e2etests/tests/all_tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ mod sub_integrations;
1717
mod setup_subcommands;
1818
mod diagnostics;
1919
mod init_subcommand;
20+
mod theme_subcommand;
2021

2122
use q_cli_e2e_tests::q_chat_helper;
2223

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub mod test_kiro_cli_theme_subcommand;
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#[allow(unused_imports)]
2+
use q_cli_e2e_tests::q_chat_helper;
3+
4+
#[test]
5+
#[cfg(all(feature = "theme_subcommand", feature = "sanity"))]
6+
fn test_kiro_cli_theme_help_subcommand() -> Result<(), Box<dyn std::error::Error>> {
7+
println!("\n🔍 Testing kiro-cli theme --help ... | Description: Tests the <code> kiro-cli theme --help </code> subcommand to verify help options.");
8+
9+
println!("\n🔍 Executing 'kiro-cli theme --help' subcommand...");
10+
let response = q_chat_helper::execute_q_subcommand("kiro-cli", &["theme", "--help"])?;
11+
12+
println!("📝 FULL OUTPUT:");
13+
println!("{}", response);
14+
println!("📝 END OUTPUT");
15+
16+
assert!(response.contains("Usage:"), "Expected 'Usage:' in the output");
17+
assert!(response.contains("Options:"), "Expected 'Options:' in the output");
18+
assert!(response.contains("-h"), "Expected '-h' in the output");
19+
assert!(response.contains("--help"), "Expected '--help' in the output");
20+
21+
println!("✅ Kiro Cli theme --help subcommand executed successfully!");
22+
23+
Ok(())
24+
}
25+
26+
#[test]
27+
#[cfg(all(feature = "theme_subcommand", feature = "sanity"))]
28+
fn test_kiro_cli_theme_subcommand() -> Result<(), Box<dyn std::error::Error>> {
29+
println!("\n🔍 Testing kiro-cli theme ... | Description: Tests the <code> kiro-cli theme </code> subcommand to verify current theme.");
30+
31+
println!("\n🔍 Executing 'kiro-cli theme' subcommand...");
32+
let response = q_chat_helper::execute_q_subcommand("kiro-cli", &["theme"])?;
33+
34+
println!("📝 FULL OUTPUT:");
35+
println!("{}", response);
36+
println!("📝 END OUTPUT");
37+
38+
assert!(!response.is_empty(), "Expected non-empty output");
39+
assert!(!response.contains("Error"), "Should not contain error messages");
40+
41+
println!("✅ Kiro Cli theme subcommand executed successfully!");
42+
43+
Ok(())
44+
}
45+
46+
#[test]
47+
#[cfg(all(feature = "theme_subcommand", feature = "sanity"))]
48+
fn test_kiro_cli_theme_list_subcommand() -> Result<(), Box<dyn std::error::Error>> {
49+
println!("\n🔍 Testing kiro-cli theme --list ... | Description: Tests the <code> kiro-cli theme --list</code> subcommand to list all themes.");
50+
51+
println!("\n🔍 Executing 'kiro-cli theme' subcommand...");
52+
let response = q_chat_helper::execute_q_subcommand("kiro-cli", &["theme","--list"])?;
53+
54+
println!("📝 FULL OUTPUT:");
55+
println!("{}", response);
56+
println!("📝 END OUTPUT");
57+
58+
assert!(response.contains("the-unnamed"), "Expected 'the-unnamed' in the output");
59+
assert!(response.contains("palenight"), "Expected 'palenight' in the output");
60+
assert!(response.contains("solarized-light"), "Expected 'solarized-light' in the output");
61+
assert!(response.contains("dracula"), "Expected 'dracula' in the output");
62+
assert!(response.contains("github-dark"), "Expected 'github-dark' in the output");
63+
assert!(response.contains("nord"), "Expected 'nord' in the output");
64+
assert!(response.contains("gruvbox"), "Expected 'gruvbox' in the output");
65+
assert!(!response.is_empty(), "Expected non-empty output");
66+
assert!(!response.contains("Error"), "Should not contain error messages");
67+
68+
println!("✅ Kiro Cli theme --list subcommand executed successfully!");
69+
70+
Ok(())
71+
}

0 commit comments

Comments
 (0)