0

I using nightwatch framework for running End-to-End test. I am able to run all the test cases successfully in chrome and IE but few tests fails for phantomjs. Test cases below error out

'Search' : function(browser) {

        browser
            .url('http://localhost:8001/index.html')

        browser
            .setValue('input[id=SearchInput-inner]', 'abc')
            .click('button[id=nsnButton]')
            .pause('1000')
            .verify.attributeEquals('#nsnButton', 'disabled', 'true')

    },

Error I get is

Testing if attribute disabled of <#nsnButton> equals "true". Element does not have a disabled attribute. - expected "true" but got: "null"

other test that fails is

.getCssProperty('#SearchInput-inner', 'border-color', function(result) {
                this.verify.equal(result.value, '#ee0000');
            })

Error I get is Failed [equal]: ('rgb(238, 0, 0)' == '#ee0000') - expected "#ee0000" but got: "rgb(238, 0, 0)"

How Can I handle this situation where same test works for ie and chrome but fails for phantomjs.

Thanks

user557657
  • 856
  • 1
  • 12
  • 35
  • 1
    Are these tests dependent on other tests which fail? For example, you have a test that clicks an element to display the `#nsnButton` button and it fails, so the `#nsnButton` button isn't present. – Brett DeWoody Mar 07 '17 at 22:57
  • @BrettDeWoody no they are not dependent on other. `#nsnButton` is present but its `disabled` property is not present. As I mentioned above same test passes in every browser except phantom. – user557657 Mar 08 '17 at 14:03

0 Answers0