本文整理汇总了Python中OWDTestToolkit.apps.messages.Messages.checkIsInToField方法的典型用法代码示例。如果您正苦于以下问题:Python Messages.checkIsInToField方法的具体用法?Python Messages.checkIsInToField怎么用?Python Messages.checkIsInToField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OWDTestToolkit.apps.messages.Messages
的用法示例。
在下文中一共展示了Messages.checkIsInToField方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import checkIsInToField [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
self.messages = Messages(self)
# Import contact (adjust the correct number).
self.contact = MockContact()
self.UTILS.general.insertContact(self.contact)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.messages.launch()
# Start a new SMS and add the message and contact name.
self.messages.startNewSMS()
self.messages.selectAddContactButton()
self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
self.contacts.view_contact(self.contact["givenName"], False)
self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
self.messages.checkIsInToField(self.contact["name"], True)
# Remove it.
self.messages.removeContactFromToField(self.contact["name"])
# Verify the contact name is no longer present before removing it.
self.messages.checkIsInToField(self.contact["name"], False)
示例2: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import checkIsInToField [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
self.messages = Messages(self)
# Get details of our test contacts.
self.contact = MockContact(tel=[{'type': 'Mobile', 'value': '11111111'},
{'type': 'Mobile', 'value': '222222222'}])
"""
We're not testing adding a contact, so just stick one
into the database.
"""
self.UTILS.general.insertContact(self.contact)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Launch contacts app.
self.contacts.launch()
# Select our contact.
# View the details of our contact.
self.contacts.view_contact(self.contact['name'])
# Tap the 2nd sms button (index=1) in the view details screen to go to the sms page.
smsBTN = self.UTILS.element.getElement(("id", DOM.Contacts.sms_button_specific_id.format(1)),
"2nd send SMS button")
smsBTN.tap()
"""
Switch to the 'Messages' app frame (or marionette will still be watching the
'Contacts' app!).
"""
self.marionette.switch_to_frame()
self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
time.sleep(3)
"""
test: this automatically opens the 'send SMS' screen, so
check the correct name is in the header of this sms.
"""
self.UTILS.element.headerCheck("1 recipient")
# Check this is the right number.
self.messages.checkIsInToField(self.contact["name"])
self.messages.checkNumberIsInToField(self.contact["tel"][1]["value"])
示例3: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import checkIsInToField [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
self.contacts = Contacts(self)
self.gallery = Gallery(self)
self.test_num = self.UTILS.general.get_config_variable("phone_number", "custom")
self.cont = MockContact(tel={"type": "Mobile", "value": self.test_num})
self.UTILS.general.insertContact(self.cont)
self.UTILS.general.add_file_to_device('./tests/_resources/imga.jpg')
self.UTILS.reporting.logComment("Using target telephone number " + self.cont["tel"]["value"])
def tearDown(self):
self.UTILS.general.remove_files()
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.messages.launch()
self.messages.startNewSMS()
self.messages.enterSMSMsg("Test")
self.messages.create_mms_image()
self.gallery.click_on_thumbnail_at_position_mms(0)
# Search for our contact.
time.sleep(5)
self.messages.selectAddContactButton()
self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
self.contacts.search(self.cont["name"])
self.contacts.check_search_results(self.cont["name"])
result = self.UTILS.element.getElements(DOM.Contacts.search_results_list, "Contacts search results")
for contact in result:
if contact.text == self.cont["name"]:
contact.tap()
break
self.apps.switch_to_displayed_app()
# Now check the correct name is in the 'To' list.
self.messages.checkIsInToField(self.cont["name"])
self.messages.sendSMS()
示例4: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import checkIsInToField [as 别名]
class test_main(GaiaTestCase):
test_msg = "Test message."
def setUp(self):
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
self.contacts = Contacts(self)
self.Dialer = Dialer(self)
self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom").split("+34")[-1]
self.contact = MockContact(tel={'type': 'Mobile', 'value': self.phone_number})
self.UTILS.general.insertContact(self.contact)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.messages.launch()
# Create and send a new test message.
self.messages.startNewSMS()
self.messages.selectAddContactButton()
self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
self.contacts.view_contact(self.contact["givenName"], False)
self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
self.messages.checkIsInToField(self.contact["name"], True)
self.messages.enterSMSMsg("Test message.")
self.messages.sendSMS()
send_time = self.messages.last_sent_message_timestamp()
self.messages.wait_for_message(send_time=send_time)
# Tap the header to call.
self.messages.header_call()
# Dialer is started with the number already filled in.
time.sleep(2)
phone_field = self.UTILS.element.getElement(DOM.Dialer.phone_number, "Phone number field", False)
dialer_num = phone_field.get_attribute("value")
self.UTILS.test.test(self.phone_number == dialer_num,
"The phone is '{}' (expected '{}').".\
format(dialer_num, self.phone_number))
示例5: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import checkIsInToField [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
self.contacts = Contacts(self)
self.Dialer = Dialer(self)
phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
prefix = "0034"
self.num1 = prefix + phone_number if not phone_number.startswith("+34") else prefix + phone_number[3:]
self.num2 = phone_number[3:] if phone_number.startswith("+34") else phone_number
self.contact = MockContact(tel={'type': 'Mobile', 'value': self.num1})
self.UTILS.general.insertContact(self.contact)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.messages.launch()
# Create and send a new test message to this contact.
self.messages.startNewSMS()
self.messages.selectAddContactButton()
self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
self.contacts.view_contact(self.contact["givenName"], False)
self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
self.messages.checkIsInToField(self.contact["name"], True)
self.messages.enterSMSMsg("Test message.")
self.messages.sendSMS()
self.messages.wait_for_message()
# Tap the header to call.
self.messages.header_call()
# Dialler is started with the number already filled in.
phone_field = self.UTILS.element.getElement(DOM.Dialer.phone_number, "Phone number")
self.UTILS.test.test(self.num2 in phone_field.get_attribute("value"),
"The phone number contains '{}' (it was '{}').".format(self.num1, phone_field.get_attribute("value")))
示例6: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import checkIsInToField [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
self.contacts = Contacts(self)
# Prepare the contact we're going to insert.
self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
self.contact = MockContact(tel={'type': '', 'value': self.phone_number})
self.UTILS.general.insertContact(self.contact)
self.UTILS.reporting.logComment("Using target telephone number " + self.contact["tel"]["value"])
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Launch messages app.
self.messages.launch()
# Type a message containing the required string
self.messages.startNewSMS()
self.messages.enterSMSMsg("Test message")
# Search for our contact.
self.messages.selectAddContactButton()
self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
self.contacts.search(self.contact["name"])
self.contacts.check_search_results(self.contact["name"])
contact_list = self.UTILS.element.getElements(DOM.Contacts.search_results_list, "Contacts search results")
for c in contact_list:
if c.text == self.contact["name"]:
c.tap()
break
# Switch back to the sms iframe.
self.apps.switch_to_displayed_app()
# Now check the correct name is in the 'To' list.
self.messages.checkIsInToField(self.contact["name"])
self.messages.sendSMS()
示例7: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import checkIsInToField [as 别名]
class test_main(GaiaTestCase):
test_msg = "Test text - please ignore."
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
self.messages = Messages(self)
# Prepare the contact we're going to insert.
self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
self.contact = MockContact(tel={'type': 'Mobile', 'value': self.phone_number})
self.UTILS.general.insertContact(self.contact)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Launch contacts app.
self.contacts.launch()
# View the details of our contact.
self.contacts.view_contact(self.contact['name'])
# Tap the sms button in the view details screen to go to the sms page.
smsBTN = self.UTILS.element.getElement(DOM.Contacts.sms_button, "Send SMS button")
smsBTN.tap()
"""
Switch to the 'Messages' app frame (or marionette will still be watching the
'Contacts' app!).
"""
time.sleep(5)
self.marionette.switch_to_frame()
self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
self.UTILS.element.headerCheck("1 recipient")
self.messages.checkIsInToField(self.contact['name'])
示例8: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import checkIsInToField [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
self.messages = Messages(self)
# Prepare the contact we're going to insert.
self.contact = MockContact()
self.UTILS.general.insertContact(self.contact)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Launch contacts app.
self.contacts.launch()
# View the details of our contact.
self.contacts.view_contact(self.contact['name'])
# Tap the sms button in the view details screen to go to the sms page.
smsBTN = self.UTILS.element.getElement(DOM.Contacts.sms_button, "Send SMS button")
smsBTN.tap()
"""
Switch to the 'Messages' app frame (or marionette will still be watching the
'Contacts' app!).
"""
time.sleep(2)
self.marionette.switch_to_frame()
self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
"""
test: this automatically opens the 'send SMS' screen, so
check the correct name is in the 'to' field of this sms.
"""
self.messages.checkIsInToField(self.contact['name'])
示例9: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import checkIsInToField [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
# Prepare the contact we're going to insert.
self.contacts = []
for i in range(3):
given_name = "Name {}".format(i)
family_name = "Surname {}".format(i)
contact = MockContact(givenName=given_name, familyName=family_name,
name="{} {}".format(given_name, family_name))
self.contacts.append(contact)
self.UTILS.general.insertContact(contact)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.messages.launch()
self.messages.startNewSMS()
for c in self.contacts:
self.messages.addContactToField(c["name"])
# Remove it.
self.messages.removeContactFromToField(self.contacts[1]["name"])
# Verify the contact name is not present after removal
self.messages.checkIsInToField(self.contacts[1]["name"], False)
self.UTILS.reporting.logResult("info", "It is not the 'To' list.")
示例10: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import checkIsInToField [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
self.contacts = Contacts(self)
self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
self.contact = MockContact(tel={'type': '', 'value': ''})
self.UTILS.general.insertContact(self.contact)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.messages.launch()
# Type a message containing the required string
self.messages.startNewSMS()
self.messages.enterSMSMsg("Test message")
# Search for our contact.
self.messages.selectAddContactButton()
self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
# Search the contacts list for our contact.
contact_list = self.UTILS.element.getElements(DOM.Contacts.view_all_contact_list, "Contacts list")
for c in contact_list:
if c.text == self.contact["name"]:
self.UTILS.reporting.logResult("info", "Tapping ...")
c.tap()
break
time.sleep(2)
self.apps.switch_to_displayed_app()
self.messages.checkIsInToField("", True)
示例11: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import checkIsInToField [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
self.contacts = Contacts(self)
# Import some contacts.
# Set the one we'll match to have a valid phone number.
self.contact_1 = MockContact(tel={"type": "Mobile",
"value": self.UTILS.general.get_config_variable("phone_number", "custom")})
self.contact_2 = MockContact()
self.contact_3 = MockContact(givenName="AAAAAAAAAAAAAAAALEX",
familyName="SMITHXXXXXXXX",
name="AAAAAAAAAAAAAAAALEX SMITHXXXXXXXX")
self.contact_4 = MockContact(tel=[{"type": "Mobile 1", "carrier": "MoviStar1", "value": "444444444"},
{"type": "Mobile 2", "carrier": "MoviStar2", "value": "555555555"},
{"type": "Mobile 3", "carrier": "MoviStar3", "value": "666666666"}])
self.contact_5 = MockContact(email=[{"type": "", "value": "[email protected]"},
{"type": "", "value": "[email protected]"},
{"type": "", "value": "[email protected]"}])
# Set a couple of them to be favorites (including the one we'll use).
self.contact_1["category"] = "favorite"
self.contact_2["category"] = "favorite"
# Insert all the contacts.
self.UTILS.general.insertContact(self.contact_1)
self.UTILS.general.insertContact(self.contact_2)
self.UTILS.general.insertContact(self.contact_3)
self.UTILS.general.insertContact(self.contact_4)
self.UTILS.general.insertContact(self.contact_5)
self.UTILS.reporting.logComment("Using target telephone number " + self.contact_1["tel"]["value"])
self.test_msg = "Test message at {}".format(time.time())
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Launch messages app.
self.messages.launch()
# Type a message containing the required string
self.messages.startNewSMS()
self.messages.enterSMSMsg(self.test_msg)
# Search for our contact in the favourites section.
self.messages.selectAddContactButton()
self.UTILS.reporting.debug("*** Looking for contact named {}".format(self.contact_1['givenName']))
self.UTILS.iframe.switch_to_frame(*DOM.Contacts.frame_locator)
cont = self.UTILS.element.getElement((DOM.Contacts.favourite_by_name[0],
DOM.Contacts.favourite_by_name[1].format(self.contact_1['givenName'])),
"Favourite contact", timeout=20)
cont.tap()
self.UTILS.iframe.switch_to_frame(*DOM.Messages.frame_locator)
# Now check the correct name is in the 'To' list.
self.messages.checkIsInToField(self.contact_1["name"])
self.messages.sendSMS()
send_time = self.messages.last_sent_message_timestamp()
self.messages.wait_for_message(send_time=send_time)
self.messages.check_last_message_contents(self.test_msg)