docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
A utility that launches a browser and tests how a webpage responds to different media types and feature preferences. This tool helps developers verify that their responsive designs correctly adapt to various user environment settings.
/**
* Launches a browser, navigates to a test page, and captures screenshots
* with different media type emulations.
*
* @param {string} url - The URL of the page to test
* @returns {Promise<Object>} Object containing paths to saved screenshots
*/
async function testMediaTypes(url) {
// Returns: { screen: 'screen.png', print: 'print.png' }
}
/**
* Tests a page's response to different color scheme preferences.
*
* @param {string} url - The URL of the page to test
* @param {string} scheme - Either 'light' or 'dark'
* @returns {Promise<string>} The page title after applying the color scheme
*/
async function testColorScheme(url, scheme) {
// Returns the page title
}
/**
* Tests a page with reduced motion preference enabled.
*
* @param {string} url - The URL of the page to test
* @param {string} selector - CSS selector for element to inspect
* @param {string} property - CSS property to check
* @returns {Promise<string>} The value of the specified CSS property
*/
async function testReducedMotion(url, selector, property) {
// Returns the CSS property value
}
/**
* Tests a page with a specific color gamut emulation.
*
* @param {string} url - The URL of the page to test
* @param {string} gamut - Color gamut to emulate ('srgb', 'p3', 'rec2020')
* @returns {Promise<boolean>} True if the gamut is supported
*/
async function testColorGamut(url, gamut) {
// Returns boolean indicating support
}
module.exports = {
testMediaTypes,
testColorScheme,
testReducedMotion,
testColorGamut
};Provides browser automation and media emulation capabilities.