Testing Window Workspace Visibility Implementation in nw.js
This test suite validates the window.setVisibleOnAllWorkspaces functionality in NW.js using Selenium WebDriver with Python. The test verifies that a window can be correctly set to display across all workspaces on non-Windows platforms.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
nwjs/nwJs
test/sanity/window-setvisibleonallworkspaces/test.py
import os
import platform
import time
if platform.system() == 'Windows':
print('Skipped for Windows platform')
sys.exit(0)
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, service_log_path="log", service_args=["--verbose"])
try:
result = driver.find_element_by_id('visible_on_all_workspaces').get_attribute('textContent')
assert(result == 'true')
finally:
driver.quit()