cphil
cphil

Reputation: 163

Dalekjs Amazon example from "Getting Started" not working with Chrome and PhantomJS

When it's run in Chrome, I get FOUND: [object Object] for the text assertion.

When it's run in PhantomJS, I get FOUND: (blank).

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 

my test:

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();
  }
};

I'm using OS X Yosemite 10.10.5.

Chrome version: 46.0.2490.71 (64-bit)

Dalek version:

DalekJS CLI Tools Version: 0.0.5 DalekJS local install: 0.0.9

Upvotes: 0

Views: 109

Answers (1)

Sebastian Golasch
Sebastian Golasch

Reputation: 686

It seems that Amazon has changed their DOM, respectively the submit button class .nav-submit-input to just .nav-input, as well as the structure of their result page. So you must also change #result_0 .newaps a span to #result_0 .s-access-title and then it should work again.

Upvotes: 0

Related Questions