<commit_before>import unittest
from Naked.toolshed.shell import execute_js, execute, muterun
from multiprocessing import Process
from test_util import *
import re

def start_selenium():
    yield execute("./node_modules/protractor/bin/webdriver-manager start")

class JsTests(unittest.TestCase):
    def setUp(self):
        execute("npm install")
        execute("./node_modules/protractor/bin/webdriver-manager update")
        self.p = Process(target=start_server)
        self.p.start()

    def tearDown(self):
        self.p.terminate()

    def test_run_unit_tests(self):
        result = execute("./node_modules/karma/bin/karma start")
        self.assertTrue(result)

    def test_run_e2e_tests(self):
        selenium = Process(target=start_selenium)
        selenium.start()
        result = execute("./node_modules/protractor/bin/protractor e2e.conf.js")
        selenium.terminate()<commit_msg>Wait for webdriver to start<commit_after>import unittest
from Naked.toolshed.shell import execute_js, execute, muterun
from multiprocessing import Process
from test_util import *
import time

def start_selenium():
    muterun("./node_modules/protractor/bin/webdriver-manager start")

class JsTests(unittest.TestCase):
    def setUp(self):
        execute("npm install")
        execute("./node_modules/protractor/bin/webdriver-manager update")
        self.p = Process(target=start_server)
        self.p.start()

    def tearDown(self):
        self.p.terminate()

    def test_run_unit_tests(self):
        result = execute("./node_modules/karma/bin/karma start")
        self.assertTrue(result)

    def test_run_e2e_tests(self):
        selenium = Process(target=start_selenium)
        selenium.start()
        time.sleep(5)
        result = execute("./node_modules/protractor/bin/protractor e2e.conf.js")
        selenium.terminate()
{'fraction_non_alphanumeric': 0.10888407367280607, 'fraction_numerical': 0.0027085590465872156, 'mean_word_length': 3.3976190476190475, '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': '2095225', 'n_tokens_mistral': 589, 'n_tokens_neox': 564, 'n_words': 105}