Skip to content

Commit

Permalink
Rotate Geckodriver log file
Browse files Browse the repository at this point in the history
  • Loading branch information
StegSchreck committed Jan 22, 2018
1 parent 0a58ed2 commit ed9f288
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -3,6 +3,6 @@ RatS/credentials.cfg
ghostdriver.log
*.pyc
RatS/exports/*
geckodriver.log
*geckodriver.log
build
dist
8 changes: 7 additions & 1 deletion ISSUE_TEMPLATE.md
@@ -1,6 +1,6 @@
## System
* Version: <!-- RatS version -->
* Platform: <!-- e.g. Linux/macOS/Windows + version -->
* Platform: <!-- e.g. Linux/MacOS/Windows + version -->
* Firefox version: <!-- from the about dialogue -->
* Python version: <!-- `python --version` -->
* PIP version: <!-- `pip --version` -->
Expand All @@ -13,3 +13,9 @@
<!--
Error and stacktrace produced by the script in the console.
-->

## Geckodriver log

<!--
There is a {TIMESTAMP}_geckdrover.log file. Most of the time, this is not needed.
-->
9 changes: 8 additions & 1 deletion RatS/base/base_site.py
@@ -1,3 +1,4 @@
import datetime
import json
import os
import sys
Expand All @@ -13,6 +14,7 @@
from RatS.utils.bash_color import BashColor
from RatS.utils import command_line

TIMESTAMP = datetime.datetime.fromtimestamp(time.time()).strftime('%Y%m%d%H%M%S')
EXPORTS_FOLDER = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, 'RatS', 'exports'))


Expand Down Expand Up @@ -75,7 +77,12 @@ def _init_browser(self):
# https://github.com/mozilla/geckodriver/issues/858#issuecomment-322512336
profile.set_preference("dom.file.createInChild", True)

self.browser = Firefox(firefox_profile=profile, capabilities=capabilities, firefox_options=options)
self.browser = Firefox(
firefox_profile=profile,
capabilities=capabilities,
firefox_options=options,
log_path="{timestamp}_geckodriver.log".format(timestamp=TIMESTAMP)
)
# http://stackoverflow.com/questions/42754877/cant-upload-file-using-selenium-with-python-post-post-session-b90ee4c1-ef51-4 # pylint: disable=line-too-long
self.browser._is_remote = False # pylint: disable=protected-access

Expand Down

0 comments on commit ed9f288

Please sign in to comment.