class TestStep(IterAttachmentsMixin, xmlfied('step', name=Element(), title=Element().if_(lambda x: x), attachments=WrappedMany(Nested()), steps=WrappedMany(Nested()), start=Attribute(), stop=Attribute(), status=Attribute())): pass
class TestSuite( xmlfied('test-suite', namespace=ALLURE_NAMESPACE, name=Element(), title=Element().if_(lambda x: x), description=Element().if_(lambda x: x), tests=WrappedMany(Nested(), name='test-cases'), labels=WrappedMany(Nested()), start=Attribute(), stop=Attribute())): pass
def test_attribute(): AttrTest = xmlfied('attr_test', foo=Attribute()) a = AttrTest(foo='bar') assert_that(etree.tostring(a.toxml()), string_contains_in_order('<attr_test', 'foo=', '"bar"', ">"))
class TestCase( IterAttachmentsMixin, xmlfied( 'test-case', id=Ignored(), # internal field, see AllureTestListener name=Element(), title=Element().if_(lambda x: x), description=Element().if_(lambda x: x), failure=Nested().if_(lambda x: x), steps=WrappedMany(Nested()), attachments=WrappedMany(Nested()), labels=WrappedMany(Nested()), status=Attribute(), start=Attribute(), stop=Attribute())): pass
def test_nested(): Top = xmlfied('top', foo=Nested()) Down = xmlfied('down', bar=Element(), baz=Attribute()) d = Down(bar='123', baz='456') t = Top(foo=d) assert_that( etree.tostring(t.toxml()), string_contains_in_order('<top>', '<down', 'baz=', '"456"', '<bar>', '123', '</bar>', '</down>', '</top>'))
''' This holds allure report xml structures Created on Oct 23, 2013 @author: pupssman ''' from allure.rules import xmlfied, Attribute, Element, Many, Nested from allure.constants import ALLURE_NAMESPACE Attach = xmlfied('attachment', source=Attribute(), title=Attribute(), type=Attribute()) Failure = xmlfied('failure', message=Element(), trace=Element('stack-trace')) TestCase = xmlfied('test-case', name=Element(), title=Element().if_(lambda x: x), description=Element().if_(lambda x: x), failure=Nested().if_(lambda x: x), steps=Many(Nested()), attachments=Many(Nested()), labels=Many(Nested()), status=Attribute(), start=Attribute(), stop=Attribute(), severity=Attribute())
class TestLabel(xmlfied('label', name=Attribute(), value=Attribute())): pass
class Attach( xmlfied('attachment', source=Attribute(), title=Attribute(), type=Attribute())): """