Add create log file in Misc.py
This commit is contained in:
parent
ded2c97d55
commit
3ab3ca0bdf
|
@ -15,6 +15,7 @@ from selenium.common.exceptions import StaleElementReferenceException, NoSuchEle
|
|||
from selenium.common.exceptions import NoAlertPresentException
|
||||
from selenium.webdriver.remote.webelement import WebElement
|
||||
import unittest2, time, re
|
||||
import logging
|
||||
|
||||
class Miscellaneous (PandoraWebDriverTestCase):
|
||||
|
||||
|
@ -27,6 +28,8 @@ class Miscellaneous (PandoraWebDriverTestCase):
|
|||
Creates an agent and a module with japanese characters and test if the event list show the characters properly
|
||||
"""
|
||||
|
||||
logging.basicConfig(filename="Misc.log", level=logging.INFO, filemode='w')
|
||||
|
||||
driver = self.driver
|
||||
self.login()
|
||||
detect_and_pass_all_wizards(driver)
|
||||
|
@ -58,9 +61,13 @@ class Miscellaneous (PandoraWebDriverTestCase):
|
|||
search_events(driver,agent_name=u"次のライセンスに基づいていま",module_name=u"管理者ガイド")
|
||||
|
||||
#Check that there are japanese characters present on the event
|
||||
|
||||
element=driver.find_element_by_xpath(u'//a[contains(.,"Alert fired (Critical condition) assigned to (管理者ガイド)")]')
|
||||
|
||||
self.assertIsInstance(element,WebElement)
|
||||
|
||||
logging.info("test_japanese_characters is correct")
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest2.main()
|
||||
|
||||
|
|
Loading…
Reference in New Issue