• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2014 The Chromium OS 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
5"""The extensions e2e test utils page."""
6
7from extension_pages import ExtensionPages
8
9
10class E2ETestUtilsPage(ExtensionPages):
11    """Contains all the functions of the options page of the extension."""
12
13    def __init__(self, driver, extension_id):
14        """Constructor."""
15        self._test_utils_url = ('chrome-extension://%s/e2e_test_utils.html' %
16                                extension_id)
17        ExtensionPages.__init__(self, driver, self._test_utils_url)
18
19
20    def stop_activity_id_text_box(self):
21        """The text box for entering the stop activity ID."""
22        return self._get_text_box('activityIdToStop', 'stop_activity_id')
23
24
25    def receiver_ip_or_name_text_box(self):
26        """The text box for entering the receiver IP address/name."""
27        return self._get_text_box('receiverIpAddress', 'receiver_ip_name')
28
29
30    def url_to_open_text_box(self):
31      """The text box for entering the URL to mirror."""
32      return self._get_text_box('urlToOpen', 'url_to_open')
33
34
35    def receiver_ip_or_name_v2_text_box(self):
36        """The text box for entering the receiver IP address/name."""
37        return self._get_text_box('receiverIpAddressV2', 'receiver_ip_name_v2')
38
39
40    def url_to_open_v2_text_box(self):
41        """The text box for entering the URL to mirror."""
42        return self._get_text_box('urlToOpenV2', 'url_to_open_v2')
43
44
45    def udp_proxy_server_text_box(self):
46        """The text box for entering the udp proxy server address."""
47        return self._get_text_box('udpProxyServer', 'udp_proxy_server')
48
49
50    def network_profile_text_box(self):
51        """The text box for entering the network profile."""
52        return self._get_text_box('networkProfile', 'network_profile')
53
54
55    def get_webrtc_stats_button(self):
56        """The get webrtc stats button."""
57        return self._get_button('getWebRtcStats', 'get_webrtc_stats')
58
59
60    def get_mirror_id_button(self):
61        """The get mirror id button."""
62        return self._get_button('getMirrorId', 'get_mirror_id')
63
64
65    def stop_all_activities_button(self):
66      """The stop all activities button."""
67      return self._get_button('stopAllActivities', 'stop_all_activities')
68
69
70    def stop_activity_button(self):
71        """The stop activity button."""
72        return self._get_button('stopActivityById', 'stop_activity')
73
74
75    def open_then_mirror_button(self):
76        """The open then mirror button for v1 mirroring."""
77        return self._get_button('mirrorUrl', 'open_then_mirror')
78
79
80    def open_then_mirror_v2_button(self):
81        """The open then mirror button for v2 mirroring."""
82        return self._get_button('mirrorUrlV2', 'open_then_mirror_v2')
83
84
85    def start_desktop_mirror_button(self):
86        """The start desktop mirror button."""
87        return self._get_button('mirrorDesktop','start_desktop_mirror')
88
89
90    def webrtc_stats_scroll_box(self):
91        """The scroll box that shows all the webrtc stats log."""
92        return self._get_scroll_box('webrtc_stats', 'webrtc_stats')
93
94
95    def mirror_id_web_element_box(self):
96        """The box that shows the activity ID if there is any."""
97        return self._get_web_element_box('mirrorId', 'mirror_id')
98
99
100    def stop_v2_mirroring_button(self):
101        """The button to stop v2 mirroring."""
102        return self._get_button('stopV2Mirroring', 'stop_v2_mirroring')
103
104
105    def get_v2_stats_button(self):
106        """The button to get v2 mirroring stats."""
107        return self._get_button(
108                'getV2MirroringStats', 'get_v2_mirroring_stats')
109
110
111    def upload_v2_mirroring_logs_button(self):
112        """The button to upload v2 mirroring logs."""
113        return self._get_button(
114                'uploadV2MirroringLogs', 'upload_v2_mirroring_logs')
115
116
117    def v2_mirroring_stats_scroll_box(self):
118        """The scroll box that shows the v2 mirroring stats."""
119        return self._get_scroll_box(
120                'v2_mirroring_stats', 'v2_mirroring_stats')
121
122
123    def v2_mirroring_logs_scroll_box(self):
124        """The scroll box that shows v2 mirroring logs data url."""
125        return self._get_scroll_box(
126                'v2_mirroring_logs_report_id', 'v2_mirroring_logs_report_id')
127