public void Should_format_feature_without_description_nor_label_nor_details()
        {
            var result = ResultFormatterTestData.GetFeatureResultWithoutDescriptionNorLabelNorDetails();
            var text   = _subject.Format(result);

            Debug.WriteLine(text);
            const string expectedText = @"Summary:
	Test execution start time: 2014-09-23 19:21:58 UTC
	Test execution time      : 25ms
	Number of features       : 1
	Number of scenarios      : 1
	Passed scenarios         : 0
	Bypassed scenarios       : 0
	Failed scenarios         : 0
	Ignored scenarios        : 1
	Number of steps          : 2
	Passed steps             : 1
	Bypassed steps           : 0
	Failed steps             : 0
	Ignored steps            : 1
	Not Run steps            : 0

Feature: My feature

	Scenario: name - Ignored (25ms)
		Step 1: step1 - Passed (20ms)
		Step 2: step2 - Ignored (5ms)
";

            Assert.That(text, Is.EqualTo(expectedText));
        }
        public void Should_format_xml_without_description_nor_label_nor_details()
        {
            var result = ResultFormatterTestData.GetFeatureResultWithoutDescriptionNorLabelNorDetails();
            var text   = _subject.Format(result);

            Debug.WriteLine(text);

            const string expectedText = @"<?xml version=""1.0"" encoding=""utf-8""?>
<TestResults>
  <Summary TestExecutionStart=""2014-09-23T19:21:58.055Z"" TestExecutionTime=""PT0.025S"">
    <Features Count=""1"" />
    <Scenarios Count=""1"" Passed=""0"" Bypassed=""0"" Failed=""0"" Ignored=""1"" />
    <Steps Count=""2"" Passed=""1"" Bypassed=""0"" Failed=""0"" Ignored=""1"" NotRun=""0"" />
  </Summary>
  <Feature Name=""My feature"">
    <Scenario Status=""Ignored"" Name=""name"" ExecutionStart=""2014-09-23T19:21:58.055Z"" ExecutionTime=""PT0.025S"">
      <Step Status=""Passed"" Number=""1"" Name=""step1"" ExecutionStart=""2014-09-23T19:21:59.055Z"" ExecutionTime=""PT0.02S"">
        <StepName Format=""step1"" />
      </Step>
      <Step Status=""Ignored"" Number=""2"" Name=""step2"" ExecutionStart=""2014-09-23T19:22:00.055Z"" ExecutionTime=""PT0.005S"">
        <StepName Format=""step2"" />
      </Step>
    </Scenario>
  </Feature>
</TestResults>";

            Assert.That(text, Is.EqualTo(expectedText));
            ValidateWithSchema(text);
        }
        public void Should_format_multiple_features()
        {
            var results = ResultFormatterTestData.GetMultipleFeatureResults();

            var text = _subject.Format(results);

            Debug.WriteLine(text);
            const string expectedText = @"<?xml version=""1.0"" encoding=""utf-8""?>
<TestResults>
  <Summary TestExecutionStart=""2014-09-23T19:21:58.055Z"" TestExecutionTime=""PT0.04S"">
    <Features Count=""2"" />
    <Scenarios Count=""2"" Passed=""2"" Bypassed=""0"" Failed=""0"" Ignored=""0"" />
    <Steps Count=""2"" Passed=""2"" Bypassed=""0"" Failed=""0"" Ignored=""0"" NotRun=""0"" />
  </Summary>
  <Feature Name=""My feature"">
    <Scenario Status=""Passed"" Name=""scenario1"" ExecutionStart=""2014-09-23T19:21:58.055Z"" ExecutionTime=""PT0.02S"">
      <Category Name=""categoryA"" />
      <Step Status=""Passed"" Number=""1"" Name=""step1"" ExecutionStart=""2014-09-23T19:21:59.055Z"" ExecutionTime=""PT0.02S"">
        <StepName Format=""step1"" />
      </Step>
    </Scenario>
  </Feature>
  <Feature Name=""My feature2"">
    <Scenario Status=""Passed"" Name=""scenario1"" ExecutionStart=""2014-09-23T19:22:01.055Z"" ExecutionTime=""PT0.02S"">
      <Category Name=""categoryB"" />
      <Step Status=""Passed"" Number=""1"" Name=""step1"" ExecutionStart=""2014-09-23T19:22:02.055Z"" ExecutionTime=""PT0.02S"">
        <StepName Format=""step1"" />
      </Step>
    </Scenario>
  </Feature>
</TestResults>";

            Assert.That(text, Is.EqualTo(expectedText));
            ValidateWithSchema(text);
        }
        public void Should_format_xml()
        {
            var result = ResultFormatterTestData.GetFeatureResultWithDescription();
            var text   = _subject.Format(result);

            Debug.WriteLine(text);

            const string expectedText = @"<?xml version=""1.0"" encoding=""utf-8""?>
<TestResults>
  <Summary TestExecutionStart=""2014-09-23T19:21:58.055Z"" TestExecutionTime=""PT1M4.257S"">
    <Features Count=""1"" />
    <Scenarios Count=""2"" Passed=""0"" Bypassed=""0"" Failed=""1"" Ignored=""1"" />
    <Steps Count=""5"" Passed=""1"" Bypassed=""1"" Failed=""1"" Ignored=""1"" NotRun=""1"" />
  </Summary>
  <Feature Name=""My feature"" Label=""Label 1"">
    <Description>My feature
long description</Description>
    <Scenario Status=""Ignored"" Name=""name"" Label=""Label 2"" ExecutionStart=""2014-09-23T19:21:58.055Z"" ExecutionTime=""PT1M2.1S"">
      <Category Name=""categoryA"" />
      <Step Status=""Passed"" Number=""1"" Name=""call step1 &quot;arg1&quot;"" ExecutionStart=""2014-09-23T19:21:59.055Z"" ExecutionTime=""PT1M1S"">
        <StepName StepType=""call"" Format=""step1 &quot;{0}&quot;"">
          <Parameter IsEvaluated=""true"">arg1</Parameter>
        </StepName>
        <Comment>multiline
comment</Comment>
        <Comment>comment 2</Comment>
      </Step>
      <Step Status=""Ignored"" Number=""2"" Name=""step2"" ExecutionStart=""2014-09-23T19:22:00.055Z"" ExecutionTime=""PT1.1S"">
        <StatusDetails>Not implemented yet</StatusDetails>
        <StepName Format=""step2"" />
      </Step>
      <StatusDetails>Step 2: Not implemented yet</StatusDetails>
    </Scenario>
    <Scenario Status=""Failed"" Name=""name2"" ExecutionStart=""2014-09-23T19:22:01.055Z"" ExecutionTime=""PT2.157S"">
      <Category Name=""categoryB"" />
      <Category Name=""categoryC"" />
      <Step Status=""Bypassed"" Number=""1"" Name=""step3"" ExecutionStart=""2014-09-23T19:22:02.055Z"" ExecutionTime=""PT2.107S"">
        <StatusDetails>bypass reason</StatusDetails>
        <StepName Format=""step3"" />
      </Step>
      <Step Status=""Failed"" Number=""2"" Name=""step4"" ExecutionStart=""2014-09-23T19:22:03.055Z"" ExecutionTime=""PT0.05S"">
        <StatusDetails>  Expected: True
  But was: False</StatusDetails>
        <StepName Format=""step4"" />
      </Step>
      <Step Status=""NotRun"" Number=""3"" Name=""step5"">
        <StepName Format=""step5"" />
      </Step>
      <StatusDetails>Step 1: bypass reason
Step 2: Expected: True
	  But was: False</StatusDetails>
    </Scenario>
  </Feature>
</TestResults>";

            Assert.That(text, Is.EqualTo(expectedText));
            ValidateWithSchema(text);
        }
Exemple #5
0
        public void Should_format_feature_with_description()
        {
            var result = ResultFormatterTestData.GetFeatureResultWithDescription();

            var          text         = FormatAndExtractText(result);
            const string expectedText = @"Execution summary
Test execution start time: 2014-09-23 19:21:58 UTC
Test execution time: 1m 04s
Number of features: 1
Number of scenarios: 2
Passed scenarios: 0
Bypassed scenarios: 0
Failed scenarios: 1 (see details)
Ignored scenarios: 1 (see details)
Number of steps: 5
Passed steps: 1
Bypassed steps: 1
Failed steps: 1
Ignored steps: 1
Not Run steps: 1
Feature summary
Feature Scenarios Passed Bypassed Failed Ignored Steps Passed Bypassed Failed Ignored Not Run Duration Average
My feature [Label 1] 2 0 0 1 1 5 1 1 1 1 1 1m 04s 642570000 32s 128ms 321285000
Feature details[&#8734;link]
Toggle: Features Scenarios
Filter: Passed Bypassed Failed Ignored Not Run
Categories: -all- categoryA categoryB categoryC -without category-
[&#8734;filtered link]
My feature [Label 1][&#8734;link]
My feature
long description
Ignored name [Label 2] (1m 02s)[&#8734;link]
categoryA
Passed 1. call step1 ""arg1"" (1m 01s)
Ignored 2. step2 (1s 100ms)
Step 2: Not implemented yet
// Step 1: multiline
comment
// Step 1: comment 2
Failed name2 (2s 157ms)[&#8734;link]
categoryB, categoryC
Bypassed 1. step3 (2s 107ms)
Failed 2. step4 (50ms)
NotRun 3. step5
Step 1: bypass reason
Step 2: Expected: True
	  But was: False
Generated with LightBDD
initialize();";

            Assert.That(text, Is.EqualTo(expectedText));
        }
        public void Should_format_feature_with_description()
        {
            var result = ResultFormatterTestData.GetFeatureResultWithDescription();
            var text   = _subject.Format(result);

            Debug.WriteLine(text);
            const string expectedText = @"Summary:
	Test execution start time: 2014-09-23 19:21:58 UTC
	Test execution time      : 1m 04s
	Number of features       : 1
	Number of scenarios      : 2
	Passed scenarios         : 0
	Bypassed scenarios       : 0
	Failed scenarios         : 1
	Ignored scenarios        : 1
	Number of steps          : 5
	Passed steps             : 1
	Bypassed steps           : 1
	Failed steps             : 1
	Ignored steps            : 1
	Not Run steps            : 1

Feature: My feature [Label 1]
	My feature
	long description

	Scenario: name [Label 2] - Ignored (1m 02s)
		Categories: categoryA
		Step 1: call step1 ""arg1"" - Passed (1m 01s)
		Step 2: step2 - Ignored (1s 100ms)
		Details:
			Step 2: Not implemented yet
		Comments:
			Step 1: multiline
				comment
			Step 1: comment 2

	Scenario: name2 - Failed (2s 157ms)
		Categories: categoryB, categoryC
		Step 1: step3 - Bypassed (2s 107ms)
		Step 2: step4 - Failed (50ms)
		Step 3: step5 - NotRun
		Details:
			Step 1: bypass reason
			Step 2: Expected: True
				  But was: False
";

            Assert.That(text, Is.EqualTo(expectedText));
        }
Exemple #7
0
        public void Should_format_multiple_features()
        {
            var          results      = ResultFormatterTestData.GetMultipleFeatureResults();
            var          text         = FormatAndExtractText(results);
            const string expectedText = @"Execution summary
Test execution start time: 2014-09-23 19:21:58 UTC
Test execution time: 40ms
Number of features: 2
Number of scenarios: 2
Passed scenarios: 2
Bypassed scenarios: 0
Failed scenarios: 0
Ignored scenarios: 0
Number of steps: 2
Passed steps: 2
Bypassed steps: 0
Failed steps: 0
Ignored steps: 0
Not Run steps: 0
Feature summary
Feature Scenarios Passed Bypassed Failed Ignored Steps Passed Bypassed Failed Ignored Not Run Duration Average
My feature 1 1 0 0 0 1 1 0 0 0 0 20ms 200000 20ms 200000
My feature2 1 1 0 0 0 1 1 0 0 0 0 20ms 200000 20ms 200000
Feature details[&#8734;link]
Toggle: Features Scenarios
Filter: Passed Bypassed Failed Ignored Not Run
Categories: -all- categoryA categoryB -without category-
[&#8734;filtered link]
My feature[&#8734;link]
Passed scenario1 (20ms)[&#8734;link]
categoryA
Passed 1. step1 (20ms)
My feature2[&#8734;link]
Passed scenario1 (20ms)[&#8734;link]
categoryB
Passed 1. step1 (20ms)
Generated with LightBDD
initialize();";

            Assert.That(text, Is.EqualTo(expectedText));
        }
        public void Should_format_multiple_features()
        {
            var results = ResultFormatterTestData.GetMultipleFeatureResults();

            var text = _subject.Format(results);

            Debug.WriteLine(text);
            const string expectedText = @"Summary:
	Test execution start time: 2014-09-23 19:21:58 UTC
	Test execution time      : 40ms
	Number of features       : 2
	Number of scenarios      : 2
	Passed scenarios         : 2
	Bypassed scenarios       : 0
	Failed scenarios         : 0
	Ignored scenarios        : 0
	Number of steps          : 2
	Passed steps             : 2
	Bypassed steps           : 0
	Failed steps             : 0
	Ignored steps            : 0
	Not Run steps            : 0

Feature: My feature

	Scenario: scenario1 - Passed (20ms)
		Categories: categoryA
		Step 1: step1 - Passed (20ms)

Feature: My feature2

	Scenario: scenario1 - Passed (20ms)
		Categories: categoryB
		Step 1: step1 - Passed (20ms)
";

            Assert.That(text, Is.EqualTo(expectedText));
        }
Exemple #9
0
        public void Should_format_feature_without_description_nor_label_nor_details()
        {
            var result = ResultFormatterTestData.GetFeatureResultWithoutDescriptionNorLabelNorDetails();

            var text = FormatAndExtractText(result);

            const string expectedText = @"Execution summary
Test execution start time: 2014-09-23 19:21:58 UTC
Test execution time: 25ms
Number of features: 1
Number of scenarios: 1
Passed scenarios: 0
Bypassed scenarios: 0
Failed scenarios: 0
Ignored scenarios: 1 (see details)
Number of steps: 2
Passed steps: 1
Bypassed steps: 0
Failed steps: 0
Ignored steps: 1
Not Run steps: 0
Feature summary
Feature Scenarios Passed Bypassed Failed Ignored Steps Passed Bypassed Failed Ignored Not Run Duration Average
My feature 1 0 0 0 1 2 1 0 0 1 0 25ms 250000 25ms 250000
Feature details[&#8734;link]
Toggle: Features Scenarios
Filter: Passed Bypassed Failed Ignored Not Run
[&#8734;filtered link]
My feature[&#8734;link]
Ignored name (25ms)[&#8734;link]
Passed 1. step1 (20ms)
Ignored 2. step2 (5ms)
Generated with LightBDD
initialize();";

            Assert.That(text, Is.EqualTo(expectedText));
        }