File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ import time
2+ from basic_selenium_test import BasicSeleniumTest
3+ from selenium .webdriver .common .by import By
4+ from selenium .webdriver .support .wait import WebDriverWait
5+ from selenium .webdriver .support import expected_conditions as EC
6+
7+
8+ class RecheckTestSelenium (BasicSeleniumTest ):
9+
10+ def test_recheck_file (self ):
11+ check_id = self .open_statistic ()
12+ if check_id :
13+ URL = self .get_url (f"/recheck/{ check_id } " )
14+ self .get_driver ().get (URL )
15+ obj = WebDriverWait (self .driver , 10 ).until (
16+ EC .presence_of_element_located ((By .ID , "results_title" ))
17+ )
18+ if "Производится проверка файла" in obj .text :
19+ start_time = time .time ()
20+ max_time = 240
21+ while (time .time () - start_time ) < max_time :
22+ time .sleep (10 )
23+ try :
24+ obj = WebDriverWait (self .driver , 10 ).until (
25+ EC .presence_of_element_located ((By .ID , "results_table" ))
26+ )
27+ if obj is not None :
28+ self .assertNotEquals (obj , None )
29+ return
30+ except :
31+ continue
32+ self .fail ("Result of check is not found" )
33+ else :
34+ self .fail ("No checking status after /recheck" )
35+ else :
36+ self .skipTest ("No check in system for testing recheck" )
You can’t perform that action at this time.
0 commit comments