Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: tools/telemetry/telemetry/click_element_action_unittest.py

Issue 12278015: [Telemetry] Reorganize everything. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-add shebangs. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4 import os
5
6 from telemetry import click_element_action
7 from telemetry import tab_test_case
8
9 class ClickElementActionTest(tab_test_case.TabTestCase):
10 def testClickWithSelectorWaitForNavigation(self):
11 unittest_data_dir = os.path.join(os.path.dirname(__file__),
12 '..', 'unittest_data')
13 self._browser.SetHTTPServerDirectory(unittest_data_dir)
14 self._tab.Navigate(
15 self._browser.http_server.UrlOf('page_with_link.html'))
16 self._tab.WaitForDocumentReadyStateToBeComplete()
17 self.assertEquals(
18 self._tab.EvaluateJavaScript('document.location.pathname;'),
19 '/page_with_link.html')
20
21 data = {'selector': 'a[id="clickme"]', 'wait_for_navigation': True}
22 i = click_element_action.ClickElementAction(data)
23 i.RunAction(None, self._tab, None)
24
25 self.assertEquals(
26 self._tab.EvaluateJavaScript('document.location.pathname;'),
27 '/blank.html')
28
29 def testClickWithTextWaitForRefChange(self):
30 unittest_data_dir = os.path.join(os.path.dirname(__file__),
31 '..', 'unittest_data')
32 self._browser.SetHTTPServerDirectory(unittest_data_dir)
33 self._tab.Navigate(
34 self._browser.http_server.UrlOf('page_with_link.html'))
35 self._tab.WaitForDocumentReadyStateToBeComplete()
36 self.assertEquals(
37 self._tab.EvaluateJavaScript('document.location.pathname;'),
38 '/page_with_link.html')
39
40 data = {'text': 'Click me', 'wait_for_href_change': True}
41 i = click_element_action.ClickElementAction(data)
42 i.RunAction(None, self._tab, None)
43
44 self.assertEquals(
45 self._tab.EvaluateJavaScript('document.location.pathname;'),
46 '/blank.html')
OLDNEW
« no previous file with comments | « tools/telemetry/telemetry/click_element_action.py ('k') | tools/telemetry/telemetry/compound_action.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698