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

Add ability storing of webdriver console and network logs after failing tests #8926

Merged
merged 28 commits into from
Mar 5, 2018
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0fa6a51
change webdriver log level and study how to get most important data J…
Feb 22, 2018
f8cba6f
Test logging
Feb 26, 2018
b5f4e52
Merge branch 'master' into che#8857
Feb 26, 2018
f34a6a7
apply storing logs to SeleniumHandler
Feb 26, 2018
a362d20
final rework of BrowserLogsUtil class and apply renamed methods
Feb 27, 2018
8c668f0
rename methods according to proposals for the PR
Feb 27, 2018
b2167c8
rename method
Feb 27, 2018
360b707
Rename BrowserUtilsLog class, revert DI to the related class. Replace…
Feb 27, 2018
ac41500
remove unnecessary WebDriver injections
Feb 27, 2018
5e1ab4f
add add few logs messages for problem detection
vparfonov Feb 27, 2018
0d00d06
rename method
Feb 27, 2018
b3fe3f4
fix name of methos and javadoc
Feb 27, 2018
85f4efc
remove unnecessary static declarations from the WebDriverLogsReader
Feb 27, 2018
9861ae2
Merge branch 'che#8857' of github.com:eclipse/che into che#8857
vparfonov Feb 28, 2018
b1eab7c
remove unnecessary static declarations from the WebDriverLogsReader.
Feb 27, 2018
97d9bca
Merge branch 'che#8857' of github.com:eclipse/che into che#8857
vparfonov Mar 2, 2018
3db9bf2
Add few log messages on server side
vparfonov Mar 2, 2018
ce0cf6b
Make network logs readable; add websocket logs; remove duplicating pr…
Mar 2, 2018
cec456d
Fix store web driver output error message
Mar 3, 2018
423417f
Add javadocs, fix method names
Mar 3, 2018
44b7466
Merge remote-tracking branch 'origin/master' into che#8857
Mar 3, 2018
a2a2be2
Clean up code
Mar 3, 2018
ae5ede8
Fix time format in webdriver logs
Mar 5, 2018
be9f972
Revert "add add few logs messages for problem detection"
Mar 5, 2018
d33badc
Merge remote-tracking branch 'origin/master' into che#8857
Mar 5, 2018
c8930f2
Revert commit 'add add few logs messages for problem detection'
Mar 5, 2018
66c3ef5
Housekeeping
Mar 5, 2018
925fbf7
Clean up
Mar 5, 2018
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 @@ -255,7 +255,8 @@ private RemoteWebDriver doCreateDriver(URL webDriverUrl) {
switch (browser) {
case GOOGLE_CHROME:
LoggingPreferences loggingPreferences = new LoggingPreferences();
loggingPreferences.enable(LogType.BROWSER, Level.SEVERE);
loggingPreferences.enable(LogType.PERFORMANCE, Level.ALL);
Copy link
Contributor

@dmytro-ndp dmytro-ndp Feb 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was Level.SEVERE used for some reasons.
@Ohrimenko1988: please, comment on this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was used because only browser errors have useful information for us. But it only in case for browser's console output. In other cases (for example "Networking"), logs of other levels may be useful.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ALL levels log also can have important info

loggingPreferences.enable(LogType.BROWSER, Level.ALL);

ChromeOptions options = new ChromeOptions();
options.addArguments("--no-sandbox");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.eclipse.che.selenium.core.pageobject.PageObjectsInjector;
import org.eclipse.che.selenium.core.user.InjectTestUser;
import org.eclipse.che.selenium.core.user.TestUser;
import org.eclipse.che.selenium.core.utils.BrowserLogsUtil;
import org.eclipse.che.selenium.core.workspace.InjectTestWorkspace;
import org.eclipse.che.selenium.core.workspace.TestWorkspace;
import org.eclipse.che.selenium.core.workspace.TestWorkspaceLogsReader;
Expand Down Expand Up @@ -93,6 +94,10 @@ public abstract class SeleniumTestHandler
@Named("tests.htmldumps_dir")
private String htmldumpsDir;

@Inject
@Named("tests.webDriverLogsDir")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the same test properties naming pattern, please: tests.webDriverLogsDir > tests.webdriverlogs_dir

private String webDriverLogsDir;

@Inject
@Named("tests.workspacelogs_dir")
private String workspaceLogsDir;
Expand Down Expand Up @@ -302,6 +307,7 @@ private void onTestFinish(ITestResult result) {
captureScreenshot(result);
captureHtmlSource(result);
captureTestWorkspaceLogs(result);
storeWebDriverLogs(result);
}
}

Expand Down Expand Up @@ -464,6 +470,28 @@ private void captureScreenshotsFromOpenedWindows(
});
}

private void storeWebDriverLogs(ITestResult result) {
Set<SeleniumWebDriver> webDrivers = new HashSet<>();
Object testInstance = result.getInstance();
collectInjectedWebDrivers(testInstance, webDrivers);
webDrivers.forEach(webDriver -> getWebDriverLog(result, webDriver));
}

private void getWebDriverLog(ITestResult result, SeleniumWebDriver webDriver) {
Copy link
Contributor

@dmytro-ndp dmytro-ndp Feb 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get usually means returning something.
This method returns nothing. It stores logs of webdriver into the filesystem. So, method name should be rephrased appropriately, for example: storeWebDriverLogs

try {
String testReference = getTestReference(result);
String filename = NameGenerator.generate(testReference + "_", 4) + ".log";
Path webdriverLogDirectory = Paths.get(webDriverLogsDir, filename);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

webdriverLogDirectory > webdriverLogsDirectory

Files.createDirectories(webdriverLogDirectory.getParent());
Files.write(
webdriverLogDirectory,
BrowserLogsUtil.getCombinedLogs(webDriver).getBytes(Charset.forName("UTF-8")),
StandardOpenOption.CREATE);
} catch (WebDriverException | IOException e) {
LOG.error(format("Can't get of the logs from WebDriver for test %s", result), e);
Copy link
Contributor

@dmytro-ndp dmytro-ndp Feb 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOG.error(format("Can't get of the logs from WebDriver for test %s", result), e);
>
LOG.error(format("Can't store web driver logs related to test %s.", testReference), e);

}
}

private void dumpHtmlCodeFromTheCurrentPage(ITestResult result, SeleniumWebDriver webDriver) {
String testReference = getTestReference(result);
String filename = NameGenerator.generate(testReference + "_", 8) + ".html";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
package org.eclipse.che.selenium.core.utils;

import static org.openqa.selenium.logging.LogType.BROWSER;
import static org.openqa.selenium.logging.LogType.PERFORMANCE;

import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.net.URL;
import java.util.List;
import org.eclipse.che.selenium.core.SeleniumWebDriver;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.logging.LogEntry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -25,27 +27,115 @@
* Read and store browser logs to the test logs. Log level and type are defined in {@link
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Javadocs doesn't take into account performance logs. And this class stores nothing.

* org.eclipse.che.selenium.core.SeleniumWebDriver#doCreateDriver(URL)}
*/
@Singleton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove @Singleton?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this class does not need use DI

public class BrowserLogsUtil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class name is outdated so as it is not about just BROWSER logs, but PERFORMANCE logs as well. So, lets make the name more general: WebDriverLogsReader

private final SeleniumWebDriver seleniumWebDriver;
private final Logger LOG = LoggerFactory.getLogger(BrowserLogsUtil.class);

@Inject
public BrowserLogsUtil(SeleniumWebDriver seleniumWebDriver) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are injecting seleniumWebDriver here avoid injection it into the test class.

this.seleniumWebDriver = seleniumWebDriver;
}
private static final Logger LOG = LoggerFactory.getLogger(BrowserLogsUtil.class);

/**
* read logs from browser console
*
* @return log messages from browser console
*/
public List<LogEntry> getLogs() {
public static List<LogEntry> getConsoleLogs(WebDriver seleniumWebDriver) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets name the method as readBrowserLogs

return seleniumWebDriver.manage().logs().get(BROWSER).getAll();
}

/**
* get all logs from the active webdriver session
*
* @return all types of performance logs
*/
public static List<LogEntry> getPerformanceLogs(WebDriver seleniumWebDriver) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets name the method as readPerformanceLogs

return seleniumWebDriver.manage().logs().get(PERFORMANCE).getAll();
}

/** store browser logs to the test logs */
public void storeLogs() {
getLogs().forEach(logEntry -> LOG.info("{} {}", logEntry.getLevel(), logEntry.getMessage()));
public static void storeLogsToConsoleOutput(WebDriver seleniumWebDriver) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

storeLogsToConsoleOutput > logBrowserLogs

getConsoleLogs(seleniumWebDriver)
.forEach(logEntry -> LOG.info("{} {}", logEntry.getLevel(), logEntry.getMessage()));
}

/**
* combine the Network and Browser logs
*
* @return logs from browser console and requests/responses on CHE api
*/
public static String getCombinedLogs(WebDriver seleniumWebDriver) {
Copy link
Contributor

@dmytro-ndp dmytro-ndp Feb 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getCombinedLogs > combineBrowserAndCheTrafficLogs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method return NetworkTraffic + WebDriver java script console logs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understood it. But method name getCombinedLogs says nothing about content of getting logs.

Copy link
Contributor

@dmytro-ndp dmytro-ndp Feb 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or name it getAllLogs, and fix comment:
combine the Network and Browser logs > get all available logs of web driver.

StringBuilder combinedLogs =
new StringBuilder("Browser console logs:\n").append("---------------------\n");
getConsoleLogs(seleniumWebDriver)
.forEach(
logEntry ->
combinedLogs
.append(String.format("%s %s \n", logEntry.getLevel(), logEntry.getMessage()))
.append("\n"));
return combinedLogs.append(getNetworkDataSentOnCheApi(seleniumWebDriver)).toString();
}

/** filter data and get requests/responses that has been sent on CHE /api/ URL */
public static String getNetworkDataSentOnCheApi(WebDriver seleniumWebDriver) {
Copy link
Contributor

@dmytro-ndp dmytro-ndp Feb 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getNetworkDataSentOnCheApi > readCheNetworkTraffic

StringBuilder data = new StringBuilder("Network logs: \n").append("---------------\n");
JsonParser jsonParser = new JsonParser();
getPerformanceLogs(seleniumWebDriver)
.forEach(
logEntry -> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to use stream.filter() method explicitly to simplify code, of replace lambda with for-each, if statements.

JsonElement jsonElement = jsonParser.parse(logEntry.getMessage());
JsonObject jsonMessageNode =
jsonElement.getAsJsonObject().get("message").getAsJsonObject();
String networkValue = jsonMessageNode.get("method").getAsString();

if (networkValue.equals("Network.requestWillBeSent")) {
data.append(getRequestsSentOnChe(jsonMessageNode));

} else if (networkValue.equals("Network.responseReceived")) {
data.append(getResponsesSentOnChe(jsonMessageNode));
}
});
return data.toString();
}

/**
* check that current request contains invocation to СHE api URL and provide information about URL
* and http method/status
*
* @param requestMessage json representation of the message object from the log
* @return info about request from the WebDriver
*/
private static String getRequestsSentOnChe(JsonObject requestMessage) {
Copy link
Contributor

@dmytro-ndp dmytro-ndp Feb 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getRequestsSentOnChe > extractCheRequests

JsonObject requestNode = requestMessage.getAsJsonObject("params").getAsJsonObject("request");
StringBuilder requestInfo = new StringBuilder();
if (isLogEntryContainsApiUrl(requestNode)) {
requestInfo
.append("Request Info :---------------> \n")
.append("Method: " + requestNode.get("method"))
.append("\n")
.append("URL: " + requestNode.get("url"))
.append("\n\n");
}
return requestInfo.toString();
}

/**
* check that current response contains invocation to СHE api URL and provide information about
* URL and http method/status
*
* @param requestMessage json representation of the message object from the log
* @return info about request from the WebDriver
*/
private static String getResponsesSentOnChe(JsonObject requestMessage) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getResponsesSentOnChe > extractCheResponces

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sorry: typo from my side: extractCheResponces > extractCheResponses

JsonObject responseNode = requestMessage.getAsJsonObject("params").getAsJsonObject("response");
StringBuilder responceInfo = new StringBuilder();
if (isLogEntryContainsApiUrl(responseNode)) {
responceInfo
.append("Response Info : <--------------- \n")
.append("Method: " + responseNode.get("status"))
.append("\n")
.append("URL: " + responseNode.get("url"))
.append("\n\n");
}
return responceInfo.toString();
}

private static boolean isLogEntryContainsApiUrl(JsonObject node) {
Copy link
Contributor

@dmytro-ndp dmytro-ndp Feb 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isLogEntryContainsApiUrl > isNodeFromCheTraffic

return (node.get("url").isJsonNull()) ? false : node.get("url").getAsString().contains("/api/");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there could be requests to other resources with "/api/" in URL. It's more reliable to check on Che hostname as well.

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.LOAD_PAGE_TIMEOUT_SEC;
import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.REDRAW_UI_ELEMENTS_TIMEOUT_SEC;
import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.WIDGET_TIMEOUT_SEC;
import static org.eclipse.che.selenium.core.utils.BrowserLogsUtil.storeLogsToConsoleOutput;
import static org.eclipse.che.selenium.pageobject.ProjectExplorer.Locators.ALL_PROJECTS_XPATH;
import static org.eclipse.che.selenium.pageobject.ProjectExplorer.Locators.CONTEXT_MENU_ID;
import static org.eclipse.che.selenium.pageobject.ProjectExplorer.Locators.EXPLORER_RIGHT_TAB_ID;
Expand Down Expand Up @@ -82,7 +83,6 @@ public class ProjectExplorer {
private final Menu menu;
private final CodenvyEditor editor;
private final TestWebElementRenderChecker testWebElementRenderChecker;
private final BrowserLogsUtil browserLogsUtil;
private final SeleniumWebDriverHelper seleniumWebDriverHelper;
private WebDriverWait loadPageTimeout;
private WebDriverWait redrawUiElementsWait;
Expand All @@ -105,7 +105,6 @@ public ProjectExplorer(
this.menu = menu;
this.editor = editor;
this.testWebElementRenderChecker = testWebElementRenderChecker;
this.browserLogsUtil = browserLogsUtil;
this.seleniumWebDriverHelper = seleniumWebDriverHelper;
loadPageTimeout = new WebDriverWait(seleniumWebDriver, LOAD_PAGE_TIMEOUT_SEC);
redrawUiElementsWait = new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC);
Expand Down Expand Up @@ -253,10 +252,9 @@ public void waitProjectExplorer(int timeout) {
// remove try-catch block after issue has been resolved

if (seleniumWebDriverHelper.isVisible(By.id("ide-loader-progress-bar"))) {
browserLogsUtil.storeLogs();
storeLogsToConsoleOutput(seleniumWebDriver);
fail("Known issue https://github.com/eclipse/che/issues/8468", ex);
}

throw ex;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
*/
package org.eclipse.che.selenium.editor.autocomplete;

import static org.eclipse.che.selenium.core.utils.BrowserLogsUtil.storeLogsToConsoleOutput;
import static org.testng.Assert.fail;

import com.google.inject.Inject;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Paths;
import org.eclipse.che.selenium.core.SeleniumWebDriver;
import org.eclipse.che.selenium.core.client.TestProjectServiceClient;
import org.eclipse.che.selenium.core.project.ProjectTemplates;
import org.eclipse.che.selenium.core.utils.BrowserLogsUtil;
import org.eclipse.che.selenium.core.workspace.TestWorkspace;
import org.eclipse.che.selenium.pageobject.CodenvyEditor;
import org.eclipse.che.selenium.pageobject.Ide;
Expand Down Expand Up @@ -51,7 +52,7 @@ public class AutocompleteProposalJavaDocTest {
@Inject private CodenvyEditor editor;
@Inject private NotificationsPopupPanel notificationsPopupPanel;
@Inject private TestProjectServiceClient testProjectServiceClient;
@Inject private BrowserLogsUtil browserLogsUtil;
@Inject private SeleniumWebDriver webDriver;

@BeforeClass
public void setup() throws Exception {
Expand Down Expand Up @@ -217,7 +218,7 @@ private void launchAutocompleteAndWaitContainer() throws Exception {
logExternalLibraries();
logProjectTypeChecking();
logProjectLanguageChecking();
browserLogsUtil.storeLogs();
storeLogsToConsoleOutput(webDriver);

// remove try-catch block after issue has been resolved
fail("Known issue https://github.com/eclipse/che/issues/7161", ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/
package org.eclipse.che.selenium.editor.autocomplete;

import static org.eclipse.che.selenium.core.utils.BrowserLogsUtil.storeLogsToConsoleOutput;
import static org.eclipse.che.selenium.pageobject.CodenvyEditor.MarkersType.ERROR_MARKER;
import static org.eclipse.che.selenium.pageobject.CodenvyEditor.MarkersType.TASK_MARKER_OVERVIEW;
import static org.testng.Assert.fail;
Expand All @@ -18,9 +19,9 @@
import java.net.URL;
import java.nio.file.Paths;
import org.eclipse.che.commons.lang.NameGenerator;
import org.eclipse.che.selenium.core.SeleniumWebDriver;
import org.eclipse.che.selenium.core.client.TestProjectServiceClient;
import org.eclipse.che.selenium.core.project.ProjectTemplates;
import org.eclipse.che.selenium.core.utils.BrowserLogsUtil;
import org.eclipse.che.selenium.core.workspace.TestWorkspace;
import org.eclipse.che.selenium.pageobject.CodenvyEditor;
import org.eclipse.che.selenium.pageobject.CodenvyEditor.MarkersType;
Expand Down Expand Up @@ -60,7 +61,7 @@ public class AutocompleteWithInheritTest {
@Inject private CodenvyEditor editor;
@Inject private MavenPluginStatusBar mavenPluginStatusBar;
@Inject private TestProjectServiceClient testProjectServiceClient;
@Inject private BrowserLogsUtil browserLogsUtil;
@Inject private SeleniumWebDriver seleniumWebDriver;

@BeforeClass
public void prepare() throws Exception {
Expand Down Expand Up @@ -123,7 +124,7 @@ private void waitErrorMarkerInPosition() throws Exception {
logExternalLibraries();
logProjectTypeChecking();
logProjectLanguageChecking();
browserLogsUtil.storeLogs();
storeLogsToConsoleOutput(seleniumWebDriver);

// remove try-catch block after issue has been resolved
fail("Known issue https://github.com/eclipse/che/issues/7161", ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
*/
package org.eclipse.che.selenium.editor.autocomplete;

import static org.eclipse.che.selenium.core.utils.BrowserLogsUtil.storeLogsToConsoleOutput;
import static org.testng.Assert.fail;

import com.google.inject.Inject;
import java.net.URL;
import java.nio.file.Paths;
import org.eclipse.che.commons.lang.NameGenerator;
import org.eclipse.che.selenium.core.SeleniumWebDriver;
import org.eclipse.che.selenium.core.client.TestProjectServiceClient;
import org.eclipse.che.selenium.core.project.ProjectTemplates;
import org.eclipse.che.selenium.core.utils.BrowserLogsUtil;
import org.eclipse.che.selenium.core.workspace.TestWorkspace;
import org.eclipse.che.selenium.pageobject.CodenvyEditor;
import org.eclipse.che.selenium.pageobject.CodenvyEditor.MarkersType;
Expand Down Expand Up @@ -62,7 +63,7 @@ public class ShowHintsCommandTest {
@Inject private CodenvyEditor editor;
@Inject private TestProjectServiceClient testProjectServiceClient;
@Inject private Consoles console;
@Inject private BrowserLogsUtil browserLogsUtil;
@Inject private SeleniumWebDriver seleniumWebDriver;

@BeforeClass
public void prepare() throws Exception {
Expand Down Expand Up @@ -123,7 +124,7 @@ private void waitErrorMarkerInPosition() throws Exception {
logExternalLibraries();
logProjectTypeChecking();
logProjectLanguageChecking();
browserLogsUtil.storeLogs();
storeLogsToConsoleOutput(seleniumWebDriver);

// remove try-catch block after issue has been resolved
fail("Known issue https://github.com/eclipse/che/issues/7161", ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ public void checkFactoryAcceptingWithPerUserPolicy() throws Exception {
try {
seleniumWebDriver.switchFromDashboardIframeToIde();
} catch (TimeoutException ex) {
browserLogsUtil.storeLogs();
LOG.info(
String.format(
CheckFactoryWithPerUserCreatePolicyTest.class.getSimpleName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
*/
package org.eclipse.che.selenium.opendeclaration;

import static org.eclipse.che.selenium.core.utils.BrowserLogsUtil.storeLogsToConsoleOutput;
import static org.eclipse.che.selenium.pageobject.CodenvyEditor.MarkersType.WARNING_MARKER;
import static org.testng.Assert.fail;

import com.google.inject.Inject;
import java.net.URL;
import java.nio.file.Paths;
import org.eclipse.che.commons.lang.NameGenerator;
import org.eclipse.che.selenium.core.SeleniumWebDriver;
import org.eclipse.che.selenium.core.client.TestProjectServiceClient;
import org.eclipse.che.selenium.core.project.ProjectTemplates;
import org.eclipse.che.selenium.core.utils.BrowserLogsUtil;
Expand Down Expand Up @@ -48,6 +50,7 @@ public class Eclipse0093Test {
@Inject private CodenvyEditor editor;
@Inject private TestProjectServiceClient testProjectServiceClient;
@Inject private BrowserLogsUtil browserLogsUtil;
@Inject private SeleniumWebDriver webDriver;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's better to avoid injection of WebDriver into the test. Lets inject webdriver in the same way as it was done in SeleniumWebDriverHelper class.


@BeforeClass
public void prepare() throws Exception {
Expand Down Expand Up @@ -77,7 +80,7 @@ private void waitMarkerInPosition() throws Exception {
logExternalLibraries();
logProjectTypeChecking();
logProjectLanguageChecking();
browserLogsUtil.storeLogs();
storeLogsToConsoleOutput(webDriver);

// remove try-catch block after issue has been resolved
fail("Known issue https://github.com/eclipse/che/issues/7161", ex);
Expand Down
Loading