Skip to content

Commit

Permalink
Add predefined css class hidden (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Schäfer committed Jun 27, 2015
1 parent 81a1380 commit ba8e931
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.tngtech.jgiven.examples.annotation;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

import com.tngtech.jgiven.annotation.IsTag;

/**
* Used to be able to sort scenarios in the HMTL5 report
*/
@IsTag( cssClass = "hidden" )
@Retention( RetentionPolicy.RUNTIME )
public @interface Order {
String value();
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.tngtech.java.junit.dataprovider.DataProvider;
import com.tngtech.java.junit.dataprovider.DataProviderRunner;
import com.tngtech.jgiven.annotation.Description;
import com.tngtech.jgiven.examples.annotation.Order;
import com.tngtech.jgiven.examples.coffeemachine.steps.GivenCoffee;
import com.tngtech.jgiven.examples.coffeemachine.steps.ThenCoffee;
import com.tngtech.jgiven.examples.coffeemachine.steps.WhenCoffee;
Expand All @@ -24,6 +25,7 @@
public class ServeCoffeeTest extends ScenarioTest<GivenCoffee, WhenCoffee, ThenCoffee> {

@Test
@Order( "1" )
public void an_empty_coffee_machine_cannot_serve_any_coffee() throws Exception {

given().an_empty_coffee_machine();
Expand All @@ -36,6 +38,7 @@ public void an_empty_coffee_machine_cannot_serve_any_coffee() throws Exception {
}

@Test
@Order( "2" )
public void no_coffee_left_error_is_shown_when_there_is_no_coffee_left() {
given().an_empty_coffee_machine();
when().I_insert_$_one_euro_coins( 5 )
Expand All @@ -44,6 +47,7 @@ public void no_coffee_left_error_is_shown_when_there_is_no_coffee_left() {
}

@Test
@Order( "3" )
public void not_enough_money_message_is_shown_when_insufficient_money_was_given() throws Exception {

given().a_coffee_machine()
Expand Down
4 changes: 4 additions & 0 deletions jgiven-html5-report/src/app/css/jgivenreport.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ ul.tags {
list-style: none;
}

.tag.hidden {
display: none;
}

.title {
position: relative;
border-bottom: 1px solid #ddd;
Expand Down
2 changes: 1 addition & 1 deletion jgiven-html5-report/src/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ <h6>Cases</h6>
</div>
<div class="small-12 large-4 xlarge-6 column tag-column">
<span ng-repeat="tag in scenario.tags" >
<a href="#tag/{{tag.name + '/' + tag.value | encodeUri}}" ><span class="radius label tag {{getCssClassOfTag(tag)}}" style='{{getStyleOfTag(tag)}}'>{{tagToString(tag)}}</span></a>
<a href="#tag/{{tag.name + '/' + tag.value | encodeUri}}" ><span class="{{getCssClassOfTag(tag)}} radius label tag" style='{{getStyleOfTag(tag)}}'>{{tagToString(tag)}}</span></a>
</span>
</div>
</div>
Expand Down

0 comments on commit ba8e931

Please sign in to comment.