Testing DOM Storage Quota Implementation in NW.js
This test suite validates DOM storage quota functionality in NW.js using Selenium WebDriver. It automates browser interactions to verify storage limits and quota management, ensuring proper implementation of web storage constraints.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
nwjs/nwJs
test/sanity/dom-storage-quota/test.py
import time
import os
import shutil
import platform
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
testdir = os.path.dirname(os.path.abspath(__file__))
chrome_options = Options()
chrome_options.add_argument("nwapp=" + testdir)
driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options)
try:
print(driver.current_url)
driver.implicitly_wait(5)
result = driver.find_element_by_id('result')
print(result.get_attribute('innerHTML'))
assert("success" in result.get_attribute('innerHTML'))
result = driver.find_element_by_id('result2')
print(result.get_attribute('innerHTML'))
assert("success" in result.get_attribute('innerHTML'))
finally:
driver.quit()