Skip to content
Open
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
21 changes: 21 additions & 0 deletions mkcli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import xml.etree.ElementTree
from time import strftime
from mkcloud import gatherScreenshots, resizeImages
from zipfile import ZipFile
#import ssl

def gatherFeedbackData(browserName):
Expand Down Expand Up @@ -237,6 +238,26 @@ def run(args):
except Exception as e:
print("Not connection to support Data Base")
print(e)
#LOGS
try:
zipObj = ZipFile('logs.zip', 'w')
zipObj.write('driver.log')
zipObj.write('browser.log')
zipObj.write('performance.log')
zipObj.write('detailed.log')
zipObj.close()

if os.path.exists('logs.zip'):
logFileName = 'logs.zip'
logFile = open(logFileName, 'rb')
files = {'file' : logFile}
requests.post( muuktestRoute + 'upload_logs/' , headers=hed, data={'origin': "executor", 'key': key, 'executionNumber': str(executionNumber)} , files=files, verify=False)
if os.path.exists("logs.zip"):
os.remove('logs.zip')
except Exception as e:
print("Error on logs uploading")
print(e)
#END OF LOGS
else:
print(field+': is not an allowed property')

Expand Down
29 changes: 27 additions & 2 deletions src/test/resources/GebConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
import org.openqa.selenium.chrome.ChromeDriver
import org.openqa.selenium.chrome.ChromeOptions
import org.openqa.selenium.firefox.FirefoxDriver
import org.openqa.selenium.logging.LoggingPreferences
import org.openqa.selenium.remote.DesiredCapabilities
import java.util.logging.Level;
import org.openqa.selenium.logging.LogType;
import static java.util.logging.Level.ALL
import static org.openqa.selenium.logging.LogType.BROWSER
import static org.openqa.selenium.logging.LogType.DRIVER
import static org.openqa.selenium.logging.LogType.PERFORMANCE
import static org.openqa.selenium.remote.CapabilityType.LOGGING_PREFS


waiting {
timeout = 2
Expand All @@ -14,7 +24,22 @@ environments {
// run via “./gradlew chromeTest”
// See: http://code.google.com/p/selenium/wiki/ChromeDriver
chrome {
driver = { new ChromeDriver() }
DesiredCapabilities capabilities = DesiredCapabilities.chrome()
ChromeOptions options = new ChromeOptions()
options.setExperimentalOption("prefs", ["browser.custom_chrome_frame": false])
options.addArguments('enable-logging')
options.addArguments('v=1')
options.addArguments('log-level=0')
options.addArguments('log-file=detailed.log')
capabilities.setCapability(ChromeOptions.CAPABILITY, options)
LoggingPreferences logPrefs = new LoggingPreferences()
logPrefs.enable(BROWSER, ALL)
logPrefs.enable(DRIVER, ALL)
logPrefs.enable(PERFORMANCE, ALL)
capabilities.setCapability(LOGGING_PREFS, logPrefs)
options.setCapability("goog:loggingPrefs", logPrefs);
capabilities.setCapability(ChromeOptions.CAPABILITY, options)
driver = { new ChromeDriver(options) }
}

// run via “./gradlew chromeHeadlessTest”
Expand All @@ -36,4 +61,4 @@ environments {
}

// To run the tests with all browsers just run “./gradlew test”
baseUrl = "http://gebish.org"
baseUrl = "http://gebish.org"