Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ATH IMPROVEMENT] Allow local Jenkins instance, simplified API #1484

Merged
merged 23 commits into from
Oct 23, 2017
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
87ecc77
Update ATH tests for new flow
kzantow Oct 12, 2017
33ccc9c
Handle more close cases for errors
kzantow Oct 12, 2017
f8f224d
Some refactoring
kzantow Oct 12, 2017
f070bbe
Add ability to read a properties file for ATH (~/.blueocean-ath-config)
kzantow Oct 17, 2017
78aa546
Add ability to read a properties file for ATH (~/.blueocean-ath-config)
kzantow Oct 17, 2017
f605005
Add ability to read a properties file for ATH (~/.blueocean-ath-config)
kzantow Oct 17, 2017
8d010e5
Whoops
kzantow Oct 17, 2017
1c58498
Whoops, whoops
kzantow Oct 18, 2017
a17c707
Merge remote-tracking branch 'primary/master' into ATH-allow-local-dev
kzantow Oct 18, 2017
97e6cf4
Whoops, whoops
kzantow Oct 18, 2017
04bb80f
Missed a couple things
kzantow Oct 18, 2017
cdd1ed4
Merge remote-tracking branch 'primary/master' into ATH-allow-local-dev
kzantow Oct 18, 2017
972f4a0
Tweaks based on PR feedback
kzantow Oct 18, 2017
d89172d
Consolidate `go` method
kzantow Oct 18, 2017
2201f7a
Consolidate `go` method
kzantow Oct 18, 2017
5cce6ec
Imports
kzantow Oct 18, 2017
4cb6779
Merge remote-tracking branch 'primary/master' into ATH-allow-local-dev
kzantow Oct 19, 2017
aa434f2
Imports
kzantow Oct 20, 2017
c686b05
Merge remote-tracking branch 'primary/master' into ATH-allow-local-dev
kzantow Oct 21, 2017
fced2e0
Use 'improved' click logic for github pipeline create
kzantow Oct 23, 2017
9922950
Merge remote-tracking branch 'primary/master' into ATH-allow-local-dev
kzantow Oct 23, 2017
add4f4a
Typo
kzantow Oct 23, 2017
dbf0fc2
Merge remote-tracking branch 'primary/master' into ATH-allow-local-dev
kzantow Oct 23, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
import com.google.inject.assistedinject.FactoryModuleBuilder;
import com.google.inject.name.Names;
import com.offbytwo.jenkins.JenkinsServer;
import io.blueocean.ath.factory.*;
import io.blueocean.ath.factory.ActivityPageFactory;
import io.blueocean.ath.factory.BranchPageFactory;
import io.blueocean.ath.factory.ClassicPipelineFactory;
import io.blueocean.ath.factory.FreestyleJobFactory;
import io.blueocean.ath.factory.MultiBranchPipelineFactory;
import io.blueocean.ath.factory.RunDetailsArtifactsPageFactory;
import io.blueocean.ath.factory.RunDetailsPipelinePageFactory;
import io.blueocean.ath.model.ClassicPipeline;
import io.blueocean.ath.model.FreestyleJob;
import io.blueocean.ath.model.MultiBranchPipeline;
Expand Down Expand Up @@ -74,6 +80,7 @@ protected void configure() {
launchUrl = new String(Files.readAllBytes(Paths.get("runner/.blueocean-ath-jenkins-url")));
}
bindConstant().annotatedWith(BaseUrl.class).to(launchUrl);
LocalDriver.setUrlBase(launchUrl);

JenkinsUser admin = new JenkinsUser(
cfg.getString("adminUsername", "alice"),
Expand Down
36 changes: 10 additions & 26 deletions acceptance-tests/src/main/java/io/blueocean/ath/LocalDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ public static void destroy() {
}
}

private static String urlBase;

public static String getUrlBase() {
return urlBase;
}

public static void setUrlBase(String base) {
urlBase = base;
}

/**
* Used for callbacks in a specific browser context
*/
Expand Down Expand Up @@ -114,32 +124,6 @@ public Options manage() {
return getDriver().manage();
}

/**
* Finds an element by the provided expression {@see SmartWebElement}
* @param expr css or xpath; if it starts with a /, XPath is used
* @return a new SmartWebElement
*/
public static SmartWebElement find(String expr) {
return new BasePage(getDriver()).find(expr);
}

/**
* Executes javascript, returns the result
* @param script javascript to execute
* @return the result
*/
public static <T> T eval(String script) {
return new BasePage(getDriver()).eval(script);
}

/**
* Navigates to a specified url
* @param url where to go
*/
public static void goTo(String url) {
new BasePage(getDriver()).goTo(url);
}

/**
* Push a specific driver into context and execute the proc
* @param driver new driver in context
Expand Down
Loading