<commit_before>import time
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from nw_util import *

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("nwapp=" + os.path.dirname(os.path.abspath(__file__)))

driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options)
driver.implicitly_wait(5)
time.sleep(1)
try:
    print driver.current_url
    wait_window_handles(driver, 2)
    result = driver.find_element_by_id('inject_start').get_attribute('innerHTML')
    print 'inject_js_start: %s' % result
    assert('success' in result)
    result = driver.find_element_by_id('inject_end').get_attribute('innerHTML')
    print 'inject_js_end: %s' % result
    assert('success' in result)
finally:
    driver.quit()
<commit_msg>[test] fix race condition in issue4286-inject-start-end<commit_after>import time
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from nw_util import *

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("nwapp=" + os.path.dirname(os.path.abspath(__file__)))

driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options)
driver.implicitly_wait(5)
time.sleep(1)
try:
    print driver.current_url
    wait_window_handles(driver, 2)
    result = wait_for_element_id(driver, 'inject_start')
    print 'inject_js_start: %s' % result
    assert('success' in result)
    result = wait_for_element_id(driver, 'inject_end')
    print 'inject_js_end: %s' % result
    assert('success' in result)
finally:
    driver.quit()

{'fraction_non_alphanumeric': 0.11787709497206704, 'fraction_numerical': 0.00558659217877095, 'mean_word_length': 6.023529411764706, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6337284', 'n_tokens_mistral': 608, 'n_tokens_neox': 590, 'n_words': 111}