Package net.masterthought.cucumber.json

Examples of net.masterthought.cucumber.json.Artifact


    @Test
    public void validConfigurationShouldReturnMap() throws Exception {
        String configuration = "Account has sufficient funds again~the account balance is 300~account~account_balance.txt~xml";
        ArtifactProcessor artifactProcessor = new ArtifactProcessor(configuration);
        Map<String,Artifact> map = artifactProcessor.process();
        Artifact artifact = map.get("Account has sufficient funds againthe account balance is 300");
        assertThat(artifact.getScenario(),is("Account has sufficient funds again"));
        assertThat(artifact.getStep(),is("the account balance is 300"));
        assertThat(artifact.getKeyword(),is("account"));
        assertThat(artifact.getArtifactFile(),is("account_balance.txt"));
        assertThat(artifact.getContentType(),is("xml"));
    }
View Full Code Here


                String scenario = data[0].trim();
                String step = data[1].trim();
                String keyword = data[2].trim();
                String artifactFile = data[3].trim();
                String contentType = data[4].trim();
                map.put(scenario+step, new Artifact(scenario, step, keyword, artifactFile, contentType));
            } else {
                throw new Exception("Error configuration should have 5 parts: Scenario ~ Step ~ Keyword ~ Artifact File ~ ContentType");
            }
        }
        return map;
View Full Code Here

                //apply artifacts
                if (ConfigurationOptions.artifactsEnabled()) {
                    Map<String, Artifact> map = ConfigurationOptions.artifactConfig();
                    String mapKey = scenarioName + stepName;
                    if (map.containsKey(mapKey)) {
                        Artifact artifact = map.get(mapKey);
                        String keyword = artifact.getKeyword();
                        String contentType = artifact.getContentType();
                        step.setName(stepName.replaceFirst(keyword, getArtifactFile(mapKey, keyword, artifact.getArtifactFile(), contentType)));
                    }
                }

                Util.Status stepStatus = step.getStatus();
                totalPassingSteps = Util.setStepStatus(totalPassingSteps, step, stepStatus, Util.Status.PASSED);
View Full Code Here

TOP

Related Classes of net.masterthought.cucumber.json.Artifact

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.