Skip to content

Commit

Permalink
Added some new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Casperson committed Dec 14, 2016
1 parent 91d77e5 commit 5626383
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
Expand Up @@ -117,6 +117,7 @@ public File processFeatureImportComments(@NotNull final FileDetails file, final
}

/**
* https://github.com/AutoGeneral/IridiumApplicationTesting/issues/66
* @param contents The raw contents
* @return The contents of the supplied string from the first Scenario to the end of the file
*/
Expand Down
Expand Up @@ -38,8 +38,8 @@ public class LocalPathFeatureLoaderImpl implements FeatureLoader {
@NotNull
@Override
public String loadFeatures(
@NotNull final String identifier,
@NotNull final String featureGroup) {
final String identifier,
final String featureGroup) {
return loadFeatures(Arrays.asList(identifier), featureGroup);
}

Expand Down
29 changes: 29 additions & 0 deletions src/test/java/au/com/agic/apptesting/LiveTests.java
Expand Up @@ -49,6 +49,35 @@ public void cleanUpFiles() {
globalTempFiles.forEach(File::delete);
}

/**
* https://github.com/AutoGeneral/IridiumApplicationTesting/issues/66
* This is a test of loading feature files hosted by a web server, and
* importing nested feature files by stripping out the feature lines.
*/
@Test
public void testFeatureImport() {
for (int retry = 0; retry < RETRY_COUNT; ++retry) {
try {
setCommonProperties();
System.setProperty("appURLOverride", "https://mcasperson.github.io/iridium/examples/test.html");
System.setProperty("testSource", "parent.feature");
System.setProperty("testDestination", "PhantomJS");
System.setProperty("importBaseUrl", "https://mcasperson.github.io/iridium/features/");
final int failures = new TestRunner().run(globalTempFiles);
if (failures == 0) {
return;
}
Thread.sleep(SLEEP);
} catch (final Exception ignored) {
/*
Ignored
*/
}
}

Assert.fail("Failed the tests!");
}

/**
* This test runs a feature that uses a wide selection of the steps provided
* with Iridium, and serves as a good regression test.
Expand Down

0 comments on commit 5626383

Please sign in to comment.