Package ru.yandex.qatools.allure.model

Examples of ru.yandex.qatools.allure.model.Step


     *
     * @return the element removed from deque
     */
    public Step pollLast() {
        Deque<Step> queue = get();
        Step last = queue.pollLast();
        if (queue.isEmpty()) {
            queue.add(createRootStep());
        }
        return last;
    }
View Full Code Here


     * 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);
    }
View Full Code Here

     * stepStorage.
     *
     * @param event to process
     */
    public void fire(StepStartedEvent event) {
        Step step = new Step();
        event.process(step);
        stepStorage.put(step);

        notifier.fire(event);
    }
View Full Code Here

     * step using this method.
     *
     * @param event to process
     */
    public void fire(StepEvent event) {
        Step step = stepStorage.getLast();
        event.process(step);

        notifier.fire(event);
    }
View Full Code Here

     * and add it as child of previous step.
     *
     * @param event to process
     */
    public void fire(StepFinishedEvent event) {
        Step step = stepStorage.pollLast();
        event.process(step);
        stepStorage.getLast().getSteps().add(step);

        notifier.fire(event);
    }
View Full Code Here

     */
    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);
View Full Code Here

        assertEquals(testCase, anotherTestCase);

        assertThat(testSuite.getTestCases(), hasSize(1));
        assertEquals(testSuite.getTestCases().get(0), testCase);

        Step parentStep = fireStepStart();
        Attachment firstAttach = fireMakeAttachment();

        assertThat(parentStep.getAttachments(), hasSize(1));
        assertEquals(parentStep.getAttachments().get(0), firstAttach);

        Step nestedStep = fireStepStart();
        Attachment secondAttach = fireMakeAttachment();

        assertFalse(firstAttach == secondAttach);

        assertThat(nestedStep.getAttachments(), hasSize(1));
        assertTrue(nestedStep.getAttachments().get(0) == secondAttach);

        fireStepFinished();

        assertThat(parentStep.getSteps(), hasSize(1));
        assertEquals(parentStep.getSteps().get(0), nestedStep);
View Full Code Here

        TestSuiteResult testSuite = fireTestSuiteStart();
        TestCaseResult testCase = fireTestCaseStart();
        assertThat(testSuite.getTestCases(), hasSize(1));
        assertEquals(testSuite.getTestCases().get(0), testCase);

        Step parentStep = fireStepStart();
        Step nestedStep = fireStepStart();
        fireStepFinished();

        assertThat(parentStep.getSteps(), hasSize(1));
        assertTrue(parentStep.getSteps().get(0) == nestedStep);
View Full Code Here

        Allure.LIFECYCLE.fire(new TestCaseFinishedEvent());
    }

    public Step fireStepStart() {
        Allure.LIFECYCLE.fire(new StepStartedEvent("some.step.name"));
        Step step = Allure.LIFECYCLE.getStepStorage().getLast();
        assertNotNull(step);
        assertThat(step.getName(), is("some.step.name"));
        return step;
    }
View Full Code Here

        assertThat(step.getName(), is("some.step.name"));
        return step;
    }

    public Attachment fireMakeAttachment() throws UnsupportedEncodingException {
        Step lastStep = Allure.LIFECYCLE.getStepStorage().getLast();
        int attachmentsCount = lastStep.getAttachments().size();

        Allure.LIFECYCLE.fire(new MakeAttachmentEvent("some.attach.title".getBytes(UTF_8), "attach.body", ""));

        assertThat(lastStep.getAttachments().size(), is(attachmentsCount + 1));
        Attachment attachment = lastStep.getAttachments().get(attachmentsCount);
        assertNotNull(attachment);

        return attachment;
    }
View Full Code Here

TOP

Related Classes of ru.yandex.qatools.allure.model.Step

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.