pub struct AllureWriter { /* private fields */ }Expand description
Writer for Allure test result files.
Implementations§
Source§impl AllureWriter
impl AllureWriter
Sourcepub fn with_results_dir(path: impl AsRef<Path>) -> Self
pub fn with_results_dir(path: impl AsRef<Path>) -> Self
Creates a new writer with a custom results directory.
Sourcepub fn results_dir(&self) -> &Path
pub fn results_dir(&self) -> &Path
Returns the results directory path.
Sourcepub fn init(&self, clean: bool) -> Result<()>
pub fn init(&self, clean: bool) -> Result<()>
Initializes the results directory, optionally cleaning it first.
Sourcepub fn write_test_result(&self, result: &TestResult) -> Result<PathBuf>
pub fn write_test_result(&self, result: &TestResult) -> Result<PathBuf>
Writes a test result to a JSON file.
Sourcepub fn write_container(
&self,
container: &TestResultContainer,
) -> Result<PathBuf>
pub fn write_container( &self, container: &TestResultContainer, ) -> Result<PathBuf>
Writes a container to a JSON file.
Sourcepub fn write_text_attachment(
&self,
name: impl Into<String>,
content: impl AsRef<str>,
) -> Result<Attachment>
pub fn write_text_attachment( &self, name: impl Into<String>, content: impl AsRef<str>, ) -> Result<Attachment>
Writes a text attachment and returns the Attachment reference.
Sourcepub fn write_json_attachment<T: Serialize>(
&self,
name: impl Into<String>,
value: &T,
) -> Result<Attachment>
pub fn write_json_attachment<T: Serialize>( &self, name: impl Into<String>, value: &T, ) -> Result<Attachment>
Writes a JSON attachment and returns the Attachment reference.
Sourcepub fn write_binary_attachment(
&self,
name: impl Into<String>,
content: &[u8],
content_type: ContentType,
) -> Result<Attachment>
pub fn write_binary_attachment( &self, name: impl Into<String>, content: &[u8], content_type: ContentType, ) -> Result<Attachment>
Writes a binary attachment and returns the Attachment reference.
Sourcepub fn write_binary_attachment_with_mime(
&self,
name: impl Into<String>,
content: &[u8],
mime_type: impl Into<String>,
extension: impl AsRef<str>,
) -> Result<Attachment>
pub fn write_binary_attachment_with_mime( &self, name: impl Into<String>, content: &[u8], mime_type: impl Into<String>, extension: impl AsRef<str>, ) -> Result<Attachment>
Writes a binary attachment with a custom MIME type.
Sourcepub fn copy_file_attachment(
&self,
name: impl Into<String>,
source_path: impl AsRef<Path>,
content_type: Option<ContentType>,
) -> Result<Attachment>
pub fn copy_file_attachment( &self, name: impl Into<String>, source_path: impl AsRef<Path>, content_type: Option<ContentType>, ) -> Result<Attachment>
Copies a file as an attachment and returns the Attachment reference.
Sourcepub fn write_environment(
&self,
properties: &[(String, String)],
) -> Result<PathBuf>
pub fn write_environment( &self, properties: &[(String, String)], ) -> Result<PathBuf>
Writes the environment.properties file.
Keys and values are escaped according to the Java Properties file format.
Sourcepub fn write_categories(&self, categories: &[Category]) -> Result<PathBuf>
pub fn write_categories(&self, categories: &[Category]) -> Result<PathBuf>
Writes the categories.json file.
Trait Implementations§
Source§impl Clone for AllureWriter
impl Clone for AllureWriter
Source§fn clone(&self) -> AllureWriter
fn clone(&self) -> AllureWriter
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AllureWriter
impl Debug for AllureWriter
Auto Trait Implementations§
impl Freeze for AllureWriter
impl RefUnwindSafe for AllureWriter
impl Send for AllureWriter
impl Sync for AllureWriter
impl Unpin for AllureWriter
impl UnwindSafe for AllureWriter
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)