Skip to content

Commit a6c9c2e

Browse files
committed
[test] fix document-start-end with wait_for_element_id
1 parent cfe998e commit a6c9c2e

File tree

1 file changed

+6
-2
lines changed
  • test/sanity/document-start-end

1 file changed

+6
-2
lines changed

test/sanity/document-start-end/test.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
import time
22
import os
3+
import sys
34

45
from selenium import webdriver
56
from selenium.webdriver.chrome.options import Options
7+
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
8+
from nw_util import *
9+
610
chrome_options = Options()
711
chrome_options.add_argument("nwapp=" + os.path.dirname(os.path.abspath(__file__)))
812

913
driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options)
1014
time.sleep(1)
1115
try:
1216
print driver.current_url
13-
result = driver.find_element_by_id('result').get_attribute('innerHTML')
14-
result2 = driver.find_element_by_id('result2').get_attribute('innerHTML')
17+
result = wait_for_element_id(driver, 'result')
18+
result2 = wait_for_element_id(driver, 'result2')
1519
print result
1620
print result2
1721
assert(result == 'success from popup' and result2 == 'startiframe')

0 commit comments

Comments
 (0)