<commit_before>'''
    A doc string that explains it all, but does it?
'''

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
import os
import sys


CHROMEDRIVERLOCATION = ".\\resources\\chromedriver.exe"
CEF3LOCATION = ".\\CEF3_1547\\Release\\cefclient.exe"
BRACKETSLOCATION = ".\\browser\\VisuUI.exe"

TEST_URL = "http://www.python.org"


def test_chrome():
    '''
        useless docstring
    '''
    print "setting up CHROME"
    chromedriver = CHROMEDRIVERLOCATION
    os.environ["webdriver.chrome.driver"] = chromedriver
    driver = webdriver.Chrome(chromedriver)

    driver.get(TEST_URL)
    test(driver)


def test_firefox():
    '''
        useless docstring
    '''
    print "setting up FIREFOX"
    driver = webdriver.Firefox()
    driver.get(TEST_URL)
    test(driver)


def test_cef():
    '''
        useless docstring
    '''
    print "setting up CEF"
    chrome_options = Options()
    chrome_options.add_argument("--disable-extensions")
    chrome_options.add_argument("--url=" + TEST_URL)
    chrome_options.binary_location = CEF3LOCATION

    chromedriver = CHROMEDRIVERLOCATION
    os.environ["webdriver.chrome.driver"] = chromedriver
    driver = webdriver.Chrome(chromedriver, chrome_options=chrome_options)
    test(driver)

def test_brackets():
    '''
        useless docstring
    '''
    print "setting up CEF"
    chrome_options = Options()
    chrome_options.add_argument("--disable-extensions")
    chrome_options.add_argument("--url=" + TEST_URL)
    chrome_options.add_argument("--remote-debugging-port=" + "9234")
    chrome_options.binary_location = BRACKETSLOCATION

    chromedriver = CHROMEDRIVERLOCATION
    os.environ["webdriver.chrome.driver"] = chromedriver
    driver = webdriver.Chrome(chromedriver, chrome_options=chrome_options)
    test(driver)


def test(driver):
    '''
        useless docstring
    '''
    assert "Python" in driver.title
    elem = driver.find_element_by_name("q")
    elem.send_keys("selenium")
    elem.send_keys(Keys.RETURN)
    assert "Google" in driver.title
    driver.close()

    print "Closed driver and finished"<commit_msg>Including sample test for brackets browser<commit_after>'''
    A doc string that explains it all, but does it?
'''

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
import os
import sys


CHROME_DRIVER_LOCATION = ".\\resources\\chromedriver.exe"
CEF3_LOCATION = ".\\CEF3_1547\\Release\\cefclient.exe"
BRACKETS_LOCATION = ".\\brackets_shell\\brackets.exe"

TEST_URL = "http://www.python.org"


def test_chrome():
    '''
        useless docstring
    '''
    print "setting up CHROME"
    chromedriver = CHROME_DRIVER_LOCATION
    os.environ["webdriver.chrome.driver"] = chromedriver
    driver = webdriver.Chrome(chromedriver)

    driver.get(TEST_URL)
    test(driver)


def test_firefox():
    '''
        useless docstring
    '''
    print "setting up FIREFOX"
    driver = webdriver.Firefox()
    driver.get(TEST_URL)
    test(driver)


def test_cef():
    '''
        useless docstring
    '''
    print "setting up CEF"
    chrome_options = Options()
    chrome_options.add_argument("--disable-extensions")
    chrome_options.add_argument("--url=" + TEST_URL)
    chrome_options.add_argument("--start-maximized")
    chrome_options.binary_location = CEF3_LOCATION

    chromedriver = CHROME_DRIVER_LOCATION
    os.environ["webdriver.chrome.driver"] = chromedriver
    driver = webdriver.Chrome(chromedriver, chrome_options=chrome_options)
    test(driver)


def test_brackets():
    '''
        useless docstring
    '''
    print "setting up CEF"
    chrome_options = Options()
    chrome_options.add_argument("--disable-extensions")
    chrome_options.add_argument("--url=" + TEST_URL)
    # chrome_options.add_argument("--remote-debugging-port=" + "9234")
    chrome_options.add_argument("--fullscreen-enabled")
    chrome_options.binary_location = BRACKETS_LOCATION

    chromedriver = CHROME_DRIVER_LOCATION
    os.environ["webdriver.chrome.driver"] = chromedriver
    driver = webdriver.Chrome(chromedriver, chrome_options=chrome_options)
    test(driver)

def test(driver):
    '''
        useless docstring
    '''
    assert "Python" in driver.title
    elem = driver.find_element_by_name("q")
    elem.send_keys("selenium")
    elem.send_keys(Keys.RETURN)
    assert "Google" in driver.title
    driver.close()

    print "Closed driver and finished"
{'fraction_non_alphanumeric': 0.11424169051287696, 'fraction_numerical': 0.004842615012106538, 'mean_word_length': 3.5852674066599395, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2663423', 'n_tokens_mistral': 1512, 'n_tokens_neox': 1434, 'n_words': 272}