I need to validate the color of a email link text . Below is my code:
it('Contact Text Validation', function(){
expect (Contact_info_on_Login_screen.isDisplayed())
var Email_Link = element(by.css("body > app-root > app-login > div > div > div > div > div > div.card-header.py-3.d-flex.justify-content-between.align-items-center > div > p > a:nth-child(1) > span:nth-child(1)"));
var Col_Email = (Email_Link.getCssValue('color')).then(function(){
browser.sleep(2000).then(function(){
console.log(" The color for Email Link is :" + Col_Email);
});
});
}
The color of the same element is as shown in the css property is as below.
the related html code is <p _ngcontent-c1="" class="m-4"> Questions about filling in the report data or access to the application, please call <a _ngcontent-c1="" class="text-link-blue" href=""><span _ngcontent-c1="">Admin</span> / <span _ngcontent-c1=""> Manager</span></a> at <a _ngcontent-c1="" class="text-link-blue" href=""> 123-456-7890</a>. For software issues, email <a _ngcontent-c1="" class="text-link-blue" href="">other person</a> . </p>
When I run this , I got the following output from Protractor:
[13:58:52] I/hosted - Using the selenium server at http://localhost:4444/wd/hub Started The color for Email Link is :ManagedPromise::643 {[[PromiseStatus]]: "pending"}
I am not sure what I am doing wrong. It should return the color code, instead it shows that the promise is pending.