Package com.technophobia.substeps.model

Examples of com.technophobia.substeps.model.Scenario


                }
            }
        }

        // check that the multiline tagged scenario works ok
        final Scenario scenario = featureFileList.get(0).getScenarios().get(3);

        Assert.assertThat("expecting a tag to be present", scenario.getTags(), hasItem("@all"));
        Assert.assertThat("expecting a tag to be present", scenario.getTags(), hasItem("@searchcontracts"));
        Assert.assertThat("expecting a tag to be present", scenario.getTags(), hasItem("@searchcontracts_30"));
    }
View Full Code Here


     * @param outline
     * @return
     */
    private void processScenarioDirective(final FeatureFile ff, final Set<String> currentTags,
            final String currentBackground, final String sc, final boolean outline, final int start) {
        final Scenario scenario = new Scenario();

        scenario.setRawText(sc);
        scenario.setTags(currentTags);
        scenario.setOutline(outline);
        scenario.setSourceStartOffset(start);

        ff.addScenario(scenario);

        if (currentBackground != null) {

            final int backgroundLineNumberIdx = backgroundLineNumber();

            scenario.setBackground(new Background(backgroundLineNumberIdx, currentBackground, ff.getSourceFile()));

        }
    }
View Full Code Here

        final List<Scenario> scenarios = feature.getScenarios();

        Assert.assertThat(scenarios.size(), is(4));

        final Scenario sc1 = scenarios.get(0);

        Assert.assertThat(sc1.getSourceStartOffset(), is(not(-1)));
        // Assert.assertThat(sc1.getSourceEndOffset(), is(not(-1)));

        Assert.assertThat(sc1.getSourceStartLineNumber(), is(13));

        final List<Step> steps = sc1.getSteps();
        Assert.assertThat(steps.size(), is(7));

        final Step s1 = steps.get(0);
        Assert.assertThat(s1.getSourceLineNumber(), is(14));
        final Step s2 = steps.get(1);
        Assert.assertThat(s2.getSourceLineNumber(), is(15));

        final Step s3 = steps.get(2);
        Assert.assertThat(s3.getSourceLineNumber(), is(16));

        final Step s4 = steps.get(3);
        Assert.assertThat(s4.getSourceLineNumber(), is(17));

        final Step s5 = steps.get(4);
        Assert.assertThat(s5.getSourceLineNumber(), is(18));

        final Step s6 = steps.get(5);
        Assert.assertThat(s6.getSourceLineNumber(), is(19));

        final Step s7 = steps.get(6);
        Assert.assertThat(s7.getSourceLineNumber(), is(20));

        final Scenario sc2 = scenarios.get(1);

        Assert.assertThat(sc2.getSourceStartLineNumber(), is(23));

        Assert.assertThat(sc2.getSteps().get(0).getSourceLineNumber(), is(24));

        final Scenario sc3 = scenarios.get(2);
        Assert.assertThat(sc3.getSourceStartLineNumber(), is(30));

        final Scenario sc4 = scenarios.get(3);

        Assert.assertThat(sc4.getSteps().get(3).getSourceLineNumber(), is(56));
    }
View Full Code Here

        final List<Scenario> scenarios = feature.getScenarios();

        Assert.assertThat(scenarios.size(), is(1));

        final Scenario sc1 = scenarios.get(0);

        Assert.assertThat(sc1.getSourceStartOffset(), is(not(-1)));
        // Assert.assertThat(sc1.getSourceEndOffset(), is(not(-1)));

        Assert.assertThat(sc1.getSourceStartLineNumber(), is(8));

        final List<Step> steps = sc1.getSteps();
        Assert.assertThat(steps.size(), is(3));

        final Step s1 = steps.get(0);
        Assert.assertThat(s1.getSourceLineNumber(), is(9));
        final Step s2 = steps.get(1);
View Full Code Here

        Assert.assertNotNull(ff.getScenarios());

        Assert.assertThat(ff.getScenarios().size(), is(4));

        final Scenario sc1 = ff.getScenarios().get(1);
        Assert.assertTrue(sc1.hasBackground());
        Assert.assertThat(sc1.getBackground().getSteps().size(), is(1));
        Assert.assertThat(sc1.getSteps().size(), is(4));

        final Step withEmailAddress = ff.getScenarios().get(0).getSteps().get(0);
        Assert.assertThat(withEmailAddress.getLine(), is("Given something with an@emailaddress.com"));

        final Scenario sc2 = ff.getScenarios().get(2);
        Assert.assertTrue(sc2.isOutline());
        Assert.assertThat(sc2.getSteps().size(), is(6));

        Assert.assertThat(sc2.getExampleParameters().size(), is(8));

        final Scenario sc3 = ff.getScenarios().get(3);
        Assert.assertThat(sc3.getSteps().size(), is(5));

        final Step step = sc3.getSteps().get(2);
        Assert.assertThat(step.getInlineTable().size(), is(1));

        final Map<String, String> inlineTableRow0 = step.getInlineTable().get(0);

        Assert.assertThat(inlineTableRow0.size(), is(4));
View Full Code Here

TOP

Related Classes of com.technophobia.substeps.model.Scenario

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.