Skip to content

Commit 8455285

Browse files
author
Nitish [C] Dhok
committed
kiro-cli e2e tests: implemented test case automation for kiro-cli init -v nu pre and post command.
1 parent 3e2047f commit 8455285

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

e2etests/tests/init_subcommand/test_kiro_cli_init_subcommand.rs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,5 +658,62 @@ fn test_kiro_cli_init_v_fish_post_subommand() -> Result<(), Box<dyn std::error::
658658

659659
println!("✅ Kiro Cli init -v fish post subcommand executed successfully!");
660660

661+
Ok(())
662+
}
663+
664+
#[test]
665+
#[cfg(all(feature = "init_subcommand", feature = "sanity"))]
666+
fn test_kiro_cli_init_v_nu_post_subommand() -> Result<(), Box<dyn std::error::Error>> {
667+
println!("\n🔍 Testing kiro-cli init -v nu post ... | Description: Tests the <code> kiro-cli init -v nu post </code> subcommand to verify verbose nu -v post response.");
668+
669+
println!("\n🔍 Executing 'kiro-cli init -v nu post' subcommand...");
670+
let response = q_chat_helper::execute_q_subcommand("kiro-cli", &["init","-v","nu","post"])?;
671+
672+
println!("📝 FULL OUTPUT:");
673+
println!("{}", response);
674+
println!("📝 END OUTPUT");
675+
676+
assert!(response.contains("let-env Q_SHELL"), "Expected 'let-env Q_SHELL' in the output");
677+
assert!(response.contains("def-env fig_osc"), "Expected 'def-env fig_osc' in the output");
678+
assert!(response.contains("def-env print_fig_osc"), "Expected 'def-env print_fig_osc' in the output");
679+
assert!(response.contains("def-env fig_reset_hooks"), "Expected 'def-env fig_reset_hooks' in the output");
680+
assert!(response.contains("def-env fig_pre_execution_hook"), "Expected 'def-env fig_pre_execution_hook' in the output");
681+
assert!(response.contains("def-env fig_pre_prompt_hook"), "Expected 'def-env fig_pre_prompt_hook' in the output");
682+
assert!(response.contains("def-env fig_set_prompt"), "Expected 'def-env fig_set_prompt' in the output");
683+
assert!(response.contains("StartPrompt"), "Expected 'StartPrompt' in the output");
684+
assert!(response.contains("EndPrompt"), "Expected 'EndPrompt' in the output");
685+
assert!(response.contains("DoneSourcing"), "Expected 'DoneSourcing' in the output");
686+
assert!(!response.contains("should_launch"), "nu post should not contain terminal launch logic");
687+
688+
println!("✅ Kiro Cli init -v nu post subcommand executed successfully!");
689+
690+
Ok(())
691+
}
692+
693+
#[test]
694+
#[cfg(all(feature = "init_subcommand", feature = "sanity"))]
695+
fn test_kiro_cli_init_v_nu_pre_subommand() -> Result<(), Box<dyn std::error::Error>> {
696+
println!("\n🔍 Testing kiro-cli init -v nu pre ... | Description: Tests the <code> kiro-cli init -v nu pre </code> subcommand to verify verbose nu -v pre response.");
697+
698+
println!("\n🔍 Executing 'kiro-cli init -v nu pre' subcommand...");
699+
let response = q_chat_helper::execute_q_subcommand("kiro-cli", &["init","-v","nu","pre"])?;
700+
701+
println!("📝 FULL OUTPUT:");
702+
println!("{}", response);
703+
println!("📝 END OUTPUT");
704+
705+
assert!(response.contains("let-env Q_SHELL"), "Expected 'let-env Q_SHELL' in the output");
706+
assert!(response.contains("SHOULD_QTERM_LAUNCH"), "Expected 'SHOULD_QTERM_LAUNCH' in the output");
707+
assert!(response.contains("mkdir ~/.local/bin"), "Expected 'mkdir ~/.local/bin' in the output");
708+
assert!(response.contains("def pathadd"), "Expected 'def pathadd' in the output");
709+
assert!(response.contains("Q_NEW_SESSION"), "Expected 'Q_NEW_SESSION' in the output");
710+
assert!(response.contains("Q_SET_PARENT_CHECK"), "Expected 'Q_SET_PARENT_CHECK' in the output");
711+
assert!(response.contains("should-figterm-launch"), "Expected 'should-figterm-launch' in the output");
712+
assert!(response.contains("figterm_path"), "Expected 'figterm_path' in the output");
713+
assert!(response.contains("exec $figterm_path"), "Expected 'exec $figterm_path' in the output");
714+
assert!(!response.contains("fig_pre_execution_hook"), "nu pre should not contain execution hooks");
715+
716+
println!("✅ Kiro Cli init -v nu pre subcommand executed successfully!");
717+
661718
Ok(())
662719
}

0 commit comments

Comments
 (0)