clearAllSessionStorage
清除测试交互过的所有源的
sessionStorage
数据。
caution
Cypress 会在每次测试_前_自动清除所有sessionStorage,以防止当 测试隔离 启用时状态在测试之间共享。除非你需要在单个测试内清除sessionStorage或测试隔离被禁用,否则不应使用此命令。
语法
cy.clearAllSessionStorage()
cy.clearAllSessionStorage(options)
用法
正确用法
cy.clearAllSessionStorage()
参数
options (Object)
传入一个选项对象来改变cy.clearAllSessionStorage()
的默认行为。
选项 | 默认值 | 描述 |
---|---|---|
log | true | 在命令日志中显示该命令 |
生成结果
cy.clearAllSessionStorage()
返回null
。
规则
要求
cy.clearAllSessionStorage()
需要链式调用cy
。
断言
cy.clearAllSessionStorage()
不能链式调用任何断言。
超时设置
cy.clearAllSessionStorage()
不会超时。