Skip to content

Commit

Permalink
hanlde login before trying to set the debug cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
rambo committed Sep 24, 2015
1 parent c1f3969 commit 5de60a1
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions bin/performance_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,20 @@ def getn(url):
)
else:
raise Exception("Do not know how to set proxy for %s" % CAPS)

atexit.register(DRIVER.quit)
DRIVER.implicitly_wait(30)
#DRIVER.maximize_window()
DRIVER.set_window_size(1280, 1024)

# If we have login_handler_module specified, use it
if len(sys.argv) >= 4:
import importlib
m = importlib.import_module(sys.argv[3])
h = m.loginhandler(DRIVER)
h.login()

# Check if we want to set the xdebug profiling cookie
profile_url = os.environ.get('XDEBUG_PROFILE')
if profile_url:
DRIVER.get(profile_url)
Expand All @@ -103,13 +113,7 @@ def getn(url):
'domain': urlparse.urlparse(profile_url).netloc
})

# If we have login_handler_module specified, use it
if len(sys.argv) >= 4:
import importlib
m = importlib.import_module(sys.argv[3])
h = m.loginhandler(DRIVER)
h.login()

# Go trhough the urls file line by line
with open(sys.argv[1]) as urlsfile:
print(""""timestamp";"url";"ttfb";"ttlb";"ttrdy";"loading time";"rendertime";"Full performance JSON";""");
for x in range(num_runs):
Expand Down

0 comments on commit 5de60a1

Please sign in to comment.