6
test_value = "x".join(str(random.randint(0, 50)) for x in range(5))
7
app = subprocess.Popen(["chromium-browser", "--window-size=1000,2200", "--window-position=50,100", "--user-data-dir=profile_storage", "--new-window"])
11
refresh_button = wait("cr-refresh-button.png", 30)
12
click(refresh_button.right(50))
13
just_below_refresh_button = refresh_button.below(30)
14
just_below_refresh_button.type("l", KeyModifier.CTRL)
15
refresh_button.right(50).type(test_value + Key.ENTER)
17
# first assertion: default search is Google
18
wait("google-text.png", 10)
19
#wait("query-start.png", 10)
21
# second assertion: search url contains our token
22
just_below_refresh_button.type("l", KeyModifier.CTRL)
23
just_below_refresh_button.type("c", KeyModifier.CTRL)
24
location_bar_contents = Env.getClipboard()
26
assert test_value in location_bar_contents, "Hrm, logic is wrong. " + location_bar_contents
27
assert re.search(r"google", location_bar_contents), location_bar_contents
28
assert re.search(r"\bclient=ubuntu\b", location_bar_contents), location_bar_contents
32
#os.kill(app.pid, signal.SIGTERM)
36
# Jython python2.5 hackey. So so sorry.
37
#app._process.destroy()