1、官方文档

https://docs.cypress.io/api/commands/screenshot.html#Syntax

2、用法

cypress-screenshot

3、options详解

cypress-screenshot

4、实例


cy.screenshot();

页面有多长,截取多长,因为默认capture值为fullPage


cy.screenshot("my-test");

截取全图,文件名称自定义为"my-test"


cy.screenshot({

capture: 'viewport'

});

截取图片大小为被侧程序的当前视窗大小,也是当前展示的图

 

相关文章: