This code displays a webpage in a specific size and zoom level using the $TS.screen
function, with parameters such as URL, zoom, width, and height. The parameters are used for testing or demonstration purposes.
$TS.screen('act.com/fr-fr/produits/act-pro', {zoom: .5, width: 680, 'crop-h': 400});
// Constants for browser actions
const ACT_COM_PROD = 'act.com/fr-fr/produits/act-pro';
const DEFAULT_ZOOM = 0.5;
const DEFAULT_WIDTH = 680;
const DEFAULT_HEIGHT = 400;
/**
* Opens act.com/fr-fr/produits/act-pro in the browser with specified dimensions
*/
function openActComPage(): void {
const options: any = {
zoom: DEFAULT_ZOOM,
width: DEFAULT_WIDTH,
height: DEFAULT_HEIGHT,
};
browser.actions().navigate({
url: ACT_COM_PROD,
options,
});
}
// Example usage:
openActComPage();
This code uses the $TS.screen
function to display a webpage in a webbrowser or headless browser.
act.com/fr-fr/produits/act-pro
: The URL of the webpage to be displayed.zoom: 0.5
: Zooms the page to 50% of its original size.width: 680
: Sets the width of the displayed page to 680 pixels.'crop-h': 400
: Crops the height of the page to 400 pixels.The purpose of these parameters is to display a webpage in a specific size and zoom level for testing or demonstration purposes.