Attribute Macro play_test
#[play_test]Expand description
Attribute macro for Play framework tests
Transforms an async test function that takes a Play parameter into a properly
configured tokio test with automatic cleanup.
§Example
ⓘ
use bitwarden_test::play::{play_test, Play, SingleUserArgs, SingleUserScene};
#[play_test]
async fn test_user_login(play: Play) {
let args = SingleUserArgs {
email: "[email protected]".to_string(),
..Default::default()
};
let scene = play.scene::<SingleUserScene>(&args).await.unwrap();
// Cleanup happens automatically when the test completes
}The macro transforms the above into:
ⓘ
#[tokio::test]
async fn test_user_login() {
::bitwarden_test::play::Play::builder()
.run(|play: Play| async move {
// original test body
})
.await;
}