Testing SQLite Module Stability with Node 8 Integration in NW.js
This test suite validates the functionality of SQLite modules in NW.js on macOS environments, specifically addressing a crash issue with Node 8 integration. The test ensures database operations work correctly without system instability.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
nwjs/nwJs
test/sanity/issue5943-mac-dblite-module-with-node8-crash/test.py
import time
import os
import shutil
import platform
import sys
import subprocess
if platform.system() != 'Darwin':
print('Skipped for non Mac platform')
sys.exit(0)
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from nw_util import *
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
testdir = os.path.dirname(os.path.abspath(__file__))
chrome_options.add_argument("nwapp=" + testdir)
node_module = os.path.join(testdir, "node_modules")
os.chdir(testdir)
install_native_modules()
driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options)
driver.implicitly_wait(2)
try:
print(driver.current_url)
print("select data from table Australia")
result = driver.find_element_by_id("shell").get_attribute("innerHTML")
assert("Sausage" in result)
print('There is no crash')
finally:
driver.quit()