Skip to content

Instantly share code, notes, and snippets.

View abalakh's full-sized avatar

Andrii Balakhtar abalakh

  • Scalr
  • Lviv, Ukraine
View GitHub Profile
@abalakh
abalakh / test.diff
Created August 22, 2018 16:02
export support for chrome
diff --git a/airgun/browser.py b/airgun/browser.py
index 055d2a3..a2f0ca0 100644
--- a/airgun/browser.py
+++ b/airgun/browser.py
@@ -165,6 +165,11 @@ class SeleniumBrowserFactory(object):
if self.browser == 'chrome':
if binary:
kwargs.update({'executable_path': binary})
+ options = webdriver.ChromeOptions()
+ prefs = {
@abalakh
abalakh / js_waiters.md
Created January 31, 2018 21:29
waiter script for satellite

1 check per line format:

return {
    jquery: (typeof jQuery === "undefined") ? true : jQuery.active < 1,
    ajax: (typeof Ajax === "undefined") ? true : Ajax.activeRequestCount < 1,
    document: document.readyState == "complete",
    angular: (typeof angular === "undefined") ? true : angular.element(document).injector().get("$http").pendingRequests.length < 1,
    spinner: (document.getElementById("turbolinks-progress") === null) ? true : document.getElementById("turbolinks-progress").style["display"] == "none"
}
@abalakh
abalakh / cli.md
Last active September 3, 2015 22:13

Get rid of return_code checks for CLI

Was experimenting with CLI recently and came to one idea. The main thing that annoys in CLI tests compared with API, is amount of redundant code we have, like this:

# API
content_view = entities.ContentView(id=123).read()

# CLI
result = ContentView.info({'id': 123})