Fix some flaky tests due to NETWORK_CHANGED error

This commit is contained in:
Aurora Lahtela 2023-10-15 13:25:58 +03:00
parent aa06ac66f1
commit 499d82139a
2 changed files with 5 additions and 2 deletions

View File

@ -73,7 +73,10 @@ public class ExportTestUtilities {
public static void assertNoLogsExceptFaviconError(List<LogEntry> logs) {
List<String> loggedLines = logs.stream()
.map(log -> "\n" + log.getLevel().getName() + " " + log.getMessage())
.filter(log -> !log.contains("favicon.ico") && !log.contains("manifest.json") && !log.contains("fonts.gstatic.com"))
.filter(log -> !log.contains("favicon.ico")
&& !log.contains("manifest.json")
&& !log.contains("fonts.gstatic.com")
&& !log.contains("fonts.googleapis.com"))
.toList();
assertTrue(loggedLines.isEmpty(), () -> "Browser console included " + loggedLines.size() + " logs: " + loggedLines);
}

View File

@ -195,7 +195,7 @@ class JSErrorRegressionTest {
private void assertNoLogs(String testName, List<LogEntry> logs) {
assertTrue(logs.isEmpty(), () -> testName + "Browser console included " + logs.size() + " logs: " + logs.stream()
.map(log -> "\n" + log.getLevel().getName() + " " + log.getMessage())
.filter(log -> !log.contains("fonts.gstatic.com"))
.filter(log -> !log.contains("fonts.gstatic.com") && !log.contains("fonts.googleapis.com"))
.toList());
}
}