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

Debug logs #178

Merged
merged 5 commits into from
Apr 24, 2018
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 2 additions & 4 deletions src/test/java/org/jitsi/meet/test/base/FailureListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ private void saveBrowserLogs(
{
try
{
LogEntries logs = p.getBrowserLogs();
List logs = p.getBrowserLogs();

if (logs != null)
{
Expand All @@ -403,14 +403,12 @@ private void saveBrowserLogs(
= new BufferedWriter(
new FileWriter(outputFile)))
{
for (LogEntry e : logs)
for (Object e : logs)
{
out.write(e.toString());
out.newLine();
out.newLine();
}
out.flush();
out.close();
}
}
}
Expand Down
12 changes: 1 addition & 11 deletions src/test/java/org/jitsi/meet/test/base/Participant.java
Original file line number Diff line number Diff line change
Expand Up @@ -490,17 +490,7 @@ public void saveHtmlSource(File outputDir, String fileName)
*/
public abstract String getRTPStats();

public LogEntries getBrowserLogs()
{
if (type.isFirefox())
{
// not currently supported in FF
// https://github.com/SeleniumHQ/selenium/issues/2910
return null;
}

return driver.manage().logs().get(LogType.BROWSER);
}
public abstract List getBrowserLogs();
Copy link
Member

Choose a reason for hiding this comment

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

can we specify what kind of list that is ? List or whatever

Copy link
Member

Choose a reason for hiding this comment

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

sorry, I meant List<Object>

Copy link
Member Author

Choose a reason for hiding this comment

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

What is the point of having that?

Copy link
Member

Choose a reason for hiding this comment

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

Because in one doc you write it's a string in other there can be just anything and it's not obvious what's there. It's just kind of self documenting, but you can leave it as is if you don't like that

Copy link
Member Author

Choose a reason for hiding this comment

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

I just don't see the point of having that. If there is nothing it is Object.

Copy link
Member

Choose a reason for hiding this comment

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

yeah, maybe I just got used to templates somehow


/**
* Returns the value for the given <tt>key</tt> from the config.js loaded
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,15 +370,15 @@ public boolean isInMuc()
}

@Override
public LogEntries getBrowserLogs()
public List getBrowserLogs()
{
if (type.isAndroid())
{
return driver.manage().logs().get("logcat");
return driver.manage().logs().get("logcat").getAll();
}
else
{
return super.getBrowserLogs();
return null;
}
}

Expand Down
7 changes: 7 additions & 0 deletions src/test/java/org/jitsi/meet/test/web/WebParticipant.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.openqa.selenium.remote.*;
import org.openqa.selenium.support.ui.*;

import java.util.*;
import java.util.concurrent.*;
import java.util.logging.*;

Expand Down Expand Up @@ -514,4 +515,10 @@ public WebFilmstrip getFilmstrip()

return filmstrip;
}

@Override
public List getBrowserLogs()
{
return (List)executeScript("return APP.debugLogs.getLogs();");
Copy link
Member

Choose a reason for hiding this comment

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

can we try catch RuntimeException here and return empty List or null in case "APP" will be undefined ?

Copy link
Member

Choose a reason for hiding this comment

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

also there's missing space after (List)

Copy link
Member Author

Choose a reason for hiding this comment

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

This is fixed.

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,6 @@ protected WebParticipant doCreateParticipant(ParticipantOptions options)
startWebDriver(webOptions),
webOptions.getParticipantType());

// Adds a print in the console/selenium-node logs
// useful when checking crashes or failures in node logs
webParticipant.executeScript(
"console.log('--- Will start test:"
+ getClass().getSimpleName() + "')");

return webParticipant;
}

Expand Down