Struct AllureAttachmentXml
Allure representation of an atachment. It will copy the file to the allure folder with an unique name
struct AllureAttachmentXml
;
Constructors
Name | Description |
---|---|
this
(destination, attachment, indent, uuid)
|
Init the struct and copy the atachment to the allure folder |
Methods
Name | Description |
---|---|
toString
()
|
convert the attachment to string |
Example
Allure attachments should be copied to a folder containing the suite name
string resource = buildPath(getcwd(), "some_image.png");
std .file .write(resource, "");
auto uuid = randomUUID .toString;
auto expectedPath = buildPath(getcwd(), "allure", uuid, "name.0.some_image.png");
scope(exit) {
rmdirRecurse("allure");
}
auto a = AllureAttachmentXml("allure", Attachment("name", resource, ""), 0, uuid);
expectedPath .exists .should .equal(true);
Example
Allure attachments should avoid name collisions
string resource = buildPath(getcwd(), "some_image.png");
std .file .write(resource, "");
auto uuid = randomUUID .toString;
buildPath(getcwd(), "allure", uuid) .mkdirRecurse;
auto expectedPath = buildPath(getcwd(), "allure", uuid, "name.1.some_image.png");
auto existingPath = buildPath(getcwd(), "allure", uuid, "name.0.some_image.png");
std .file .write(existingPath, "");
scope(exit) {
rmdirRecurse("allure");
}
auto a = AllureAttachmentXml("allure", Attachment("name", resource, ""), 0, uuid);
expectedPath .exists .should .equal(true);