Commit 8f563123 authored by gaotao's avatar gaotao

input清空

parent e1740c30
...@@ -9,10 +9,10 @@ from engine import get_engine ...@@ -9,10 +9,10 @@ from engine import get_engine
@get_engine(__file__,'JBAQ_URL') @get_engine(__file__,'JBAQ_URL')
def test_addxyr(engine): def test_addxyr(engine):
# engine.init() # engine.init()
basic_url = engine.get_testUrl('JBAQ_URL') # basic_url = engine.get_testUrl('JBAQ_URL')
case_id = engine.get_caseId('caseId') # case_id = engine.get_caseId('caseId')
url = basic_url.format(bmsah=case_id) # url = basic_url.format(bmsah=case_id)
engine.driver.get(url) # engine.driver.get(url)
xyr_add = engine.driver.xpath("//div[@class='plus___1ckgY']") xyr_add = engine.driver.xpath("//div[@class='plus___1ckgY']")
if not xyr_add: if not xyr_add:
engine.logger.info('没有基本信息!!查看具体情况') engine.logger.info('没有基本信息!!查看具体情况')
...@@ -73,9 +73,12 @@ def test_addxyr(engine): ...@@ -73,9 +73,12 @@ def test_addxyr(engine):
@pytest.mark.nullxyr @pytest.mark.nullxyr
@get_engine(__file__,'JBAQ_URL') @get_engine(__file__,'JBAQ_URL')
def test_null_xyr(engine): def test_null_xyr(engine):
engine.xpath("//input[@id='起诉意见书_犯罪嫌疑人_0_犯罪嫌疑人姓名']")[0].clear() js = '''document.querySelector("#起诉意见书_犯罪嫌疑人_0_犯罪嫌疑人姓名").value = "";'''
engine.driver.execute_script(js)
# engine.xpath("//input[@id='起诉意见书_犯罪嫌疑人_0_犯罪嫌疑人姓名']")[0].clear()
time.sleep(0.5) time.sleep(0.5)
save_button = engine.xpath("//span[text()='保存']")[0] save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
save_button.click() save_button.click()
time.sleep(0.5) time.sleep(0.5)
message = engine.xpath("//div[@class='ant-message']//span[text()='有必填项未填']") message = engine.xpath("//div[@class='ant-message']//span[text()='有必填项未填']")
...@@ -83,11 +86,14 @@ def test_null_xyr(engine): ...@@ -83,11 +86,14 @@ def test_null_xyr(engine):
@pytest.mark.basicmatter1 @pytest.mark.basicmatter
@get_engine(__file__,'JBAQ_URL') @get_engine(__file__,'JBAQ_URL')
def test_nullbirth(engine): def test_nullbirth(engine):
time.sleep(0.5) time.sleep(0.5)
engine.driver.xpath("//div[@title='出生日期']/following-sibling::div[1]//input")[0].clear() js = '''document.querySelector("//div[@title='出生日期']/following-sibling::div[1]//input").value = "";'''
engine.driver.execute_script(js)
# engine.driver.xpath("//div[@title='出生日期']/following-sibling::div[1]//input")[0].clear()
time.sleep(0.5) time.sleep(0.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0] save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
save_button.click() save_button.click()
...@@ -101,8 +107,13 @@ def test_nullbirth(engine): ...@@ -101,8 +107,13 @@ def test_nullbirth(engine):
@get_engine(__file__, 'JBAQ_URL') @get_engine(__file__, 'JBAQ_URL')
def test_nullID(engine): def test_nullID(engine):
time.sleep(0.5) time.sleep(0.5)
engine.driver.xpath("//input[@id='起诉意见书_犯罪嫌疑人_0_身份证号码']")[0].clear() js = '''document.querySelector("#起诉意见书_犯罪嫌疑人_0_身份证号码").value="";'''
time.sleep(0.5) engine.driver.execute_script(js)
# js = '''document.querySelector("//input[@id='起诉意见书_犯罪嫌疑人_0_身份证号码']").value = "";'''
# # engine.driver.execute_script(js)
# engine.driver.xpath("//input[@id='起诉意见书_犯罪嫌疑人_0_身份证号码']")[0].clear()
time.sleep(2.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0] save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
save_button.click() save_button.click()
time.sleep(0.5) time.sleep(0.5)
...@@ -142,7 +153,10 @@ def test_notnulledu(engine): ...@@ -142,7 +153,10 @@ def test_notnulledu(engine):
@pytest.mark.basicmatter @pytest.mark.basicmatter
@get_engine(__file__, 'JBAQ_URL') @get_engine(__file__, 'JBAQ_URL')
def test_nullDomicile(engine): def test_nullDomicile(engine):
engine.driver.xpath("//input[@id='起诉意见书_犯罪嫌疑人_0_户籍所在地']")[0].clear()
js = '''document.querySelector("//input[@id='起诉意见书_犯罪嫌疑人_0_户籍所在地']").value = "";'''
engine.driver.execute_script(js)
# engine.driver.xpath("//input[@id='起诉意见书_犯罪嫌疑人_0_户籍所在地']")[0].clear()
time.sleep(0.5) time.sleep(0.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0] save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
save_button.click() save_button.click()
...@@ -168,7 +182,11 @@ def test_notnullDomicile(engine): ...@@ -168,7 +182,11 @@ def test_notnullDomicile(engine):
@pytest.mark.basicmatter @pytest.mark.basicmatter
@get_engine(__file__, 'JBAQ_URL') @get_engine(__file__, 'JBAQ_URL')
def test_nulladdr(engine): def test_nulladdr(engine):
engine.driver.xpath("//input[@id='起诉意见书_犯罪嫌疑人_0_住址']")[0].clear()
js = '''document.querySelector("//input[@id='起诉意见书_犯罪嫌疑人_0_住址']").value = "";'''
engine.driver.execute_script(js)
# engine.driver.xpath("//input[@id='起诉意见书_犯罪嫌疑人_0_住址']")[0].clear()
time.sleep(0.5) time.sleep(0.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0] save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
save_button.click() save_button.click()
...@@ -246,7 +264,11 @@ def test_notnullSpecialID(engine): ...@@ -246,7 +264,11 @@ def test_notnullSpecialID(engine):
@pytest.mark.basicmatter @pytest.mark.basicmatter
@get_engine(__file__, 'JBAQ_URL') @get_engine(__file__, 'JBAQ_URL')
def test_nullFilingTime(engine): def test_nullFilingTime(engine):
engine.driver.xpath("//div[@title='立案时间']/following-sibling::div[1]//input")[0].clear()
js = '''document.querySelector("//div[@title='立案时间']/following-sibling::div[1]//input").value = "";'''
engine.driver.execute_script(js)
# engine.driver.xpath("//div[@title='立案时间']/following-sibling::div[1]//input")[0].clear()
time.sleep(0.5) time.sleep(0.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0] save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
save_button.click() save_button.click()
...@@ -257,7 +279,7 @@ def test_nullFilingTime(engine): ...@@ -257,7 +279,7 @@ def test_nullFilingTime(engine):
@pytest.mark.basicmatter @pytest.mark.basicmatter
@get_engine(__file__, 'JBAQ_URL') @get_engine(__file__, 'JBAQ_URL')
def test_IncorrectFormatFilingTime(engine): def test_IncorrectFormatFilingTime(engine): # 立案时间为空
engine.driver.xpath("//div[@title='立案时间']/following-sibling::div[1]//input")[0].clear().send_keys('5月5日') engine.driver.xpath("//div[@title='立案时间']/following-sibling::div[1]//input")[0].clear().send_keys('5月5日')
time.sleep(0.5) time.sleep(0.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0] save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
...@@ -269,7 +291,7 @@ def test_IncorrectFormatFilingTime(engine): ...@@ -269,7 +291,7 @@ def test_IncorrectFormatFilingTime(engine):
@pytest.mark.basicmatter @pytest.mark.basicmatter
@get_engine(__file__, 'JBAQ_URL') @get_engine(__file__, 'JBAQ_URL')
def test_correctFormatFilingTime(engine): def test_correctFormatFilingTime(engine): # 立案时间格式于标准不一致
engine.driver.xpath("//div[@title='立案时间']/following-sibling::div[1]//input")[0].clear().send_keys('2020年05月05日') engine.driver.xpath("//div[@title='立案时间']/following-sibling::div[1]//input")[0].clear().send_keys('2020年05月05日')
time.sleep(0.5) time.sleep(0.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0] save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
...@@ -280,3 +302,33 @@ def test_correctFormatFilingTime(engine): ...@@ -280,3 +302,33 @@ def test_correctFormatFilingTime(engine):
@pytest.mark.basicmatter
@get_engine(__file__, 'JBAQ_URL')
def test_nullmeasure(engine): # 强制措施为空
js = '''document.querySelector("#起诉意见书_犯罪嫌疑人_0_当前强制措施情况_案情摘要").value="";'''
engine.driver.execute_script(js)
# input = engine.driver.xpath("//textarea[@id='起诉意见书_犯罪嫌疑人_0_当前强制措施情况_案情摘要']")[0]
# input.click()
# input.clear()
time.sleep(3.5)
save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
save_button.click()
time.sleep(0.5)
message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
assert len(message) == 1
@pytest.mark.basicmatter
@get_engine(__file__, 'JBAQ_URL')
def test_fzjlRetract(engine): # 犯罪经历收起
pass
# engine.driver.xpath("//div[text()='犯罪经历']/following-sibling::div[1]//a[@class='toggleTrigger___2NjVY']")[0].click()
# time.sleep(0.5)
# save_button = engine.driver.xpath("//span[text()='保存']/..")[0]
# save_button.click()
# time.sleep(0.5)
# message = engine.driver.xpath("//div[@class='ant-message']//span[contains(text(),'保存成功')]")
# assert len(message) == 1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment