API Documentation
Complete reference for all Cuppet Core modules and functions
mainFunctions
Core navigation and URL handling functions for web automation.
prepareUrl ASYNC
Prepare the URL using configuration to get the domain and generate full or relative paths.
const url = await mainFunctions.prepareUrl('/about');
// Returns: 'https://example.com/about'
extractPath SYNC
Extract current page URL - absolute or relative.
visitPath ASYNC
Navigate to a URL with automatic cookie consent handling if configured.
validatePath SYNC
Validate that current page URL contains the expected path.
setViewport ASYNC
Set viewport size for different devices (mobile, tablet, laptop, etc.).
elementInteraction
Comprehensive element interaction utilities for web automation.
click ASYNC
Click on an element with optional skip functionality.
fillField ASYNC
Fill a form field with text.
seeElement ASYNC
Check if an element is visible or hidden on the page.
uploadFile ASYNC
Upload a file using file input element.
selectOptionByValue ASYNC
Select dropdown option by value attribute.
dataStorage
Data storage and management utilities for test data persistence.
createFile ASYNC
Create the JSON file for storing test data.
getVariable SYNC
Retrieve a stored variable value from JSON file.
iStoreVariableWithValueToTheJsonFile ASYNC
Store a variable with its value to the JSON file.
saveCurrentPath ASYNC
Save the current page path to JSON file.
helperFunctions
Utility functions for common testing operations.
generateRandomString SYNC
Generate a random string with custom length.
waitForAjax ASYNC
Wait until AJAX requests are completed.
getRegion ASYNC
Get region element class name from configuration.
apiFunctions
RESTful API testing capabilities with authentication support.
sendRequest ASYNC
Send HTTP request with method, URL, headers, and data.
setBasicAuth ASYNC
Set up basic authentication for API requests.
appiumTesting
Mobile application testing with Appium integration.
clickElement ASYNC
Click on mobile element using Appium driver.
scrollToElement ASYNC
Scroll to element on mobile device.
accessibilityTesting
Web accessibility testing with Pa11y integration.
validateAccessibility ASYNC
Run accessibility tests and generate HTML reports.
lighthouse
Performance testing with Google Lighthouse integration.
validatePageSpeed ASYNC
Run Lighthouse performance audit and generate reports.
visualRegression
Visual regression testing with BackstopJS integration.
runBackstopSingleScenario ASYNC
Run BackstopJS visual regression test for а single scenario.
runBackstopMultiplePages ASYNC
Run visual regression tests for multiple pages.