我试图查看某个操作后是否显示弹出窗口。弹出窗口使用pnotify完成,并在DOM中放置div.ui-pnotify
。我可以在测试中看到通知弹出,但我似乎无法通过QUnit测试它的可见性,很可能是因为延迟。这里有这方面经验的人吗?
ok(find('div.ui-pnotify').length, 'Name has been changed');
Chrome控制台:
<div class="ui-pnotify " style="width: 300px; right: 25px; top: 25px; opacity: 1; display: block; cursor: auto;"><div class="alert ui-pnotify-container alert-success ui-pnotify-shadow" style="min-height: 16px;"><div class="ui-pnotify-icon"><span class="fa fa-check"></span></div><div class="ui-pnotify-closer" style="cursor: pointer; visibility: hidden;"><span class="fa fa-times"></span></div><div class="ui-pnotify-sticker" style="cursor: pointer; visibility: hidden;"><span class="fa fa-play"></span></div><h4 class="ui-pnotify-title">Persoonlijke gegevens</h4><div class="ui-pnotify-text">Uw persoonlijke gegevens zijn opgeslagen.</div></div></div>