Registry / http-networking / core-universal

core-universal

JSON →
library4.16.5pypypi✓ verified 26d ago

The `core-universal` package is part of the Applitools Eyes SDK ecosystem, serving as the Python client for the Eyes Core SDK Server. It provides the underlying communication protocol (using WebSockets) for Python SDKs (like `eyes-selenium`, `eyes-playwright`, `eyes-appium`) to interact with the Applitools Eyes service, where core functionality is implemented in JavaScript. End-users typically interact with higher-level Applitools SDKs rather than directly with `core-universal`. The current version is 4.16.5. Applitools SDKs are actively maintained with frequent releases.

pip install core-universal
INSTALL
IMPORT
SIG · CORE-UNIVERSAL
C
core-universal
http-networkingpythonv4.16.5
Install
2.5s avg
Import
—
Disk
124MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v4.16.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 125.9MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 2.5s · import 0.000s · 126MB
124MB installed
● package 124MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Eyes
✓ from applitools.core_universal import Eyes
✗ from applitools.core import Eyes

This quickstart demonstrates a basic visual test using `applitools.selenium`, which is a common way to interact with Applitools Eyes functionality. It initializes a Selenium WebDriver, opens an Applitools Eyes test, performs visual checkpoints on different pages, and then closes the test. Remember to set the `APPLITOOLS_API_KEY` environment variable.

import os from selenium import webdriver from applitools.selenium import Eyes, ClassicRunner, Target def run_applitools_test(): # Set your Applitools API key from environment variable # For a quickstart, ensure APPLITOOLS_API_KEY is set in your environment api_key = os.environ.get('APPLITOOLS_API_KEY', 'YOUR_APPLITOOLS_API_KEY_HERE') if not api_key or api_key == 'YOUR_APPLITOOLS_API_KEY_HERE': print("Warning: APPLITOOLS_API_KEY environment variable not set. Test might fail.") # In a real scenario, you'd raise an error or handle this more robustly runner = ClassicRunner() eyes = Eyes(runner) eyes.api_key = api_key # Configure Eyes to log to console for debugging eyes.log_handler = None # Set to StreamMessageLogger() for console output driver = None try: # Initialize a headless Chrome browser (ensure chromedriver is in PATH) options = webdriver.ChromeOptions() options.add_argument('--headless') driver = webdriver.Chrome(options=options) # Start the Applitools Eyes test driver = eyes.open(driver=driver, app_name='My Python App', test_name='Simple Login Test', viewport_size={'width': 800, 'height': 600}) # Navigate to a URL and perform visual checkpoints driver.get('https://demo.applitools.com') eyes.check('Login Page', Target.window().fully()) # Perform some actions (e.g., filling a form, clicking buttons) # For this example, just navigate to another page driver.find_element_by_id('log-in').click() eyes.check('App Page', Target.window().fully()) # Close the Eyes test and get results results = eyes.close(raise_exception=True) print(f"Applitools Test Results: {results}") except Exception as e: print(f"Applitools test failed: {e}") finally: if driver: driver.quit() # Always abort the test if it's open, even if an exception occurred eyes.abort_if_not_closed() if __name__ == '__main__': run_applitools_test()
Debug
Known issues
gotchaDirect import and usage of `core-universal` is generally not intended for end-users. It serves as an internal communication layer for higher-level Applitools SDKs (e.g., `applitools.selenium`, `applitools.playwright`). Developers should use the appropriate specialized SDK for their testing framework.
fix
Use a specialized Applitools SDK (e.g., `applitools-eyes-selenium`, `applitools-eyes-playwright`) that wraps `core-universal` for end-to-end visual testing.
affects: All
breakingApplitools Core Tools (which `core-universal` is a part of) version 4.8.0+ no longer supports Python 3.7 and 3.8. Attempting to use these Python versions with newer Core Tools may result in errors.
fix
Upgrade your Python environment to version 3.10 or higher. Python 3.7 and 3.8 are End-of-Life (EOL).
affects: 4.8.0+
gotchaThe Applitools API Key (`APPLITOOLS_API_KEY`) is crucial for authenticating with the Applitools service. Forgetting to set it, or setting it incorrectly, will prevent tests from running or uploading results.
fix
Ensure the `APPLITOOLS_API_KEY` environment variable is correctly set with your valid Applitools API key before running tests. Alternatively, set it programmatically using `eyes.api_key = 'YOUR_API_KEY'`.
affects: All
gotchaMutable default arguments in Python functions (e.g., `def func(arg=[]):`) can lead to unexpected shared state across function calls. While not specific to `core-universal`, this is a common Python footgun that can affect custom helper functions in test automation.
fix
Initialize mutable default arguments inside the function if a fresh object is needed for each call, typically by using `None` as the default and checking for it: `def func(arg=None): if arg is None: arg = []`.
affects: All
Upgrade
Version history
4.16.5latest on PyPI · released Jun 17, 2024
Audit
Dependencies
applitools-eyes-seleniumoptionalCommonly used with this core component for web UI testing via Selenium.
applitools-eyes-playwrightoptionalCommonly used with this core component for web UI testing via Playwright.
applitools-eyes-appiumoptionalCommonly used with this core component for mobile UI testing via Appium.
Agent activity
38 hits · last 30 days
node
32
OpenAI (training)
1
Resources
core-universal — pip install core-universal · libregistry