Skip to content
New issue

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

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

Already on GitHub? # to your account

Adapt to new CSP design #1839

Merged
merged 4 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public Statement apply(final Statement base, final Description d) {
public void evaluate() throws Throwable {
Jenkins jenkins = injector.getInstance(Jenkins.class);

if (isEnabled() && !isSkipped()) {
// TODO enable for LogParserTest when JENKINS-74890 is resolved
if (isEnabled() && !isSkipped() && !d.getTestClass().getName().equals("plugins.LogParserTest")) {
PluginSpec plugin = new PluginSpec("csp");
jenkins.getPluginManager().installPlugins(plugin);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.jenkinsci.test.acceptance.plugins.csp;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.jenkinsci.test.acceptance.po.Jenkins;
import org.jenkinsci.test.acceptance.po.PageObject;
Expand All @@ -14,7 +15,16 @@ public ContentSecurityPolicyReport(Jenkins context) {

public List<String> getReport() {
List<String> lines = new ArrayList<>();
WebElement table = find(By.className("bigtable"));
WebElement table = getElement(By.className("jenkins-table"));
if (table == null) {
timja marked this conversation as resolved.
Show resolved Hide resolved
String text = find(By.className("jenkins-notice")).getText();
if (text.contains("No reports")) {
return Collections.emptyList();
} else {
throw new AssertionError("Couldn't find any results or the no results message");
}
}

List<WebElement> headers = table.findElements(By.tagName("th"));
StringBuilder sb = new StringBuilder();
for (WebElement header : headers) {
Expand Down
Loading