expect to test url #fragment with protractor and jasmine
<p>I'm trying to use protractor (with jasmine) to do some functional tests for my web application, and one of problem I came across is:</p>

<p><strong>how to check what is the current hash (#fragment) in my url?</strong></p>

<p>for example using, <code>browser.get('/')</code> it should navigate to <code>http://localhost:8000/#/</code> url ... where <code>#/</code> is the url #fragment (the hash) that is used by angular when html5 mode is not enabled.</p>

<p>the <code>browser.getCurrentUrl()</code> will return the absolute url since <code>http://</code> and not just the fragment which I want to test.</p>

<p>is there a way to test this case in a correct way?</p>

<p>I would expect to do something like this:</p>

<pre class="lang-js prettyprint-override"><code>browser.get('/');
expect(browser.getCurrentUrlFragment()).toBe('#/');

browser.get('/user/');
expect(browser.getCurrentUrlFragment()).toBe('#/user');
</code></pre>

<p>is that possible?</p>

<p>thank you.</p>