Unable to understand why it return an object not a value of text, 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 if I use 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 get text from expect and it correct - 'Location'
What im doing wrong?