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

[JENKINS-69650] Fix test reporting of Security2779Test #7134

Merged
merged 4 commits into from
Sep 26, 2022
Merged
Changes from 1 commit
Commits
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
9 changes: 7 additions & 2 deletions test/src/test/java/jenkins/security/Security2779Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ public class Security2779Test {
@Rule
public JenkinsRule j = new JenkinsRule();

@Parameterized.Parameters
// Dynamic tests are not fully supported by the maven surefire plugin
// Failures of one parameter are treated as "flakes" of the named test
// instead of being treated as failures.
// Test output includes the test number and argument to make it a little easier to diagnose
@Parameterized.Parameters(name = "test:{index} arg:\"{0}\"")
public static Collection<String> getSelectors() {
return Arrays.asList("#link-panel a", "#icon-panel svg");
}
Expand All @@ -47,7 +51,8 @@ public void noXssInHelp() throws Exception {
assertThat(eventResult, instanceOf(boolean.class));
Assert.assertTrue((boolean) eventResult);
webClient.waitForBackgroundJavaScript(2000);
Assert.assertEquals(0, alerts.get());
// Assertion includes the selector for easier diagnosis
jglick marked this conversation as resolved.
Show resolved Hide resolved
Assert.assertEquals("Alert with selector '" + selector + "'", 0, alerts.get());

final ScriptResult innerHtmlScript = page.executeJavaScript("document.querySelector('#tt').innerHTML");
Object jsResult = innerHtmlScript.getJavaScriptResult();
Expand Down