use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorStoreUnitTest method radiatorCanBeCreatedWithGoodIpAddresses.
@Test
public void radiatorCanBeCreatedWithGoodIpAddresses() {
Radiator rad = new RadiatorStore().createRadiator(new TestRandomGenerator("QWERTY", "sseeccrreett"), "A").withIpAccessRestrictedToThese("123.123.123.122", "2001:0db8:85a3:0000:0000:8a2e:0370:7334");
assertThat(rad.code, equalTo("QWERTY"));
assertThat(rad.codeAndSecretOnly().code, equalTo("QWERTY"));
assertThat(rad.codeAndSecretOnly().secret, equalTo("sseeccrreett"));
}
use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorWebDriverTest method columnsShouldBeProportionalEvenWithDurationsOfZero.
@Test
public void columnsShouldBeProportionalEvenWithDurationsOfZero() {
Radiator rad = rad("xxx", "sseeccrreett", stepNames("A", "B"), build("1", "passed", 30000, step("A", 8000, "passed"), step("B", 30000, "passed")), build("2", "running", 30000, step("A", 12000, "running"), step("B", 0, "")));
app = new TestVersionOfBuildRadiatorApp(rad);
startAppAndOpenWebDriverOnRadiatorPage(CONTRIVED_PATH_FOR_TESTING + "#xxx/Main_Project_Trunk_Build");
FWD.body().within(secs(3)).getText().shouldContain("Main");
StringBuilder percentages = new StringBuilder();
FWD.tds().each((fluentWebElement, i) -> rhs(fluentWebElement.getAttribute("style").toString().split("width:"), percentages));
assertThat(percentages.toString(), equalTo("8%;23%;69%;8%;23%;69%;"));
}
use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorWebDriverTest method columnsShouldBeProportional.
@Test
public void columnsShouldBeProportional() {
Radiator rad = rad("xxx", "sseeccrreett", stepNames("A", "B"), build("1", "passed", 30000, step("A", 8000, "passed"), step("B", 32000, "passed")), build("2", "passed", 30000, step("A", 12000, "passed"), step("B", 28000, "passed")));
app = new TestVersionOfBuildRadiatorApp(rad);
startAppAndOpenWebDriverOnRadiatorPage(CONTRIVED_PATH_FOR_TESTING + "#xxx/Main_Project_Trunk_Build");
StringBuilder percentages = new StringBuilder();
FWD.body().within(secs(3)).getText().shouldContain("Main");
FWD.tds().each((fluentWebElement, i) -> rhs(fluentWebElement.getAttribute("style").toString().split("width:"), percentages));
assertThat(percentages.toString(), equalTo("8%;23%;69%;8%;23%;69%;"));
}
use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorWebDriverTest method trailingSlashOnPageTitleIsIgnored.
@Test
public void trailingSlashOnPageTitleIsIgnored() {
Radiator rad = rad("xxx", "sseeccrreett", stepNames("A"));
app = new TestVersionOfBuildRadiatorApp(rad);
startAppAndOpenWebDriverOnRadiatorPage(CONTRIVED_PATH_FOR_TESTING + "#xxx/Main_Project_Trunk_Build/");
FWD.td().getText().within(secs(3)).shouldBe("Main Project Trunk Build\nchange URL to customize the title ↑ or step codes ↓ Edit the title and step descriptions");
FWD.trs().getText().within(secs(2)).shouldContain("Main Project Trunk");
// unchanged
FWD.url().shouldMatch(endsWith("Trunk_Build/"));
}
use of com.paulhammant.buildradiator.radiator.model.Radiator in project BuildRadiator by BuildRadiator.
the class RadiatorStore method createRadiator.
Radiator createRadiator(RandomGenerator codeGenerator, String... steps) {
String radiatorCode = codeGenerator.generateRadiatorCode();
String secret = codeGenerator.generateSecret();
Radiator radiator = new Radiator(radiatorCode, secret, steps);
this.actualRadiators.put(radiatorCode, radiator);
return radiator;
}
Aggregations