Testing Menubar Crash Prevention in NW.js
This test suite validates the menubar crash issue (#5229) in NW.js using Selenium WebDriver. It automates browser interactions to verify the menubar component’s stability and proper functionality across different platforms.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
nwjs/nwJs
test/sanity/issue5229-menubar-crash/test.py
import time
import os
import platform
import sys
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("nwapp=" + os.path.dirname(os.path.abspath(__file__)))
driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options)
driver.implicitly_wait(2)
try:
print(driver.current_url)
result = driver.find_element_by_id('result').get_attribute('innerHTML')
print(result)
assert('success' in result)
finally:
driver.quit()