c# - Selenium Reporting in XUnit -
senario:
creating test xunit framework.
[theory] [classdata(typeof(testdateobjectrepo))] public void testmethod1(testdateobject testdata) { //arrange ... arrange somthing prep test; //act bool result = application.uikeywords().login(testdata); //assert done fluentassertion result.should().betrue(); } as fixture [theory] , [classdata] because create testdata objects different sources.
in addition ddt use keyword architecture. each keyword collection of selenium actions. example keyword login collection of action
click.usernametextbox
sendkeys.usernametextbox(testdata.username)
click.passwordtextbox
sendkeys.passwordtextbox(testdata.username)
click.loginbutton
findelement(thiselementconfirmsthatloginwassuccessful)
you idea.
problem:
i want implement instant reporting -> restcall jira's xray. not problem long testcase fails within assert section of test. however. how can catch exception (without try/catch around keywords there around 100-150 keywords) thrown action in keyword. there no testcontext deliverd xunit test calls it's "after" method. after methode in "" because in xunit there no aftermethod per definition dispose class called after every test.
i know rather global q , not test-automation related q i'm stuck one. hint or maybe best practice tip appriciated.
thanks :-)
Comments
Post a Comment