-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_display_name.py
47 lines (38 loc) · 1.84 KB
/
test_display_name.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import random
from selenium.webdriver import ActionChains
from pester import fixture
import utils
def check_display_name_locally(name):
second_participant = fixture.get_second_participant()
display_name_elem = second_participant.find_element_by_xpath(
"//span[@id='localVideoContainer']/span[@id='localDisplayName']")
local_video_container_elem = second_participant.find_element_by_xpath(
"//span[@id='localVideoContainer']")
ActionChains(second_participant).move_to_element(
local_video_container_elem).perform()
assert display_name_elem.is_displayed(),\
'The display name must be displayed.'
assert name in display_name_elem.text,\
'The display name text must contain ' + name + '.'
def check_display_name_on_remote_side(name):
owner = fixture.get_owner()
second_participant_resource_jid = utils.get_local_resource_jid(
fixture.get_second_participant())
remote_video_span = owner.find_element_by_xpath(
"//span[@id='participant_" + second_participant_resource_jid + "']")
remote_video_span.click()
ActionChains(owner).move_to_element(remote_video_span).perform()
display_name_elem = owner.find_element_by_xpath(
"//span[@id='participant_" + second_participant_resource_jid +
"']/span[@id='participant_" + second_participant_resource_jid +
"_name']")
assert display_name_elem.is_displayed(),\
'The remote display name must be displayed.'
assert name in display_name_elem.text,\
'The remote display name text must contain ' + name + '.'
def test_display_name():
name = 'Name' + str(random.random())[2:]
print('test_display_name: changing display name to ' + name)
utils.change_display_name(fixture.get_second_participant(), name)
check_display_name_locally(name)
check_display_name_on_remote_side(name)