I have 2 variables that get the texts: locationDisplayed
and bindisplayed
.
I want the 3rd variable: expectedDescription
concats the text of the first 2 vars.
Here is the code:
let locationDisplayed = element(by.css('.badge-primary')).getText().then(function (text) {
}); //location to be compared with Destination field
let bindisplayed = element(by.css('.badge-info')).getText().then(function (text) {
}); //bin to be compared with Destination field
let expectedDescription = locationDisplayed + " "+bindisplayed;
expectedDescription.getText().then(function(text){
console.log(text);
});
But then I got: expectedDescription.getText is not a function
.
Anyone knows how can I concat 2 strings, and get the string of this concatenation?