Skip to content

Commit

Permalink
fixed alert expectations, removed q= expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
bkimminich committed Oct 27, 2014
1 parent e52165f commit 70f414c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions test/e2e/searchSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ describe('search', function () {

element(by.id('searchButton')).click();

expect(browser.getLocationAbsUrl()).toMatch(/\/search\?q=Apple/);
var productNames = element.all(by.repeater('product in products').column('name'));
expect(productNames.first().getText()).toMatch(/Apple/);
});
Expand All @@ -27,17 +26,15 @@ describe('search', function () {

element(by.id('searchButton')).click();

expect(browser.getLocationAbsUrl()).toMatch(/\/search\?q=hand-picked/);
var productDescriptions = element.all(by.repeater('product in products').column('description'));
expect(productDescriptions.first().getText()).toMatch(/hand-picked/);
});

xit('search query should be susceptible to XSS attacks', function () {
it('search query should be susceptible to XSS attacks', function () {
element(by.model('searchQuery')).sendKeys('<script>alert("XSS1")</script>');

element(by.id('searchButton')).click();

expect(browser.getLocationAbsUrl()).toMatch(/\/search\?q=<script>alert("XSS1")<\/script>/);
browser.switchTo().alert().then(function (alert) {
expect(alert.getText()).toEqual('XSS1');
alert.accept();
Expand Down

0 comments on commit 70f414c

Please sign in to comment.