-
-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add default settings to Build Monitor Views (#573)
- Loading branch information
Showing
12 changed files
with
283 additions
and
32 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...ance/src/main/java/com/smartcodeltd/jenkinsci/plugins/build_monitor/tasks/HideBadges.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.smartcodeltd.jenkinsci.plugins.build_monitor.tasks; | ||
|
||
import com.smartcodeltd.jenkinsci.plugins.build_monitor.user_interface.BuildMonitorDashboard; | ||
|
||
import net.serenitybdd.screenplay.Actor; | ||
import net.serenitybdd.screenplay.Task; | ||
import net.serenitybdd.screenplay.actions.UncheckCheckbox; | ||
import net.serenitybdd.screenplay.waits.WaitUntil; | ||
import net.thucydides.core.annotations.Step; | ||
|
||
import static net.serenitybdd.screenplay.Tasks.instrumented; | ||
import static net.serenitybdd.screenplay.matchers.WebElementStateMatchers.isVisible; | ||
|
||
public class HideBadges implements Task { | ||
public static Task onTheDashboard() { | ||
return instrumented(HideBadges.class); | ||
} | ||
|
||
@Step("{0} decides to hide the badges on the dashboard") | ||
@Override | ||
public <T extends Actor> void performAs(T actor) { | ||
actor.attemptsTo( | ||
WaitUntil.the(BuildMonitorDashboard.Show_Badges, isVisible()), | ||
UncheckCheckbox.of(BuildMonitorDashboard.Show_Badges) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...artcodeltd/jenkinsci/plugins/build_monitor/tasks/configuration/ConfigureViewSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.smartcodeltd.jenkinsci.plugins.build_monitor.tasks.configuration; | ||
|
||
import net.serenitybdd.screenplay.Actor; | ||
import net.serenitybdd.screenplay.Task; | ||
import net.serenitybdd.screenplay.actions.CheckCheckbox; | ||
import net.serenitybdd.screenplay.actions.Enter; | ||
import net.serenitybdd.screenplay.actions.UncheckCheckbox; | ||
import net.serenitybdd.screenplay.jenkins.user_interface.ViewConfigurationPage; | ||
import net.serenitybdd.screenplay.targets.Target; | ||
import net.serenitybdd.screenplayx.actions.Scroll; | ||
import net.thucydides.core.annotations.Step; | ||
|
||
import static net.serenitybdd.screenplay.Tasks.instrumented; | ||
|
||
public class ConfigureViewSettings implements Task { | ||
|
||
public static Task showBadges() { | ||
return instrumented(ConfigureViewSettings.class, ViewConfigurationPage.Enable_Show_Badges, true); | ||
} | ||
|
||
public static Task doNotShowBadges() { | ||
return instrumented(ConfigureViewSettings.class, ViewConfigurationPage.Enable_Show_Badges, false); | ||
} | ||
|
||
@Step("{0} configures the view settings") | ||
@Override | ||
public <T extends Actor> void performAs(T actor) { | ||
if (value instanceof Boolean) { | ||
actor.attemptsTo( | ||
Scroll.to(target), | ||
((Boolean) value).booleanValue() ? CheckCheckbox.of(target) : UncheckCheckbox.of(target) | ||
); | ||
} else { | ||
actor.attemptsTo( | ||
Scroll.to(target), | ||
Enter.theValue(value.toString()).into(target) | ||
); | ||
} | ||
} | ||
|
||
public ConfigureViewSettings(Target target, Object value) { | ||
this.target = target; | ||
this.value = value; | ||
} | ||
|
||
private final Target target; | ||
private final Object value; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.