0

在验收测试期间,为了模拟用户交互,应单击基础模态对话框上的按钮:

test('sets correct country name after manual lookup', function(assert) {
  visit('/sign-in');
  click('#country-name');

  Ember.run(function() {
    fillIn('#country-name', 'state');
    click('li:contains("United States")');
  });

  andThen(function() {
    assert.equal(find('#country-name').text(), 'United States');
    assert.equal(find('#country-code').text(), 1);
  });
});

但这不起作用,因为执行代码后会出现对话框-

我也尝试将点击包装在 Ember.run.scheduleOnce('afterRender', this, function(){ ... }} - 也没有成功。

4

0 回答 0