本文整理匯總了Java中ru.yandex.qatools.allure.model.Status類的典型用法代碼示例。如果您正苦於以下問題:Java Status類的具體用法?Java Status怎麽用?Java Status使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Status類屬於ru.yandex.qatools.allure.model包,在下文中一共展示了Status類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: fire
import ru.yandex.qatools.allure.model.Status; //導入依賴的package包/類
/**
* Process TestCaseFinishedEvent. Add steps and attachments from
* top step from stepStorage to current testCase, then remove testCase
* and step from stores. Also remove attachments matches removeAttachments
* config.
*
* @param event to process
*/
public void fire(TestCaseFinishedEvent event) {
TestCaseResult testCase = testCaseStorage.get();
event.process(testCase);
Step root = stepStorage.pollLast();
if (Status.PASSED.equals(testCase.getStatus())) {
new RemoveAttachmentsEvent(AllureConfig.newInstance().getRemoveAttachments()).process(root);
}
testCase.getSteps().addAll(root.getSteps());
testCase.getAttachments().addAll(root.getAttachments());
stepStorage.remove();
testCaseStorage.remove();
notifier.fire(event);
}
示例2: validateTestSuiteResult
import ru.yandex.qatools.allure.model.Status; //導入依賴的package包/類
private void validateTestSuiteResult(TestSuiteResult testSuiteResult) {
String brokenMethod = testSuiteResult.getName().replace(SUITE_PREFIX, "config");
for (TestCaseResult result : testSuiteResult.getTestCases()) {
String methodName = result.getName();
Status status = result.getStatus();
Status expectedStatus = Status.CANCELED;
if (brokenMethod.startsWith(methodName)) {
expectedStatus = Status.BROKEN;
}
if (brokenMethod.contains("After") && methodName.equalsIgnoreCase("test")) {
expectedStatus = Status.PASSED;
}
assertThat(String.format("Wrong status for test <%s>, method <%s>", brokenMethod, methodName),
status, equalTo(expectedStatus));
}
}
示例3: deserialize
import ru.yandex.qatools.allure.model.Status; //導入依賴的package包/類
@Override
public Status deserialize(final JsonParser p, final DeserializationContext ctxt) throws IOException {
String value = p.readValueAs(String.class);
return Stream.of(Status.values())
.filter(status -> status.value().equalsIgnoreCase(value))
.findAny()
.orElse(null);
}
示例4: createFakeTestcaseWithWarning
import ru.yandex.qatools.allure.model.Status; //導入依賴的package包/類
/**
* Create fake test case, which will used for mark suite as interrupted.
*/
public TestCaseResult createFakeTestcaseWithWarning(TestSuiteResult testSuite) {
return new TestCaseResult()
.withName(testSuite.getName())
.withTitle(testSuite.getName())
.withStart(testSuite.getStart())
.withStop(System.currentTimeMillis())
.withFailure(new Failure().withMessage("Test suite was interrupted, some test cases may be lost"))
.withStatus(Status.BROKEN);
}
示例5: markTestcaseAsInterruptedIfNotFinishedYet
import ru.yandex.qatools.allure.model.Status; //導入依賴的package包/類
/**
* If test not finished yet (in our case if stop time is zero) mark it as interrupted.
* Set message, stop time and status.
*/
public void markTestcaseAsInterruptedIfNotFinishedYet(TestCaseResult testCase) {
if (testCase.getStop() == 0L) {
testCase.setStop(System.currentTimeMillis());
testCase.setStatus(Status.BROKEN);
testCase.setFailure(new Failure().withMessage("Test was interrupted"));
}
}
示例6: process
import ru.yandex.qatools.allure.model.Status; //導入依賴的package包/類
/**
* Sets to testCase start time, default status, name, title, description and labels
*
* @param testCase to change
*/
@Override
public void process(TestCaseResult testCase) {
testCase.setStart(System.currentTimeMillis());
testCase.setStatus(Status.PASSED);
testCase.setName(getName());
testCase.setTitle(getTitle());
testCase.setDescription(getDescription());
testCase.setLabels(getLabels());
}
示例7: process
import ru.yandex.qatools.allure.model.Status; //導入依賴的package包/類
/**
* Sets name, status, start time and title to specified step
*
* @param step which will be changed
*/
@Override
public void process(Step step) {
step.setName(getName());
step.setStatus(Status.PASSED);
step.setStart(System.currentTimeMillis());
step.setTitle(getTitle());
}
示例8: createRootStep
import ru.yandex.qatools.allure.model.Status; //導入依賴的package包/類
/**
* Construct new root step. Used for inspect problems with Allure lifecycle
*
* @return new root step marked as broken
*/
public Step createRootStep() {
return new Step()
.withName("Root step")
.withTitle("Allure step processing error: if you see this step something went wrong.")
.withStart(System.currentTimeMillis())
.withStatus(Status.BROKEN);
}
示例9: testStepStartedEvent
import ru.yandex.qatools.allure.model.Status; //導入依賴的package包/類
@Test
public void testStepStartedEvent() throws Exception {
new StepStartedEvent("name").withTitle("title").process(step);
verify(step).setName("name");
verify(step).setStart(anyLong());
verify(step).setStatus(Status.PASSED);
verify(step).setTitle("title");
verifyNoMoreInteractions(step);
}
示例10: validatePendingTest
import ru.yandex.qatools.allure.model.Status; //導入依賴的package包/類
@Test
public void validatePendingTest() throws IOException {
TestSuiteResult testSuite = AllureFileUtils.unmarshalSuites(resultsDir.toFile()).get(0);
TestCaseResult testResult = testSuite.getTestCases().get(0);
assertThat(testResult.getStatus(), equalTo(Status.PENDING));
assertThat(testResult.getDescription().getValue(), equalTo("This is pending test"));
}
示例11: StatusDeserializer
import ru.yandex.qatools.allure.model.Status; //導入依賴的package包/類
protected StatusDeserializer() {
super(io.qameta.allure.model.Status.class);
}
示例12: randomStatus
import ru.yandex.qatools.allure.model.Status; //導入依賴的package包/類
public static Status randomStatus() {
return randomEnum(STATUSES_VALUES);
}
示例13: testStepFailureEventFailed
import ru.yandex.qatools.allure.model.Status; //導入依賴的package包/類
@Test
public void testStepFailureEventFailed() throws Exception {
new StepFailureEvent().withThrowable(new AssertionError()).process(step);
verify(step).setStatus(Status.FAILED);
verifyNoMoreInteractions(step);
}
示例14: testStepFailureEventBroken
import ru.yandex.qatools.allure.model.Status; //導入依賴的package包/類
@Test
public void testStepFailureEventBroken() throws Exception {
new StepFailureEvent().withThrowable(new Exception()).process(step);
verify(step).setStatus(Status.BROKEN);
verifyNoMoreInteractions(step);
}
示例15: testStepCanceledEvent
import ru.yandex.qatools.allure.model.Status; //導入依賴的package包/類
@Test
public void testStepCanceledEvent() throws Exception {
new StepCanceledEvent().process(step);
verify(step).setStatus(Status.CANCELED);
verifyNoMoreInteractions(step);
}