0

当它在 Chrome 中运行时,我得到FOUND: [object Object]了文本断言。

当它在 PhantomJS 中运行时,我得到FOUND:(空白)。

Running tests
Running Browser: PhantomJS
OS: mac 10.10 (Yosemite) 32bit
Browser Version: 1.9.8

RUNNING TEST - "Amazon does its thing"
▶ OPEN http://www.amazon.com/
▶ TYPE #twotabsearchtextbox
▶ CLICK .nav-submit-input
▶ WAITFORELEMENT 
✘ TEXT
0 EXPECTED: The Blues Brothers
0 FOUND: 
✘ TEST - "Amazon does its thing" FAILED

 0/1 assertions passed. Elapsed Time: 58.91 sec 

我的测试:

module.exports = {
  'Amazon does its thing': function (test) {
    test
     .open('http://www.amazon.com/')
     .type('#twotabsearchtextbox', 'Blues Brothers VHS')
     .click('.nav-submit-input')
     .waitForElement('#result_0')
     .assert.text('#result_0 .newaps a span').is('The Blues Brothers')
     .done();
  }
};

我正在使用 OS X Yosemite 10.10.5。

Chrome 版本:46.0​​.2490.71(64 位)

达莱克版本:

DalekJS CLI 工具版本:0.0.5 DalekJS 本地安装:0.0.9

4

1 回答 1

0

亚马逊似乎已经改变了他们的 DOM,分别将提交按钮类.nav-submit-input更改为 just .nav-input,以及他们的结果页面的结构。因此,您还必须更改#result_0 .newaps a span#result_0 .s-access-title,然后它应该再次工作。

于 2015-10-21T15:24:54.663 回答