"""
lemut_select - 业务受理
Author: duxiaowei
Date: 2024/7/17
"""
import timeimport allure
import pytest
from selenium. webdriver. common. by import By
@allure. feature ( "业务受理" )
class Test_ 业务受理: @pytest. fixture ( scope= "function" , autouse= True ) def setup ( self, web_start) : self. driver = web_starttime. sleep( 1 ) self. driver. find_element( By. XPATH, '//div/span[text()="业务受理"]' ) . click( ) time. sleep( 2 ) yield time. sleep( 1 ) self. driver. find_element( By. XPATH, '//div/span[text()="业务受理"]' ) . click( ) @allure. title ( "客满维护" ) @pytest. mark. parametrize ( 'HIC信息单号,开始天,结束天' , [ ( "YT02407120021805" , "2024-07-11" , "2024-07-12" ) ] ) def test_客满维护( self, HIC信息单号, 开始天, 结束天) : self. driver. find_element( By. XPATH, '//ul/li[text()="客满维护"]' ) . click( ) time. sleep( 2 ) try : self. driver. find_element( By. XPATH, '//label[text()="HIC信息单号:"]/following-sibling::div/div/input' ) . send_keys( HIC信息单号) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//label[text()="挂机时间:"]/following-sibling::div/div/input' ) . click( ) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div/div/div/span/span/div/input[@class="el-input__inner"]' ) . clear( ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div/div/div/span/span/div/input[@class="el-input__inner"]' ) . send_keys( 开始天) time. sleep( 1 ) self. driver. find_elements( By. XPATH, '//div[not(contains(@style,"display"))]/div/div/div/span/span/div/input[@class="el-input__inner"]' ) [ 2 ] . clear( ) self. driver. find_elements( By. XPATH, '//div[not(contains(@style,"display"))]/div/div/div/span/span/div/input[@class="el-input__inner"]' ) [ 2 ] . send_keys( 结束天) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div[@class="el-picker-panel__footer"]/button[2]/span' ) . click( ) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//span[text()="查询"]' ) . click( ) time. sleep( 2 ) text = self. driver. find_element( By. XPATH, '//div[@class!="el-table__fixed"]/div/table/tbody/tr/td[3]/div/span[text()="' + HIC信息单号 + '"]' ) . textprint ( text) self. driver. find_element( By. XPATH, '//div[@id="clientSatList"]/div/form/div[2]/div/div[2]/button/span' ) . click( ) time. sleep( 2 ) assert text == HIC信息单号finally : self. driver. find_element( By. XPATH, '//span[contains(text(),"客户满意度")]/i' ) . click( ) @allure. title ( "电商督办" ) @pytest. mark. parametrize ( '信息单号,开始天,结束天' , [ ( "YT02407120020689" , "2024-07-05" , "2024-07-12" ) ] ) def test_电商督办( self, 信息单号, 开始天, 结束天) : self. driver. find_element( By. XPATH, '//ul/li[text()="电商督办"]' ) . click( ) try : time. sleep( 2 ) self. driver. find_element( By. XPATH, '//label[text()="信息单号:"]/following-sibling::div/div/input' ) . send_keys( 信息单号) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//label[text()="录入时间:"]/following-sibling::div/div/input' ) . click( ) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div/div/div/span/span/div/input[@class="el-input__inner"]' ) . clear( ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div/div/div/span/span/div/input[@class="el-input__inner"]' ) . send_keys( 开始天) time. sleep( 1 ) self. driver. find_elements( By. XPATH, '//div[not(contains(@style,"display"))]/div/div/div/span/span/div/input[@class="el-input__inner"]' ) [ 2 ] . clear( ) self. driver. find_elements( By. XPATH, '//div[not(contains(@style,"display"))]/div/div/div/span/span/div/input[@class="el-input__inner"]' ) [ 2 ] . send_keys( 结束天) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div[@class="el-picker-panel__footer"]/button[2]/span' ) . click( ) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//span[text()="查询"]' ) . click( ) time. sleep( 2 ) self. driver. find_element( By. XPATH, '//div[@class!="el-table__fixed"]/div/table/tbody/tr/td/div/span/button/span[text()="详情"]' ) . click( ) time. sleep( 2 ) text = self. driver. find_element( By. XPATH, '//th[contains(text(),"信息单号:")]/following-sibling::td/span' ) . textprint ( text) assert text == 信息单号self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div/div/button[@aria-label="Close"]/i' ) . click( ) finally : time. sleep( 1 ) self. driver. find_element( By. XPATH, '//span[contains(text(),"电商督办")]/i' ) . click( ) @allure. title ( "电商邀评" ) @pytest. mark. parametrize ( '订单编号,开始天,结束天' , [ ( "3949535376648537739" , "2024-07-05" , "2024-07-13" ) ] ) def test_电商邀评( self, 订单编号, 开始天, 结束天) : self. driver. find_element( By. XPATH, '//ul/li[text()="电商邀评"]' ) . click( ) try : time. sleep( 2 ) self. driver. find_element( By. XPATH, '//label[text()="订单编号:"]/following-sibling::div/div/input' ) . send_keys( 订单编号) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//i[@class="el-input__icon el-range__close-icon"]' ) . click( ) self. driver. find_element( By. XPATH, '//label[text()="邀评新增时间:"]/following-sibling::div/div/input' ) . click( ) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//label[text()="邀评新增时间:"]/following-sibling::div/div/input' ) . send_keys( 开始天) self. driver. find_elements( By. XPATH, '//label[text()="邀评新增时间:"]/following-sibling::div/div/input' ) [ 1 ] . send_keys( 结束天) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//span[text()="查询"]' ) . click( ) self. driver. find_element( By. XPATH, '//span[text()="评价导入"]/parent::button/parent::div/following-sibling::div/button/span' ) . click( ) time. sleep( 2 ) self. driver. find_element( By. XPATH, '//div[@class!="el-table__fixed"]/div/table/tbody/tr/td/div/span/button/span[text()="闭环"]' ) . click( ) time. sleep( 2 ) text = self. driver. find_element( By. XPATH, '//*[@id="reviewUserInfo"]/div[1]/div[2]/table/tbody[1]/tr/td[1]/div/input' ) . get_attribute( 'value' ) assert text == 订单编号time. sleep( 1 ) self. driver. find_element( By. XPATH, '//span[contains(text(),"邀评客户信息")]/i' ) . click( ) finally : time. sleep( 1 ) self. driver. find_element( By. XPATH, '//span[contains(text(),"电商邀评")]/i' ) . click( ) @allure. title ( "工贸督办" ) @pytest. mark. parametrize ( '信息单号,开始天,结束天' , [ ( "JN02407120022700" , "2024-07-05" , "2024-07-13" ) ] ) def test_工贸督办( self, 信息单号, 开始天, 结束天) : self. driver. find_element( By. XPATH, '//ul/li[text()="工贸督办"]' ) . click( ) try : time. sleep( 2 ) self. driver. find_element( By. XPATH, '//label[text()="信息单号:"]/following-sibling::div/div/input' ) . send_keys( 信息单号) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//label[text()="入库时间:"]/following-sibling::div/div/input' ) . click( ) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div/div/div/span/span/div/input[@class="el-input__inner"]' ) . clear( ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div/div/div/span/span/div/input[@class="el-input__inner"]' ) . send_keys( 开始天) time. sleep( 1 ) self. driver. find_elements( By. XPATH, '//div[not(contains(@style,"display"))]/div/div/div/span/span/div/input[@class="el-input__inner"]' ) [ 2 ] . clear( ) self. driver. find_elements( By. XPATH, '//div[not(contains(@style,"display"))]/div/div/div/span/span/div/input[@class="el-input__inner"]' ) [ 2 ] . send_keys( 结束天) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div[@class="el-picker-panel__footer"]/button[2]/span' ) . click( ) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//span[text()="查询"]' ) . click( ) time. sleep( 2 ) self. driver. find_element( By. XPATH, '//div[@class!="el-table__fixed"]/div/table/tbody/tr/td/div/span/button/span[text()="查看详情"]' ) . click( ) time. sleep( 2 ) text = self. driver. find_element( By. XPATH, '//*[@id="industrySuperviseDetail"]/div[1]/div[2]/table/tbody[2]/tr/td[3]/div/input' ) . get_attribute( 'value' ) assert text == 信息单号time. sleep( 1 ) self. driver. find_element( By. XPATH, '//span[contains(text(),"督办详情")]/i' ) . click( ) finally : time. sleep( 1 ) self. driver. find_element( By. XPATH, '//span[contains(text(),"工贸督办")]/i' ) . click( ) @allure. title ( "抱怨信息督办库" ) @pytest. mark. parametrize ( '信息单号,开始天,结束天' , [ ( "JH02407120022611" , "2024-07-05" , "2024-07-13" ) ] ) def test_抱怨信息督办库( self, 信息单号, 开始天, 结束天, web_start) : self. driver. find_element( By. XPATH, '//ul/li[text()="抱怨信息督办库"]' ) . click( ) try : time. sleep( 2 ) self. driver. find_element( By. XPATH, '//label[text()="信息单号:"]/following-sibling::div/div/input' ) . send_keys( 信息单号) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//label[text()="录单时间(起):"]/following-sibling::div/div/input' ) . click( ) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div/div[@class="el-picker-panel__body"]/div[1]/span[1]/div/input' ) . clear( ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div/div[@class="el-picker-panel__body"]/div[1]/span[1]/div/input' ) . send_keys( 开始天) time. sleep( 2 ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]//div[2]/button[2]/span' ) . click( ) self. driver. find_element( By. XPATH, '//label[text()="录单时间(止):"]/following-sibling::div/div/input' ) . click( ) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div/div[@class="el-picker-panel__body"]/div[1]/span[1]/div/input' ) . clear( ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div/div[@class="el-picker-panel__body"]/div[1]/span[1]/div/input' ) . send_keys( 结束天) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]//div[2]/button[2]/span' ) . click( ) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//span[text()="查询"]' ) . click( ) time. sleep( 1 ) text = self. driver. find_element( By. XPATH, '//*[@id="complainInfoDatabase"]/div[2]/div[1]/div[3]//tr/td[3]' ) . textassert text == 信息单号finally : time. sleep( 1 ) self. driver. find_element( By. XPATH, '//span[contains(text(),"抱怨信息督办库")]/i' ) . click( ) @allure. title ( "小海跳闸审核查询" ) @pytest. mark. parametrize ( '信息单号,开始天,结束天' , [ ( "DL02407120002842" , "2024-07-05" , "2024-07-13" ) ] ) def test_小海跳闸审核查询( self, 信息单号, 开始天, 结束天, web_start) : self. driver. find_element( By. XPATH, '//ul/li[text()="小海跳闸审核查询"]' ) . click( ) try : time. sleep( 2 ) self. driver. find_element( By. XPATH, '//label[text()="信息单号:"]/following-sibling::div/div/input' ) . send_keys( 信息单号) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//label[text()="登记开始时间:"]/following-sibling::div/div/input' ) . click( ) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div/div[@class="el-picker-panel__body"]/div[1]/span[1]/div/input' ) . clear( ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div/div[@class="el-picker-panel__body"]/div[1]/span[1]/div/input' ) . send_keys( 开始天) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]//div[2]/button[2]/span' ) . click( ) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//label[text()="登记结束时间:"]/following-sibling::div/div/input' ) . click( ) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div/div[@class="el-picker-panel__body"]/div[1]/span[1]/div/input' ) . clear( ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div/div[@class="el-picker-panel__body"]/div[1]/span[1]/div/input' ) . send_keys( 结束天) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]//div[2]/button[2]/span' ) . click( ) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//span[text()="查询"]' ) . click( ) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//*[@id="tripList"]/div[2]/div[1]/div[3]/table/tbody/tr/td[2]/div/span/button' ) . click( ) time. sleep( 2 ) text = self. driver. find_element( By. XPATH, '//*[@id="tripDetail"]/div[1]/div[2]/table/tbody[1]/tr/td[1]/div/input' ) . get_attribute( 'value' ) assert text == 信息单号time. sleep( 1 ) self. driver. find_element( By. XPATH, '//span[contains(text(),"小海跳闸审核查询详情")]/i' ) . click( ) time. sleep( 1 ) finally : self. driver. find_element( By. XPATH, '//span[contains(text(),"小海跳闸审核查询")]/i' ) . click( ) @allure. title ( "舆情工单处理" ) @pytest. mark. parametrize ( '舆情工单号,开始天,结束天' , [ ( "202407120115" , "2024-07-05" , "2024-07-13" ) ] ) def test_舆情工单处理( self, 舆情工单号, 开始天, 结束天) : self. driver. find_element( By. XPATH, '//ul/li[text()="舆情工单处理"]' ) . click( ) try : time. sleep( 1 ) self. driver. find_element( By. XPATH, '//span[contains(text(),"高级查询")]' ) . click( ) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//label[text()="舆情工单号:"]/following-sibling::div/div/input' ) . send_keys( 舆情工单号) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//label[text()="创建时间:"]/following-sibling::div/div/input' ) . click( ) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div/div/div/span/span/div/input[@class="el-input__inner"]' ) . clear( ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div/div/div/span/span/div/input[@class="el-input__inner"]' ) . send_keys( 开始天) time. sleep( 1 ) self. driver. find_elements( By. XPATH, '//div[not(contains(@style,"display"))]/div/div/div/span/span/div/input[@class="el-input__inner"]' ) [ 2 ] . clear( ) self. driver. find_elements( By. XPATH, '//div[not(contains(@style,"display"))]/div/div/div/span/span/div/input[@class="el-input__inner"]' ) [ 2 ] . send_keys( 结束天) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div[@class="el-picker-panel__footer"]/button[2]/span' ) . click( ) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//span[text()="查询"]' ) . click( ) time. sleep( 1 ) self. driver. execute_script( "window.scrollTo(0, document.body.clientHeight)" ) time. sleep( 1 ) self. driver. find_element( By. XPATH, '//*[@id="industrySupervise"]/div[2]/div[1]/div[3]/table/tbody/tr/td[2]/div/span/button[1]/span' ) . click( ) time. sleep( 2 ) text = self. driver. find_element( By. XPATH, '//*[@id="industrySupervise"]/div[3]/div/div[2]/div/div[1]/form/div[2]/div[1]/div/div' ) . textassert text == 舆情工单号time. sleep( 1 ) self. driver. find_element( By. XPATH, '//div[not(contains(@style,"display"))]/div/div/button[@aria-label="Close"]/i' ) . click( ) time. sleep( 1 ) finally : self. driver. execute_script( "window.scrollTo(0, 0)" ) self. driver. find_element( By. XPATH, '//span[contains(text(),"舆情工单处理")]/i' ) . click( )