Skip to content

Commit ec1d833

Browse files
janfaraciktimja
andauthored
Forward compatibility for Redesign the Jenkins header (#1917)
Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>
1 parent 11b1fb9 commit ec1d833

7 files changed

Lines changed: 14 additions & 16 deletions

src/test/java/core/FormValidationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ private void jsValidation() {
7575
}
7676

7777
private void navigateAway() {
78-
jenkins.runThenConfirmAlert(() -> driver.findElement(By.xpath("//ol[@id=\"breadcrumbs\"]/li[1]/a"))
79-
.click());
78+
jenkins.runThenConfirmAlert(
79+
() -> driver.findElement(By.id("jenkins-head-icon")).click());
8080
sleep(1000); // Needed for some reason
8181
}
8282
}

src/test/java/core/PublisherOrderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ public void testUnordered() {
6565
* Navigate back to the dashboard first to dismiss the alert so that CspRule can check for violations (see
6666
* FormValidationTest).
6767
*/
68-
jenkins.runThenConfirmAlert(() -> driver.findElement(By.xpath("//ol[@id=\"breadcrumbs\"]/li[1]/a"))
69-
.click());
68+
jenkins.runThenConfirmAlert(
69+
() -> driver.findElement(By.id("jenkins-head-icon")).click());
7070
sleep(1000);
7171
}
7272
}

src/test/java/plugins/ArtifactoryPluginTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ public void check_config_is_persisted() {
7171
* Navigate back to the dashboard first to dismiss the alert so that CspRule can check for violations (see
7272
* FormValidationTest).
7373
*/
74-
jenkins.runThenConfirmAlert(() -> driver.findElement(By.xpath("//ol[@id=\"breadcrumbs\"]/li[1]/a"))
75-
.click());
74+
jenkins.runThenConfirmAlert(
75+
() -> driver.findElement(By.id("jenkins-head-icon")).click());
7676
sleep(1000);
7777
}
7878

src/test/java/plugins/DashboardViewPluginTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import static org.hamcrest.MatcherAssert.assertThat;
44
import static org.hamcrest.Matchers.endsWith;
55
import static org.hamcrest.Matchers.equalToIgnoringCase;
6-
import static org.hamcrest.Matchers.hasSize;
76
import static org.hamcrest.Matchers.is;
87
import static org.jenkinsci.test.acceptance.Matchers.hasContent;
98
import static org.junit.Assert.assertEquals;
@@ -208,7 +207,6 @@ public void configureDashboardNameAndDescription() {
208207
assertThat(url, endsWith(name + "/"));
209208

210209
final List<String> breadCrumbs = v.breadCrumbs.getBreadCrumbs();
211-
assertThat(breadCrumbs, hasSize(2));
212210
final String nameCrumb = breadCrumbs.get(breadCrumbs.size() - 1);
213211
assertThat(nameCrumb, is(name));
214212

src/test/java/plugins/MailerPluginTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ public void send_test_mail() throws IOException {
4747
* Navigate back to the dashboard first to dismiss the alert so that CspRule can check for violations (see
4848
* FormValidationTest).
4949
*/
50-
jenkins.runThenConfirmAlert(() -> driver.findElement(By.xpath("//ol[@id=\"breadcrumbs\"]/li[1]/a"))
51-
.click());
50+
jenkins.runThenConfirmAlert(
51+
() -> driver.findElement(By.id("jenkins-head-icon")).click());
5252
sleep(1000);
5353
}
5454

src/test/java/plugins/PlainCredentialsBindingTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ public void systemSecretFileCredentialTest() throws URISyntaxException {
7575
* Navigate back to the dashboard first to dismiss the alert so that CspRule can check for violations (see
7676
* FormValidationTest).
7777
*/
78-
jenkins.runThenConfirmAlert(() -> driver.findElement(By.xpath("//ol[@id=\"breadcrumbs\"]/li[1]/a"))
79-
.click());
78+
jenkins.runThenConfirmAlert(
79+
() -> driver.findElement(By.id("jenkins-head-icon")).click());
8080
sleep(1000);
8181
}
8282

@@ -88,8 +88,8 @@ public void systemSecretTextCredentialTest() throws URISyntaxException {
8888
* Navigate back to the dashboard first to dismiss the alert so that CspRule can check for violations (see
8989
* FormValidationTest).
9090
*/
91-
jenkins.runThenConfirmAlert(() -> driver.findElement(By.xpath("//ol[@id=\"breadcrumbs\"]/li[1]/a"))
92-
.click());
91+
jenkins.runThenConfirmAlert(
92+
() -> driver.findElement(By.id("jenkins-head-icon")).click());
9393
sleep(1000);
9494
}
9595

src/test/java/plugins/SshSlavesPluginTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ public void newSlaveWithExistingCredential() throws Exception {
152152
* Navigate back to the dashboard first to dismiss the alert so that CspRule can check for violations (see
153153
* FormValidationTest).
154154
*/
155-
jenkins.runThenConfirmAlert(() -> driver.findElement(By.xpath("//ol[@id=\"breadcrumbs\"]/li[1]/a"))
156-
.click());
155+
jenkins.runThenConfirmAlert(
156+
() -> driver.findElement(By.id("jenkins-head-icon")).click());
157157
sleep(1000);
158158
}
159159

0 commit comments

Comments
 (0)