本文整理汇总了Java中ru.yandex.qatools.allure.annotations.Issue类的典型用法代码示例。如果您正苦于以下问题:Java Issue类的具体用法?Java Issue怎么用?Java Issue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Issue类属于ru.yandex.qatools.allure.annotations包,在下文中一共展示了Issue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createIssuesArray
import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
private Issue[] createIssuesArray(List<String> issues) {
ArrayList<Issue> values = new ArrayList<>();
for (final String issue : issues) {
values.add(new Issue() {
@Override
public Class<Issue> annotationType() {
return Issue.class;
}
@Override
public String value() {
return issue;
}
});
}
return values.toArray(new Issue[values.size()]);
}
示例2: getIssueOrTestCaseIdValue
import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
/**
* Get issue or test case ID for a method.
*
* @param method the method to check for test ID annotations.
* @return Optional of the {@link TestCaseId} or {@link Issue} value.
* @throws IllegalStateException if {@link TestCaseId} and {@link Issue}
* are both specified inconstantly.
*/
public static Optional<String> getIssueOrTestCaseIdValue(Method method) {
TestCaseId tcIdAnnotation = method.getAnnotation(TestCaseId.class);
Issue issueAnnotation = method.getAnnotation(Issue.class);
if (!isNull(issueAnnotation) && !isNull(tcIdAnnotation)
&& !issueAnnotation.value().equals(tcIdAnnotation.value())) {
throw new IllegalStateException(
"TestCaseId and Issue annotation are both specified but "
+ "not equal for method: " + method.toString());
}
if (!isNull(issueAnnotation)) {
return Optional.of(issueAnnotation.value());
} else if (!isNull(tcIdAnnotation)) {
return Optional.of(tcIdAnnotation.value());
} else {
return Optional.empty();
}
}
示例3: component_example_test
import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Issue("CET-1")
@Test(description = "Simple test showing the use of components")
public final void component_example_test() {
// Navigate to homepage then use the nav bar to go to the explore page
ExplorePage explorePage = HomePage.open().then().with().theHeader().clickExplore();
// not a great assertion, improving this is an exercise for the reader
assertThat(explorePage.getTitle()).isEqualTo("Explore · GitHub");
// Search for "Selenium" and check SeleniumHQ/selenium is one of the returned repos.
List<String> searchResults = explorePage.with().theHeader()
.search("Selenium")
.getRepoNames();
assertThat(searchResults).contains("SeleniumHQ/selenium");
}
示例4: testFilterRequestForwarded
import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Test
@Issue("issues/275")
public void testFilterRequestForwarded() throws IOException, ServletException, ParserConfigurationException, SAXException, ScriptException {
SniffyFilter filter = new SniffyFilter();
filter.init(getFilterConfig());
answerWithContent("<html><head><title>Title</title></head><body>Hello, World!</body></html>");
FilterChain outerFilterChain = mock(FilterChain.class);
doAnswer(invocation -> {
HttpServletRequest request = (HttpServletRequest) invocation.getArguments()[0];
HttpServletResponse response = (HttpServletResponse) invocation.getArguments()[1];
filter.doFilter(request, response, filterChain);
return null;
}).when(outerFilterChain).doFilter(any(), any());
filter.doFilter(requestWithPathAndQueryParameter, httpServletResponse, outerFilterChain);
String sniffyJsSrc = extractSniffyJsSrc(httpServletResponse.getContentAsString());
assertTrue(sniffyJsSrc + " must be a relative path", sniffyJsSrc.startsWith("../" + SNIFFY_URI_PREFIX));
String requestDetailsUrl = httpServletResponse.getHeader(HEADER_REQUEST_DETAILS);
assertTrue(requestDetailsUrl + " must be a relative path", requestDetailsUrl.startsWith("../" + REQUEST_URI_PREFIX));
}
示例5: testGetBestRelativeURIForPathMapping
import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Test
@Issue("issues/272")
public void testGetBestRelativeURIForPathMapping() {
HttpServletRequest req = mock(HttpServletRequest.class);
when(req.getRequestURI()).thenReturn("/application/bar/baz");
when(req.getContextPath()).thenReturn("/application");
when(req.getServletPath()).thenReturn("/bar");
when(req.getPathInfo()).thenReturn("/baz");
ServletContext sc = mock(ServletContext.class);
when(req.getServletContext()).thenReturn(sc);
Map<String,ServletRegistration> servletRegistrations = new HashMap<>();
when(sc.getServletRegistrations()).thenAnswer(inv -> servletRegistrations);
ServletRegistration sr = mock(ServletRegistration.class);
when(sr.getMappings()).thenReturn(Collections.singletonList("/bar/*"));
servletRegistrations.put("ServletName", sr);
assertEquals("/baz", SniffyRequestProcessor.getBestRelativeURI(req));
}
示例6: testGetBestRelativeURIForPathMappingWithoutTrailingSlash
import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Test
@Issue("issues/272")
public void testGetBestRelativeURIForPathMappingWithoutTrailingSlash() {
HttpServletRequest req = mock(HttpServletRequest.class);
when(req.getRequestURI()).thenReturn("/application/bar");
when(req.getContextPath()).thenReturn("/application");
when(req.getServletPath()).thenReturn("/bar");
when(req.getPathInfo()).thenReturn(null);
ServletContext sc = mock(ServletContext.class);
when(req.getServletContext()).thenReturn(sc);
Map<String,ServletRegistration> servletRegistrations = new HashMap<>();
when(sc.getServletRegistrations()).thenAnswer(inv -> servletRegistrations);
ServletRegistration sr = mock(ServletRegistration.class);
when(sr.getMappings()).thenReturn(Collections.singletonList("/bar/*"));
servletRegistrations.put("ServletName", sr);
assertEquals("", SniffyRequestProcessor.getBestRelativeURI(req));
}
示例7: testGetBestRelativeURIForExactMatch
import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Test
@Issue("issues/272")
public void testGetBestRelativeURIForExactMatch() {
HttpServletRequest req = mock(HttpServletRequest.class);
when(req.getRequestURI()).thenReturn("/application/bar/");
when(req.getContextPath()).thenReturn("/application");
when(req.getServletPath()).thenReturn("/bar/");
when(req.getPathInfo()).thenReturn(null);
ServletContext sc = mock(ServletContext.class);
when(req.getServletContext()).thenReturn(sc);
Map<String,ServletRegistration> servletRegistrations = new HashMap<>();
when(sc.getServletRegistrations()).thenAnswer(inv -> servletRegistrations);
ServletRegistration sr = mock(ServletRegistration.class);
when(sr.getMappings()).thenReturn(Collections.singletonList("/bar/"));
servletRegistrations.put("ServletName", sr);
assertEquals("/", SniffyRequestProcessor.getBestRelativeURI(req));
}
示例8: testGetBestRelativeURIForExtensionMapping
import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Test
@Issue("issues/272")
public void testGetBestRelativeURIForExtensionMapping() {
HttpServletRequest req = mock(HttpServletRequest.class);
when(req.getRequestURI()).thenReturn("/application/bar/baz.do");
when(req.getContextPath()).thenReturn("/application");
when(req.getServletPath()).thenReturn("/bar/baz.do");
when(req.getPathInfo()).thenReturn(null);
ServletContext sc = mock(ServletContext.class);
when(req.getServletContext()).thenReturn(sc);
Map<String,ServletRegistration> servletRegistrations = new HashMap<>();
when(sc.getServletRegistrations()).thenAnswer(inv -> servletRegistrations);
ServletRegistration sr = mock(ServletRegistration.class);
when(sr.getMappings()).thenReturn(Collections.singletonList("*.do"));
servletRegistrations.put("ServletName", sr);
assertEquals("/bar/baz.do", SniffyRequestProcessor.getBestRelativeURI(req));
}
示例9: getLinks
import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
public List<Link> getLinks() {
final Method method = getMethod();
final List<Link> links = new ArrayList<>();
links.addAll(Allure1Utils.getLinks(method, TestCaseId.class, Allure1Utils::createLinks));
links.addAll(Allure1Utils.getLinks(method, Issue.class, Allure1Utils::createLinks));
links.addAll(Allure1Utils.getLinks(method, Issues.class, Allure1Utils::createLinks));
return links;
}
示例10: testSomething
import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Title("testcase")
@Description("testcase description")
@Issue("ISSUE-2")
@Issues(@Issue("ISSUE-22"))
@TestCaseId("TEST-1")
@Stories("story2")
@Features("feature2")
@Severity(SeverityLevel.CRITICAL)
@org.testng.annotations.Test
public void testSomething() {
}
示例11: testAddTodoItem
import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Issue("TODOMVC-1")
@Stories("Add a Todo Item")
@Test(description = "Add an item")
public void testAddTodoItem() {
boolean iResult = BasicTodoMvcPage.open().then()
.addTodoItem("FirstItem");
Assert.assertTrue("1. I want to add a To-do item", iResult);
}
示例12: testEditTodoItem
import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Issue("TODOMVC-2")
@Stories("Edit a Todo Item")
@Test(description = "Edit an item")
public void testEditTodoItem() {
itemName = "Item to be edited";
BasicTodoMvcPage.open().then().addTodoItem(itemName);
Assert.assertTrue("2. I want to edit the content of an existing To-do item", BasicTodoMvcPage.open().editTodoItem(itemName, "Item updated"));
}
示例13: testCompleteTodoItem
import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Issue("TODOMVC-3")
@Stories("testCompleteTodoItem")
@Test(description = "testCompleteTodoItem")
public void testCompleteTodoItem(){
itemName = "Item created for completion";
BasicTodoMvcPage.open().then().addTodoItem(itemName);
Assert.assertTrue("3. I can complete a To-do by clicking inside the circle UI to the left of the To-do", BasicTodoMvcPage.open().completeTodoItem(itemName));
BasicTodoMvcPage.open().clearAllCompletedTodoItems();
}
示例14: testReactivateTodoItem
import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Issue("TODOMVC-4")
@Stories("testReactivateTodoItem")
@Test(description = "testReactivateTodoItem")
public void testReactivateTodoItem(){
itemName = "Item created for completion";
BasicTodoMvcPage.open().then().addTodoItem(itemName);
BasicTodoMvcPage.open().completeTodoItem("Item created for completion");
Assert.assertTrue("4. I can re-activate a completed To-do by clicking inside the circle UI", BasicTodoMvcPage.open().reActivateItem(itemName));
}
示例15: testAddSecondTodoItem
import ru.yandex.qatools.allure.annotations.Issue; //导入依赖的package包/类
@Issue("TODOMVC-5")
@Stories("testAddSecondTodoItem")
@Test(description = "testAddSecondTodoItem")
public void testAddSecondTodoItem(){
Assert.assertTrue(BasicTodoMvcPage.open().then().addTodoItem("FirstItem"));
Assert.assertTrue("5. I can add a second To-do", BasicTodoMvcPage.open().addTodoItem("SecondItem"));
}