Q:

Protractor: One test passes, but the other fails

I want to check two things - whether the search functionality works on AskJeeves AND whether the search boxes stored the right string.
To check this I run three expect statements:
expect(searched_term.getText()).toEqual('Baking a Cake without Margarine');
expect(searched_term.getText()).toEqual('Baking a Pie without Butter');
expect(searched_term.getText()).toEqual(search_box.getText());

Only the second one should fail. But the first one fails as well. Why is that? Here is the error log. Also how can I count how many expect statements I have and console.log() output that?
Error Log:

browser.waitForAngularEnabled(false);
describe('Enter Search Query in Ask Jeeves', function() {
    it('This will insert a query', function() {
        browser.get(browser.baseUrl);

        element(by.xpath('//*[@id="search-box"]'));
        var search_box = element(by.name("q")).sendKeys('Baking a Cake without Margarine');
        browser.pause(1500);

        var button = element(by.xpath('//*[@id="sbut"]'));
        button.click();
        var searched_term = element(by.name("q"));

        expect(searched_term.getText()).toEqual('Baking a Cake without Margarine');
        expect(searched_term.getText()).toEqual('Baking a Pie without Butter');
        expect(searched_term.getText()).toEqual(search_box.getText());
        // This expect statement checks if the term in the following page reflects the term originally searched.
        // In addition this will check functionality of the search engine.

        browser.pause(1500);
    });
});

A:

The searched_term element is an input element - it does not have a "text" and the value of the input is stored in the value attribute. Replace getText() with getAttribute("value"):
expect(searched_term.getAttribute("value")).toEqual('Baking a Cake without Margarine');

