pub struct TestScenario {
pub name: String,
pub description: Option<String>,
pub timeout: u64,
pub stop_on_failure: bool,
pub variables: HashMap<String, Value>,
pub setup: Vec<TestStep>,
pub steps: Vec<TestStep>,
pub cleanup: Vec<TestStep>,
}Expand description
Represents a test scenario file that defines a sequence of MCP operations
Fields§
§name: StringName of the test scenario
description: Option<String>Description of what the scenario tests
timeout: u64Timeout for the entire scenario (in seconds)
stop_on_failure: boolWhether to stop on first failure
variables: HashMap<String, Value>Variables that can be used in the steps
setup: Vec<TestStep>Setup steps to run before the test
steps: Vec<TestStep>The main test steps
cleanup: Vec<TestStep>Cleanup steps to run after the test
Implementations§
Source§impl TestScenario
impl TestScenario
Sourcepub fn from_yaml_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_yaml_file<P: AsRef<Path>>(path: P) -> Result<Self>
Load a test scenario from a YAML file
Sourcepub fn from_json_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_json_file<P: AsRef<Path>>(path: P) -> Result<Self>
Load a test scenario from a JSON file
Trait Implementations§
Source§impl Clone for TestScenario
impl Clone for TestScenario
Source§fn clone(&self) -> TestScenario
fn clone(&self) -> TestScenario
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TestScenario
impl Debug for TestScenario
Source§impl<'de> Deserialize<'de> for TestScenario
impl<'de> Deserialize<'de> for TestScenario
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TestScenario
impl RefUnwindSafe for TestScenario
impl Send for TestScenario
impl Sync for TestScenario
impl Unpin for TestScenario
impl UnsafeUnpin for TestScenario
impl UnwindSafe for TestScenario
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more