Skip to content

Commit 4e16ead

Browse files
committed
adding reporter plugin in Jenkins
1 parent 58a3df1 commit 4e16ead

File tree

12 files changed

+597
-168
lines changed

12 files changed

+597
-168
lines changed

build.gradle

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ plugins {
2929
}
3030

3131
group = 'org.jenkins-ci.plugins'
32-
version = '1.18'
32+
version = '2.0'
3333
description = 'LambdaTest Plugin is used to run automated selenium tests on LambdaTest Cloud'
3434

3535
sourceCompatibility = 1.8
3636
targetCompatibility = 1.8
3737

3838
jenkinsPlugin {
3939
// version of Jenkins core this plugin depends on, must be 1.420 or later
40-
coreVersion = '2.120'
40+
coreVersion = '2.126'
4141

4242
// ID of the plugin, defaults to the project name without trailing '-plugin'
4343
shortName = 'lambdatest-automation'
@@ -123,9 +123,12 @@ dependencies {
123123

124124
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.2'
125125
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.2'
126-
127-
128-
// Use JUnit test framework
126+
127+
// https://mvnrepository.com/artifact/org.json/json
128+
compile group: 'org.json', name: 'json', version: '20090211'
129+
130+
131+
// Use JUnit test framework
129132
testImplementation 'junit:junit:4.12'
130133

131134
}
Lines changed: 62 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,62 @@
1-
package com.lambdatest.jenkins.freestyle;
2-
3-
import hudson.model.Action;
4-
import hudson.model.Run;
5-
6-
public abstract class AbstractFreeStyleBuildAction implements Action {
7-
private Run<?, ?> build;
8-
9-
protected String displayName;
10-
protected String iconFileName;
11-
protected String testUrl;
12-
13-
@Override
14-
public String getIconFileName() {
15-
return iconFileName;
16-
}
17-
18-
@Override
19-
public String getDisplayName() {
20-
return displayName;
21-
}
22-
23-
@Override
24-
public String getUrlName() {
25-
return testUrl;
26-
}
27-
28-
public Run<?, ?> getBuild() {
29-
return build;
30-
}
31-
32-
public void setBuild(Run<?, ?> build) {
33-
this.build = build;
34-
}
35-
36-
public void setIconFileName(String iconFileName) {
37-
this.iconFileName = iconFileName;
38-
}
39-
40-
public void setDisplayName(String dn) {
41-
// the displayname does not wrap after 46 characters
42-
// so it will bleed into the view
43-
int maxCharactersViewable = 46;
44-
if (dn.length() > maxCharactersViewable - 3) {
45-
// going to cut the string down and add "..."
46-
dn = dn.substring(0, maxCharactersViewable - 3);
47-
dn += "...";
48-
}
49-
displayName = dn;
50-
}
51-
52-
public void setTestUrl(String testUrl) {
53-
this.testUrl = testUrl.replaceAll("[:.()|/ ]", "").toLowerCase();
54-
}
55-
56-
}
1+
/*
2+
Removed Iframe in new plugin version, uncomment this to implement it again
3+
*/
4+
5+
6+
7+
//package com.lambdatest.jenkins.freestyle;
8+
//
9+
//import hudson.model.Action;
10+
//import hudson.model.Run;
11+
//
12+
//public abstract class AbstractFreeStyleBuildAction implements Action {
13+
// private Run<?, ?> build;
14+
//
15+
// protected String displayName;
16+
// protected String iconFileName;
17+
// protected String testUrl;
18+
//
19+
// @Override
20+
// public String getIconFileName() {
21+
// return iconFileName;
22+
// }
23+
//
24+
// @Override
25+
// public String getDisplayName() {
26+
// return displayName;
27+
// }
28+
//
29+
// @Override
30+
// public String getUrlName() {
31+
// return testUrl;
32+
// }
33+
//
34+
// public Run<?, ?> getBuild() {
35+
// return build;
36+
// }
37+
//
38+
// public void setBuild(Run<?, ?> build) {
39+
// this.build = build;
40+
// }
41+
//
42+
// public void setIconFileName(String iconFileName) {
43+
// this.iconFileName = iconFileName;
44+
// }
45+
//
46+
// public void setDisplayName(String dn) {
47+
// // the displayname does not wrap after 46 characters
48+
// // so it will bleed into the view
49+
// int maxCharactersViewable = 46;
50+
// if (dn.length() > maxCharactersViewable - 3) {
51+
// // going to cut the string down and add "..."
52+
// dn = dn.substring(0, maxCharactersViewable - 3);
53+
// dn += "...";
54+
// }
55+
// displayName = dn;
56+
// }
57+
//
58+
// public void setTestUrl(String testUrl) {
59+
// this.testUrl = testUrl.replaceAll("[:.()|/ ]", "").toLowerCase();
60+
// }
61+
//
62+
//}
Lines changed: 100 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,100 @@
1-
package com.lambdatest.jenkins.freestyle;
2-
3-
import com.lambdatest.jenkins.freestyle.api.Constant;
4-
5-
public class LambdaFreeStyleBuildAction extends AbstractFreeStyleBuildAction {
6-
/*
7-
* Holds info about the Selenium Test
8-
*/
9-
private String operatingSystem;
10-
private String browserName;
11-
private String browserVersion;
12-
private String resolution;
13-
private String buildName;
14-
private String buildNumber;
15-
private String testType;
16-
private String iframeLink;
17-
18-
LambdaFreeStyleBuildAction(final String testType, final String operatingSystem, final String browserName,
19-
final String browserVersion, final String resolution) {
20-
super();
21-
this.testType = testType;
22-
this.operatingSystem = operatingSystem;
23-
this.browserName = browserName;
24-
this.browserVersion = browserVersion;
25-
this.resolution = resolution;
26-
setIconFileName(Constant.LT_ICON_FILE_NAME);
27-
setDisplayName("LT(" + operatingSystem + " " + browserName + "-" + browserVersion + " " + resolution + ")");
28-
setTestUrl(displayName);
29-
}
30-
31-
public String getOperatingSystem() {
32-
return operatingSystem;
33-
}
34-
35-
public void setOperatingSystem(String operatingSystem) {
36-
this.operatingSystem = operatingSystem;
37-
}
38-
39-
public String getBrowserName() {
40-
return browserName;
41-
}
42-
43-
public void setBrowserName(String browserName) {
44-
this.browserName = browserName;
45-
}
46-
47-
public String getBrowserVersion() {
48-
return browserVersion;
49-
}
50-
51-
public void setBrowserVersion(String browserVersion) {
52-
this.browserVersion = browserVersion;
53-
}
54-
55-
public String getResolution() {
56-
return resolution;
57-
}
58-
59-
public void setResolution(String resolution) {
60-
this.resolution = resolution;
61-
}
62-
63-
public String getBuildName() {
64-
return buildName;
65-
}
66-
67-
public void setBuildName(String buildName) {
68-
this.buildName = buildName;
69-
}
70-
71-
public String getBuildNumber() {
72-
return buildNumber;
73-
}
74-
75-
public void setBuildNumber(String buildNumber) {
76-
this.buildNumber = buildNumber;
77-
}
78-
79-
public String getTestType() {
80-
return testType;
81-
}
82-
83-
public void setTestType(String testType) {
84-
this.testType = testType;
85-
}
86-
87-
public String getIframeLink() {
88-
return iframeLink;
89-
}
90-
91-
public void setIframeLink(String iframeLink) {
92-
this.iframeLink = iframeLink;
93-
}
94-
95-
}
1+
/*
2+
Removed Iframe in new plugin version, uncomment this to implement it again
3+
*/
4+
5+
6+
//package com.lambdatest.jenkins.freestyle;
7+
//
8+
//import com.lambdatest.jenkins.freestyle.api.Constant;
9+
//
10+
//public class LambdaFreeStyleBuildAction extends AbstractFreeStyleBuildAction {
11+
// /*
12+
// * Holds info about the Selenium Test
13+
// */
14+
// private String operatingSystem;
15+
// private String browserName;
16+
// private String browserVersion;
17+
// private String resolution;
18+
// private String buildName;
19+
// private String buildNumber;
20+
// private String testType;
21+
// private String iframeLink;
22+
//
23+
// LambdaFreeStyleBuildAction(final String testType, final String operatingSystem, final String browserName,
24+
// final String browserVersion, final String resolution) {
25+
// super();
26+
// this.testType = testType;
27+
// this.operatingSystem = operatingSystem;
28+
// this.browserName = browserName;
29+
// this.browserVersion = browserVersion;
30+
// this.resolution = resolution;
31+
// setIconFileName(Constant.LT_ICON_FILE_NAME);
32+
// setDisplayName("LT(" + operatingSystem + " " + browserName + "-" + browserVersion + " " + resolution + ")");
33+
// setTestUrl(displayName);
34+
// }
35+
//
36+
// public String getOperatingSystem() {
37+
// return operatingSystem;
38+
// }
39+
//
40+
// public void setOperatingSystem(String operatingSystem) {
41+
// this.operatingSystem = operatingSystem;
42+
// }
43+
//
44+
// public String getBrowserName() {
45+
// return browserName;
46+
// }
47+
//
48+
// public void setBrowserName(String browserName) {
49+
// this.browserName = browserName;
50+
// }
51+
//
52+
// public String getBrowserVersion() {
53+
// return browserVersion;
54+
// }
55+
//
56+
// public void setBrowserVersion(String browserVersion) {
57+
// this.browserVersion = browserVersion;
58+
// }
59+
//
60+
// public String getResolution() {
61+
// return resolution;
62+
// }
63+
//
64+
// public void setResolution(String resolution) {
65+
// this.resolution = resolution;
66+
// }
67+
//
68+
// public String getBuildName() {
69+
// return buildName;
70+
// }
71+
//
72+
// public void setBuildName(String buildName) {
73+
// this.buildName = buildName;
74+
// }
75+
//
76+
// public String getBuildNumber() {
77+
// return buildNumber;
78+
// }
79+
//
80+
// public void setBuildNumber(String buildNumber) {
81+
// this.buildNumber = buildNumber;
82+
// }
83+
//
84+
// public String getTestType() {
85+
// return testType;
86+
// }
87+
//
88+
// public void setTestType(String testType) {
89+
// this.testType = testType;
90+
// }
91+
//
92+
// public String getIframeLink() {
93+
// return iframeLink;
94+
// }
95+
//
96+
// public void setIframeLink(String iframeLink) {
97+
// this.iframeLink = iframeLink;
98+
// }
99+
//
100+
//}

0 commit comments

Comments
 (0)