I need to write an automated test (Protractor) for a chart. I proceeded as follows:
- Created an xpath that grabbed an array of HTML elements representing data points on the graph.
- Used elements.all(by.xpath...).then(...
- Inside 'then' created an array of promises via .getOuterHtml... Inside the same 'then' used q.all(...) to convert the array of new promises to the resolved array of Strings. Passed this array to a method that extracted x/y positions from outerHtml and returned them as an array of objects, each object having .x and .y properties.
- Confirmed that .x/.y properties of each object contain numbers and tries to run jasmine's expect(...) on each .y property ( I had expected values hard-coded)
- So... I am within outer "then" within Q.all().then(....). A call to jasmine's expect threw a null pointer error... An attempt to manually compare the values via if/else --> console.log threw [0211/144122:ERROR:gles2_cmd_decoder.cc(9368)] Context lost because PostSubBuffe r failed. [0211/144122:ERROR:gles2_cmd_decoder.cc(4638)] Error: 5 for Command kPostSubBuff erCHROMIUM
- Any idea what is going on? Thanks.