Having trouble understanding why it's returning an object instead of the text value, here is some test code:
describe('columns swap', function () {
describe('location column ', function () {
it('should swap right', function () {
browser.sleep(10000);
var fColumn = element(by.xpath('(//*[@class="k-link"])[2]')).getText();
console.log(fColumn);
Console output:
> columns swap
> location column { ptor_: { controlFlow: [Function],
> schedule: [Function],
> getSession: [Function],
> getCapabilities: [Function],
> quit: [Function],
> actions: [Function],
> executeScript: [Function],
> executeAsyncScript: [Function],
> call: [Function],
> wait: [Function],
> sleep: [Function],
> getWindowHandle: [Function],
> getAllWindowHandles: [Function],
> getPageSource: [Function],
> close: [Function],
> getCurrentUrl: [Function], ...
Also when using this part with expect():
expect(columnSorting.acpColumn.getText()).to.eventually.equal(fColumn);
I see:
1) columns swap location column should swap right:
AssertionError: expected 'Location' to equal { Object (ptor_, parentElement
ArrayFinder, ...) }
So for some reason I can't get the text from expect and it is correct - 'Location'
What am I doing wrong?