Ember.js 在验收测试中等待外部事件

Ember.js 在验收测试中等待外部事件,ember.js,Ember.js,在Ember 2.3应用程序中,我正在使用stripe,我进行了以下验收测试: it('can visit /user-subscription', () => { visit('/'); andThen(() => { click('#pay'); andThen(() => { fillIn('#card_number', '4242424242424242'); fillIn('#cc-exp'

在Ember 2.3应用程序中,我正在使用stripe,我进行了以下验收测试:

  it('can visit /user-subscription', () => {
    visit('/');

    andThen(() => {
      click('#pay');
      andThen(() => {
        fillIn('#card_number', '4242424242424242');
        fillIn('#cc-exp', '1299');
        fillIn('#cc-csc', '444');
        click('#submitButton');

        andThen(() => {
          done();
          expect(currentPath()).to.equal('subscriptions.success');
       });
      });
    });
  });
当我点击
pay
按钮时,它会显示带有此代码的条纹框:

  var checkout = StripeCheckout.configure({
    key: "...",
    locale: 'fr'
  }).open({
    email: owner.get('email'),
    amount: price,
    token: (result) => {
      # ...
    }
  });
它加载并执行外部脚本。在显示框之前,测试失败。测试失败时,外部脚本未完全加载

我正在将EmberCliMirage与
this.passthrough()一起使用https://checkout.stripe.com/**');


如何使测试通过?

您可以暂停测试,直到收到事件


它仍然不起作用。我还尝试了
Ember.run.start
Ember.run.stop
,超过了
2000毫秒的超时时间。确保在此测试中调用了done()回调。
。我正在寻找一种方法来延长时间,但我没有找到。我找到了一种方法来增加超时,但我仍然有这个错误。
let eventReceived = assert.async();

// ... callback for that async event ... 
function eventComplete() {
  eventReceived();
  // ... do some more assertions
}

// supply the callback to something that knows about the external event