我想在所有规格文件中保留/保留登录名,而不是为每个文件一次又一次地登录

问题描述 投票:0回答:1

我想保留/保留所有规格文件中的登录信息,而不是一次又一次地为每个文件登录:我发现多个测试的解决方案是一个文件,但我需要多个规格文件的多个测试的解决方案

Save local storage across tests to avoid re-authentication

Set local storage in Cypress

https://www.npmjs.com/package/cypress-localstorage-commands

这些是具有多个测试的单个文件的解决方案,但我需要多个文件的解决方案

authentication cypress persist preserve
1个回答
0
投票

cypress-localstorage-commands包即使在不同的测试文件之间也保留localStorage,这是其默认行为。如其文档中所述,它还提供了clearLocalStorageSnapshot命令,以在需要时清除测试文件之间的localStorage。

© www.soinside.com 2019 - 2024. All rights reserved.