Package ru.yandex.qatools.allure.model

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


     * @param uid using as key for {@link #testSuiteData} to find variable
     * @return testSuite context for specified uid
     */
    public TestSuiteResult get(String uid) {
        if (!testSuiteData.containsKey(uid)) {
            testSuiteData.put(uid, new TestSuiteResult());
        }
        return testSuiteData.get(uid);
    }
View Full Code Here


     * testSuite context. Using event.getUid() to access testSuite.
     *
     * @param event to process
     */
    public void fire(TestSuiteEvent event) {
        TestSuiteResult testSuite = testSuiteStorage.get(event.getUid());
        event.process(testSuite);

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

     *
     * @param event to process
     */
    public void fire(TestSuiteFinishedEvent event) {
        String suiteUid = event.getUid();
        TestSuiteResult testSuite = testSuiteStorage.get(suiteUid);
        event.process(testSuite);

        testSuite.setVersion(getVersion());
        testSuite.getLabels().add(AllureModelUtils.createProgrammingLanguageLabel());

        testSuiteStorage.remove(suiteUid);

        writeTestSuiteResult(testSuite);

View Full Code Here

        AllureResultsUtils.setResultsDirectory(resultsDirectory);
    }

    @Test
    public void allureLifecycleTest() throws Exception {
        TestSuiteResult testSuite = fireTestSuiteStart();
        TestSuiteResult anotherTestSuite = fireCustomTestSuiteEvent();
        assertEquals(testSuite, anotherTestSuite);

        TestCaseResult testCase = fireTestCaseStart();
        TestCaseResult anotherTestCase = fireCustomTestCaseEvent();
        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);

        fireStepFinished();

        Attachment testCaseAttachment = fireMakeAttachment();

        fireTestCaseFinished();

        assertThat(testCase.getSteps(), hasSize(1));
        assertEquals(testCase.getSteps().get(0), parentStep);

        assertThat(testCase.getAttachments(), hasSize(1));
        assertEquals(testCase.getAttachments().get(0), testCaseAttachment);

        fireTestSuiteFinished();
        validateTestSuite();

        assertThat(testSuite.getTestCases(), hasSize(1));

        TestSuiteResult nextTestSuite = fireTestSuiteStart();
        assertNotEquals(anotherTestSuite, nextTestSuite);
    }
View Full Code Here

        assertNotEquals(anotherTestSuite, nextTestSuite);
    }

    @Test
    public void allureClearStorageTest() {
        TestSuiteResult testSuite = fireTestSuiteStart();
        TestCaseResult testCase = fireTestCaseStart();
        assertThat(testSuite.getTestCases(), hasSize(1));
        assertEquals(testSuite.getTestCases().get(0), testCase);

        Step parentStep = fireStepStart();
        Step nestedStep = fireStepStart();
        fireStepFinished();
View Full Code Here

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

    public TestSuiteResult fireTestSuiteStart() {
        Allure.LIFECYCLE.fire(new TestSuiteStartedEvent("some.uid", "some.suite.name"));
        TestSuiteResult testSuite = Allure.LIFECYCLE.getTestSuiteStorage().get("some.uid");
        assertNotNull(testSuite);
        assertThat(testSuite.getName(), is("some.suite.name"));
        assertThat(testSuite.getTestCases(), hasSize(0));
        return testSuite;
    }
View Full Code Here

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

    public TestSuiteResult fireCustomTestSuiteEvent() {
        Allure.LIFECYCLE.fire(new ChangeTestSuiteTitleEvent("some.uid", "new.suite.title"));
        TestSuiteResult testSuite = Allure.LIFECYCLE.getTestSuiteStorage().get("some.uid");
        assertNotNull(testSuite);
        assertThat(testSuite.getTitle(), is("new.suite.title"));
        return testSuite;
    }
View Full Code Here

        testSuiteStorage = new TestSuiteStorage();
    }

    @Test
    public void getTest() throws Exception {
        TestSuiteResult testSuite = testSuiteStorage.get("a");
        assertTrue(testSuite == testSuiteStorage.get("a"));
        assertFalse(testSuite == testSuiteStorage.get("b"));
    }
View Full Code Here

        assertFalse(testSuite == testSuiteStorage.get("b"));
    }

    @Test
    public void removeTest() throws Exception {
        TestSuiteResult testSuite = testSuiteStorage.get("a");
        assertTrue(testSuite == testSuiteStorage.get("a"));
        testSuiteStorage.remove("a");
        assertFalse(testSuite == testSuiteStorage.get("a"));
    }
View Full Code Here

        AllureResultsUtils.setResultsDirectory(resultsDirectory);
    }

    @Test
    public void invalidCharacterTest() throws Exception {
        TestSuiteResult testSuiteResult = new TestSuiteResult()
                .withName("somename");

        String titleWithInvalidXmlCharacter = String.valueOf(Character.toChars(0x0));
        testSuiteResult.setTitle(titleWithInvalidXmlCharacter);

        AllureResultsUtils.writeTestSuiteResult(testSuiteResult);

        Validator validator = AllureModelUtils.getAllureSchemaValidator();
View Full Code Here

TOP

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

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.