angular-e2e - 如何对 UI 计时器进行 Angular e2e 测试
问题描述
我有一个 UI 功能,在计时器用完之前我会显示一些信息,当它用完时,我会显示另一个 UI 来重新生成信息。
最初,我显示了意味着计时器将运行X
一段时间的信息。
let timer = timeLimit * 60;
const timerInterval = setInterval(() => {
this.timeLimitViewer = '';
timeinfo = this.getTimeRemaining(timer);
hours = timeinfo.hours <= 0 ? '' : timeinfo.hours + ' hrs ';
minutes = timeinfo.minutes <= 0 ? '' : timeinfo.minutes + ' mins ';
seconds = timeinfo.seconds <= 0 ? '' : timeinfo.seconds + ' secs ';
this.timeLimitViewer = hours + minutes + seconds;
if (--timer <= 0) {
clearInterval(timerInterval);
this.showRegenrate = true;
this.timeLimitViewer = undefined;
}
}, 1000);
问题是我将如何在量角器中测试这样的东西,以便我可以期待一段X
时间后重新生成操作按钮。
解决方案
推荐阅读
- powershell - 在某些情况下,使用 exit 语句会中断输出。这是有原因的还是一个错误?
- node.js - Nest 无法解析 JwtService (?) [JWT_MODULE_OPTIONS] 的依赖项
- select - 随机或按名称选择单位,在游戏中自动选择(pycharm)
- mysql - 没有 istio 注入的 MySQL 客户端无法通过 istio 注入连接到 MySQL pod
- arrays - 关于 uniqueItems 的最佳实践是什么:Openapi 中的真正数组
- node.js - Nestjs - 使用 3rd 方库提供自定义类的正确方法是什么
- tasker - 恢复完整 Tasker 备份的操作
- python - 复杂的 SQL 查询适用于 Postgresql pgAdmin 4 但不适用于 Python
- android - 适用于 Android 的 Video.js CDN(响应式)
- android-studio - 如何在 Flutter 应用程序的 Android Studio 运行窗口中禁用“相同行”消息