private void AssertXenonActionThrowsWithMessage( Func <BaseXenonTest <T>, XenonElementsFinderTestCase, BaseXenonTest <T> > xenonAction, XenonElementsFinderTestCase testCase) { using (var browserTest = CreateBrowserTest()) { var browser = CreateInstance(browserTest.Start()); var exception = Assert.Throws <NoElementsFoundException>(() => xenonAction(browser, testCase)); Assert.True(testCase.SearchIdentifiers.All(x => exception.Message.Contains(x))); } }
public void RightClickNonExistentElement_IncludesTextInException(XenonElementsFinderTestCase testCase) { AssertXenonActionThrowsWithMessage((x, tc) => x.RightClick(tc.SearchCriteria), testCase); }