import unittest
from common.common1 import common2
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
class Test13(unittest.TestCase):
def setUp(self) -> None:
self.driver=common2().login()
def test13(self):
self._testMethodName="test13"
self._testMethodDoc="新建应用(跳转url)!"
#显示等待+点击首页上的新建应用
WebDriverWait(self.driver, 10, 1).until(EC.visibility_of_element_located((By.XPATH,"//span[text()='新建应用']"))).click()
#显式等待+断言
actual_result =WebDriverWait(self.driver, 10, 1).until(EC.visibility_of_element_located((By.XPATH,"//h2[text()='新建应用']")))
self.assertEqual(actual_result.text,'新建应用')
if __name__=='main__':
unittest.main()