<commit_before># https://sites.google.com/a/chromium.org/chromedriver/getting-started

# import time
# from selenium import webdriver
# import selenium.webdriver.chrome.service as service
#
# service = service.Service('./chromedriver')
# service.start()
# capabilities = {
#     'chrome.binary': '/Users/teo/dev/sc-ui/dist/AppGate XDP-darwin-x64/AppGate XDP.app/Contents/MacOS/Electron'}
# driver = webdriver.Remote(service.service_url, capabilities)
# driver.get('http://www.google.com/xhtml')
# time.sleep(1)  # Let the user actually see something!
# driver.quit()

import os
import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

chromedriver_path = "./chromedriver"
electron_path = "/Users/teo/dev/sc-ui/dist/AppGate XDP-darwin-x64/AppGate XDP.app/Contents/MacOS/Electron"

opts = Options()
opts.binary_location = electron_path
driver = webdriver.Chrome(executable_path=chromedriver_path, chrome_options=opts)

time.sleep(3)

username = driver.find_element_by_css_selector('#cards > div.cards.style-scope.task-cards > task-card > sign-in > div > div > paper-input:nth-child(3) > paper-input-container > div.input-content.style-scope.paper-input-container #labelAndInputContainer #input')
username.send_keys('teoman.soygul')
password = driver.find_element_by_css_selector('#cards > div.cards.style-scope.task-cards > task-card > sign-in > div > div > paper-input:nth-child(4) > paper-input-container > div.input-content.style-scope.paper-input-container #labelAndInputContainer #input')
password.send_keys(os.environ['PASS'])

time.sleep(2)

connect_button = driver.find_element_by_css_selector('#signInButton')
connect_button.click()

time.sleep(15)  # wait for sign in (how to do this properly though?)

menu_button = driver.find_element_by_css_selector('#menuButton')
menu_button.click()
time.sleep(1)
logout_button = driver.find_element_by_css_selector('#contentWrapper > paper-material > paper-menu > div > a:nth-child(3)')
logout_button.click()

time.sleep(3)

menu_button = driver.find_element_by_css_selector('#menuButton')
menu_button.click()
time.sleep(1)
quit_button = driver.find_element_by_css_selector('#contentWrapper > paper-material > paper-menu > div > a:nth-child(4)')
quit_button.click()<commit_msg>add todo item<commit_after># https://sites.google.com/a/chromium.org/chromedriver/getting-started

# import time
# from selenium import webdriver
# import selenium.webdriver.chrome.service as service
#
# service = service.Service('./chromedriver')
# service.start()
# capabilities = {
#     'chrome.binary': '/Users/teo/dev/sc-ui/dist/AppGate XDP-darwin-x64/AppGate XDP.app/Contents/MacOS/Electron'}
# driver = webdriver.Remote(service.service_url, capabilities)
# driver.get('http://www.google.com/xhtml')
# time.sleep(1)  # Let the user actually see something!
# driver.quit()

import os
import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

chromedriver_path = "./chromedriver"
electron_path = "/Users/teo/dev/sc-ui/dist/AppGate XDP-darwin-x64/AppGate XDP.app/Contents/MacOS/Electron"

opts = Options()
opts.binary_location = electron_path
driver = webdriver.Chrome(executable_path=chromedriver_path, chrome_options=opts)

time.sleep(3)

username = driver.find_element_by_css_selector('#cards > div.cards.style-scope.task-cards > task-card > sign-in > div > div > paper-input:nth-child(3) > paper-input-container > div.input-content.style-scope.paper-input-container #labelAndInputContainer #input')
username.send_keys('<PASSWORD>')
password = driver.find_element_by_css_selector('#cards > div.cards.style-scope.task-cards > task-card > sign-in > div > div > paper-input:nth-child(4) > paper-input-container > div.input-content.style-scope.paper-input-container #labelAndInputContainer #input')
password.send_keys(os.environ['PASS'])

time.sleep(2)

connect_button = driver.find_element_by_css_selector('#signInButton')
connect_button.click()

# wait for sign in
time.sleep(15)

# todo:
# maybe we should listen for polymer events rather than waits
# if spectron (https://github.com/kevinsawicki/spectron) is doing it, we can make a python port of it

menu_button = driver.find_element_by_css_selector('#menuButton')
menu_button.click()
time.sleep(1)
logout_button = driver.find_element_by_css_selector('#contentWrapper > paper-material > paper-menu > div > a:nth-child(3)')
logout_button.click()

time.sleep(3)

menu_button = driver.find_element_by_css_selector('#menuButton')
menu_button.click()
time.sleep(1)
quit_button = driver.find_element_by_css_selector('#contentWrapper > paper-material > paper-menu > div > a:nth-child(4)')
quit_button.click()
{'fraction_non_alphanumeric': 0.13440514469453377, 'fraction_numerical': 0.006859592711682743, 'mean_word_length': 5.974588938714499, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 52, 'https://': 3, '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': '383699', 'n_tokens_mistral': 1587, 'n_tokens_neox': 1529, 'n_words': 264}