Skip to content

Commit

Permalink
Refactored some unit tests to check the fix for the Saucelinks link p…
Browse files Browse the repository at this point in the history
…roblem properly
  • Loading branch information
wakaleo committed Feb 15, 2016
1 parent c80004c commit bc1a284
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package net.serenitybdd.core.model
import net.thucydides.core.model.TestOutcome
import net.thucydides.core.util.MockEnvironmentVariables
import spock.lang.Specification

class WhenRecordingTestOutcomes extends Specification{

class SomeTestScenario {

}

def "should be able to obtain a link to the saucelabs video"() {

given:
def environmentVariables = new MockEnvironmentVariables();
environmentVariables.setProperty("saucelabs.url","http://username:[email protected]:80/wd/hub");
and:
def testOutcome = TestOutcome.forTest("should_do_this", SomeTestScenario.class);
testOutcome.setEnvironmentVariables(environmentVariables);
testOutcome.linkGenerator.environmentVariables = environmentVariables
when:
testOutcome.setSessionId("1234");
then:
testOutcome.getVideoLink() == "http://saucelabs.com/jobs/1234"

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -1121,13 +1121,6 @@ public void scenario_steps_should_have_a_sensible_toString() {
assertThat(steps.toString(), is("SimpleScenarioSteps"));
}

@Test
public void should_be_able_to_obtain_a_link_to_the_saucelabs_video() {
testOutcome = TestOutcome.forTest("should_do_this", SomeTestScenario.class);
testOutcome.setSessionId("1234");
assertThat(testOutcome.getVideoLink(), is("http://saucelabs.com/jobs/1234"));
}

@Test
public void should_be_able_to_find_the_last_step() {
testOutcome.recordStep(forASuccessfulTestStepCalled("Step 1"));
Expand Down

0 comments on commit bc1a284

Please sign in to comment.