def test_product_management_case98(self):
     """持仓归因-期货资产"""
     product = ProductManagement(self.driver)
     product.execute_script_up()  # 浏览器往上
     time.sleep(2)
     product.product_management_attribution_futures()
     # 归因分析
     # 断言,总体期货绩效归因
     error_mes = product.find_element('xpath=>//*[@id="futuresOverallAttributionTab"]/tbody/tr[1]/td[3]').text
     try:
         assert error_mes != u'--'
         print('总体期货绩效归因 pass')
     except Exception as e:
         print('总体期货绩效归因 fail', format(e))
         print(error_mes)
     time.sleep(2)
     # 品种归因分析
     # 断言,十大盈利
     error_mes = product.find_element('xpath=>//*[@id="futuresInterestContractTab"]/tbody/tr[1]/td[4]').text
     try:
         assert error_mes != u'--'
         print('十大盈利 pass')
     except Exception as e:
         print('十大盈利 fail', format(e))
         print(error_mes)
     time.sleep(2)
     # 断言,十大亏损
     error_mes = product.find_element('xpath=>//*[@id="futuresLossContractTab"]/tbody/tr[1]/td[4]').text
     try:
         assert error_mes != u'--'
         print('十大亏损 pass')
     except Exception as e:
         print('十大亏损 fail', format(e))
         print(error_mes)
     time.sleep(2)
 def test_product_management_case8(self):
     """基本信息"""
     product = ProductManagement(self.driver)
     product.execute_script_up()  # 控制浏览器往上
     time.sleep(2)
     product.product_management_info()
     # 断言,基金简称
     error_mes = product.find_element(
         'xpath=>//*[@id="fundName"]').text
     try:
         assert error_mes == u'示例FOF母基金'
         print('基金简称 pass')
     except Exception as e:
         print('基金简称 fail', format(e))
         print(error_mes)
     time.sleep(2)
 def test_product_management_case96(self):
     """持仓归因-资产账户"""
     product = ProductManagement(self.driver)
     product.execute_script_up()  # 控制浏览器往上
     time.sleep(2)
     product.product_management_attribution_account()
     product.find_element('xpath=>//*[@id="assetAccount"]/table/tbody/tr[3]/td[2]/button[3]').click()  # 点击中债指数
     time.sleep(3)
     product.find_element('xpath=>//*[@id="assetAccount"]/table/tbody/tr[5]/td/button[1]').click()  # 点击确定
     time.sleep(20)
     # 断言,中债指数
     error_mes = product.find_element('xpath=>//*[@id="tab-main-grid"]/thead/tr[1]/th[3]/div[1]').text
     try:
         assert error_mes == u'中债指数'
         print('中债指数 pass')
     except Exception as e:
         print('中债指数 fail', format(e))
         print(error_mes)
     time.sleep(2)
     # 断言,单期归因
     error_mes = product.find_element('xpath=>//*[@id="assetAccount"]/div[4]/div[2]/span').text
     try:
         assert error_mes == u'单期归因'
         print('单期归因 pass')
     except Exception as e:
         print('单期归因 fail', format(e))
         print(error_mes)
     time.sleep(2)
     # 断言,归因分析
     error_mes = product.find_element('xpath=>//*[@id="assetAccount"]/div[7]/div[2]/span').text
     try:
         assert error_mes == u'归因分析'
         print('归因分析 pass')
     except Exception as e:
         print('归因分析 fail', format(e))
         print(error_mes)
     time.sleep(2)
     # 断言,仓位控制图
     error_mes = product.find_element('xpath=>//*[@id="assetAccount"]/div[9]/div[2]/span').text
     try:
         assert error_mes == u'仓位控制图'
         print('仓位控制图 pass')
     except Exception as e:
         print('仓位控制图 fail', format(e))
         print(error_mes)
     time.sleep(2)
 def test_product_management_case99(self):
     """情景分析"""
     product = ProductManagement(self.driver)
     product.execute_script_up()  # 浏览器往上
     time.sleep(2)
     product.product_management_scene()
     '''压力测试'''
     product.find_element('xpath=>//*[@id="incomeUl"]/li[3]').click()  # 点击管理期货市场
     time.sleep(5)
     # 断言,基金涨跌幅
     error_mes = product.find_element(
         'xpath=>//*[@id="stressTestTab"]/tbody/tr/td[3]').text
     try:
         assert error_mes == u'--'
         print('基金涨跌幅 pass')
     except Exception as e:
         print('基金涨跌幅 fail', format(e))
         print(error_mes)
     time.sleep(2)
     # 断言,沪深300涨跌幅
     error_mes = product.find_element(
         'xpath=>//*[@id="stressTestTab"]/tbody/tr/td[4]').text
     try:
         assert error_mes == u'--'
         print('沪深300涨跌幅 pass')
     except Exception as e:
         print('沪深300涨跌幅 fail', format(e))
         print(error_mes)
     time.sleep(2)
     '''市道分析'''
     # 市道分析
     product.execute_script_down()  # 浏览器往下
     time.sleep(3)
     # 断言,市道分析
     error_mes = product.find_element(
         'xpath=>//*[@id="market-main-table"]/tbody/tr[1]/td[5]').text
     try:
         assert error_mes != u'--(0周)'
         print('市道分析 pass')
     except Exception as e:
         print('市道分析 fail', format(e))
         print(error_mes)
     time.sleep(5)
 def test_product_management_case97(self):
     """持仓归因-股票资产"""
     product = ProductManagement(self.driver)
     product.execute_script_up()  # 浏览器往上
     time.sleep(2)
     product.product_management_attribution_shares()
     product.find_element('xpath=>//*[@id="stockAccount"]/table/tbody/tr[1]/td[2]/button[2]').click()  # 归因方式点击多期
     time.sleep(3)
     product.find_element('xpath=>//*[@id="stockAccount"]/table/tbody/tr[4]/td/button[1]').click()  # 点击确定
     time.sleep(10)
     # 断言,股票资产单期归因
     error_mes = product.find_element('xpath=>//*[@id="stockAccount"]/div[4]/div[2]/span').text
     try:
         assert error_mes == u'多期归因'
         print('股票资产单期归因 pass')
     except Exception as e:
         print('股票资产单期归因 fail', format(e))
         print(error_mes)
     time.sleep(2)
     # 断言,股票资产归因分析
     error_mes = product.find_element('xpath=>//*[@id="stockAccount"]/div[7]/div[2]/span').text
     try:
         assert error_mes == u'归因分析'
         print('股票资产归因分析 pass')
     except Exception as e:
         print('股票资产归因分析 fail', format(e))
         print(error_mes)
     time.sleep(2)
     # 断言,股票资产仓位控制图
     error_mes = product.find_element('xpath=>//*[@id="stockAccount"]/div[9]/div[2]/span').text
     try:
         assert error_mes == u'仓位控制图'
         print('股票资产仓位控制图 pass.')
     except Exception as e:
         print('股票资产仓位控制图 fail', format(e))
         print(error_mes)
     time.sleep(2)
 def test_product_management_case95(self):
     """净值归因"""
     product = ProductManagement(self.driver)
     product.execute_script_up()  # 浏览器往上
     time.sleep(2)
     product.product_management_attribution()
     # 断言,大类资产占比情况
     error_mes1 = product.find_element('xpath=>//*[@id="comment1"]').text
     error_mes = error_mes1.split(',')[0]
     try:
         assert error_mes == u'从仓位模拟结果来看'
         print('大类资产占比情况 pass')
     except Exception as e:
         print('大类资产占比情况 fail', format(e))
         print(error_mes)
     time.sleep(2)
     # 断言,风格因子占比情况
     error_mes1 = product.find_element('xpath=>//*[@id="comment2"]').text
     error_mes = error_mes1.split(',')[0]
     try:
         assert error_mes == u'在风格配置方面'
         print('风格因子占比情况 pass')
     except Exception as e:
         print('风格因子占比情况 fail', format(e))
         print(error_mes)
     time.sleep(2)
     # 断言,拟合优度
     error_mes1 = product.find_element('xpath=>//*[@id="halfComment"]').text
     error_mes = error_mes1.split(',')[0]
     try:
         assert error_mes != u'回归结果显示'
         print('拟合优度 pass')
     except Exception as e:
         print('拟合优度 fail', format(e))
         print(error_mes)
     time.sleep(2)
 def test_product_management_case9(self):
     """持仓分析"""
     product = ProductManagement(self.driver)
     product.execute_script_up()  # 控制浏览器往上
     time.sleep(2)
     product.product_management_position()
     '''母基金配置'''
     # 断言,期初净资产
     error_mes = product.find_element('xpath=>//*[@id="parentfTbl"]/tbody/tr[1]/td[3]').text
     try:
         assert error_mes != u'--'
         print('期初净资产 pass')
     except Exception as e:
         print('期初净资产 fail', format(e))
         print(error_mes)
     time.sleep(2)
     product.find_element('xpath=>//*[@id="parentFund"]/div[4]/div[1]/div/button[2]').click()  # 点击VaR贡献占比
     time.sleep(3)
     product.find_element('xpath=>//*[@id="parentFund"]/div[4]/div[1]/div/button[3]').click()  # 点击波动率贡献占比
     time.sleep(3)
     # 断言,收益贡献占比
     error_mes = product.find_element('xpath=>//*[@id="parentFund"]/div[3]/div[1]/div/span').text
     try:
         assert error_mes == u'收益贡献占比'
         print('收益贡献占比 pass')
     except Exception as e:
         print('收益贡献占比 fail', format(e))
         print(error_mes)
     time.sleep(2)
     # 断言,子基金组合时序图
     error_mes = product.find_element('xpath=>//*[@id="parentFund"]/div[5]/div[1]/div[1]/span').text
     try:
         assert error_mes == u'子基金组合时序图'
         print('子基金组合时序图 pass')
     except Exception as e:
         print('子基金组合时序图 fail', format(e))
         print(error_mes)
     time.sleep(2)
     '''策略配置'''
     # 断言,期末净资产
     error_mes = product.find_element('xpath=>//*[@id="policyTbl"]/tbody/tr[1]/td[4]').text
     try:
         assert error_mes != u'--'
         print('期末净资产 pass')
     except Exception as e:
         print('期末净资产 fail', format(e))
         print(error_mes)
     time.sleep(2)
     product.find_element('xpath=>//*[@id="policyChart"]/div[2]/div[1]/div/button[2]').click()  # 点击VaR贡献占比
     time.sleep(3)
     product.find_element('xpath=>//*[@id="policyChart"]/div[2]/div[1]/div/button[3]').click()  # 点击波动率贡献占比
     time.sleep(3)
     # 断言,收益贡献占比2
     error_mes = product.find_element('xpath=>//*[@id="policyChart"]/div[1]/div[1]/div/span').text
     try:
         assert error_mes == u'收益贡献占比'
         print('收益贡献占比2 pass')
     except Exception as e:
         print('收益贡献占比2 fail', format(e))
         print(error_mes)
     time.sleep(2)
     # 断言,子策略组合时序图
     error_mes = product.find_element('xpath=>//*[@id="policyChart"]/div[3]/div[1]/div[1]/span').text
     try:
         assert error_mes == u'子策略组合时序图'
         print('子策略组合时序图 pass')
     except Exception as e:
         print('子策略组合时序图 fail', format(e))
         print(error_mes)
     time.sleep(2)
     '''策略相关性'''
     # 断言,基金与指数滚动相关系数
     error_mes = product.find_element('xpath=>//*[@id="headtMapdiv"]/div[1]/span').text
     try:
         assert error_mes == u'基金与指数滚动相关系数'
         print('基金与指数滚动相关系数 pass')
     except Exception as e:
         print('基金与指数滚动相关系数 fail', format(e))
         print(error_mes)
     time.sleep(2)
     # 市场指数
     product.find_element('xpath=>//*[@id="HS300"]').click()  # 点击沪深300
     time.sleep(3)
     product.find_element('xpath=>//*[@id="nanhuaShop"]').click()  # 点击南华商品
     time.sleep(3)
     # 策略指数
     product.find_element('xpath=>//*[@id="allMark"]').click()  # 点击私募全市场
     time.sleep(3)
     product.find_element('xpath=>//*[@id="portfolioInvestment"]').click()  # 点击组合策略指数
     time.sleep(3)
     # 子基金相关系数
     # 断言,子基金相关系数
     error_mes = product.find_element('xpath=>//*[@id="policyDependencies"]/div[3]/div[1]/span').text
     try:
         assert error_mes == u'子基金相关系数'
         print('子基金相关系数 pass')
     except Exception as e:
         print('子基金相关系数 fail', format(e))
         print(error_mes)
     time.sleep(2)
     # 统计区间
     product.find_element('xpath=>//*[@id="m6"]').click()  # 点击6M
     time.sleep(3)