{"action":"created","comment":{"url":"https://api.github.com/repos/Wikia/selenium-tests/pulls/comments/65579656","id":65579656,"diff_hunk":"@@ -0,0 +1,89 @@\n+package com.wikia.webdriver.elements.mercury.pages;\n+\n+import com.wikia.webdriver.common.contentpatterns.URLsContent;\n+import com.wikia.webdriver.common.logging.PageObjectLogging;\n+import com.wikia.webdriver.elements.mercury.components.Loading;\n+import com.wikia.webdriver.elements.mercury.components.Search;\n+import com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject;\n+\n+import lombok.Getter;\n+import org.openqa.selenium.By;\n+import org.openqa.selenium.NoSuchElementException;\n+import org.openqa.selenium.TimeoutException;\n+import org.openqa.selenium.WebElement;\n+import org.openqa.selenium.support.FindBy;\n+\n+public class SearchResultsPage extends WikiBasePageObject {\n+  @FindBy(css = \".search-results\")\n+  private WebElement searchResultsContainer;\n+\n+  @FindBy(css = \".search-error-not-found\")\n+  private WebElement noResultsContainer;\n+\n+  @FindBy(css = \".search-error-not-found__action\")\n+  private WebElement tryAnotherSearchLink;\n+\n+  @Getter\n+  private final Search search = new Search();\n+\n+  private static final String searchResultClass = \".search-results__list .wikia-card > a\";\n+\n+  public SearchResultsPage openForQuery(String query) {\n+    getUrl(String.format(\"%s%s\", urlBuilder.getUrlForWiki(),\n+                         URLsContent.MOBILE_SEARCH_RESULTS_PAGE.replace(\"%query%\", query)));\n+\n+    return this;\n+  }\n+\n+  public String selectSearchResult(int index) {\n+    Loading loading = new Loading(driver);\n+    String clickedLink;\n+\n+    PageObjectLogging.logInfo(\"Select search result no.: \" + index);\n+    WebElement searchResult = driver.findElements(By.cssSelector(searchResultClass)).get(index);\n+    wait.forElementClickable(searchResult);\n+\n+    clickedLink = searchResult.getAttribute(\"href\");\n+\n+    searchResult.click();\n+    loading.handleAsyncPageReload();\n+\n+    return clickedLink;\n+  }\n+\n+  public SearchResultsPage clickTryAnotherSearch() {\n+    wait.forElementClickable(this.tryAnotherSearchLink).click();\n+    return this;\n+  }\n+\n+  public boolean isSearchResultsPageOpen() {\n+    try {\n+      wait.forElementVisible(searchResultsContainer);\n+      return true;\n+    } catch (NoSuchElementException e) {\n+      return false;\n+    }\n+  }\n+\n+  public boolean isNoResultsPagePresent() {\n+    try {\n+      wait.forElementVisible(noResultsContainer, 0);\n+      return true;\n+    } catch (NoSuchElementException e) {\n+      return false;\n+    } catch (TimeoutException e) {","path":"src/test/java/com/wikia/webdriver/elements/mercury/pages/SearchResultsPage.java","position":74,"original_position":74,"commit_id":"19c5c447128daf9541d456ff037aee6670cc907d","original_commit_id":"19c5c447128daf9541d456ff037aee6670cc907d","user":{"login":"WikiaTech","id":13279985,"avatar_url":"https://avatars.githubusercontent.com/u/13279985?v=3","gravatar_id":"","url":"https://api.github.com/users/WikiaTech","html_url":"https://github.com/WikiaTech","followers_url":"https://api.github.com/users/WikiaTech/followers","following_url":"https://api.github.com/users/WikiaTech/following{/other_user}","gists_url":"https://api.github.com/users/WikiaTech/gists{/gist_id}","starred_url":"https://api.github.com/users/WikiaTech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WikiaTech/subscriptions","organizations_url":"https://api.github.com/users/WikiaTech/orgs","repos_url":"https://api.github.com/users/WikiaTech/repos","events_url":"https://api.github.com/users/WikiaTech/events{/privacy}","received_events_url":"https://api.github.com/users/WikiaTech/received_events","type":"User","site_admin":false},"body":"![MAJOR](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/severity-major.png) Either log or rethrow this exception. [![rule](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/rule.png)](http://sonar-s1/coding_rules#rule_key=squid%3AS1166)\n","created_at":"2016-06-02T17:08:31Z","updated_at":"2016-06-02T17:08:31Z","html_url":"https://github.com/Wikia/selenium-tests/pull/1231#discussion_r65579656","pull_request_url":"https://api.github.com/repos/Wikia/selenium-tests/pulls/1231","_links":{"self":{"href":"https://api.github.com/repos/Wikia/selenium-tests/pulls/comments/65579656"},"html":{"href":"https://github.com/Wikia/selenium-tests/pull/1231#discussion_r65579656"},"pull_request":{"href":"https://api.github.com/repos/Wikia/selenium-tests/pulls/1231"}}},"pull_request":{"url":"https://api.github.com/repos/Wikia/selenium-tests/pulls/1231","id":71717308,"html_url":"https://github.com/Wikia/selenium-tests/pull/1231","diff_url":"https://github.com/Wikia/selenium-tests/pull/1231.diff","patch_url":"https://github.com/Wikia/selenium-tests/pull/1231.patch","issue_url":"https://api.github.com/repos/Wikia/selenium-tests/issues/1231","number":1231,"state":"open","locked":false,"title":"DAT-4199 Tests for search functionality on Mercury and Search Results Page","user":{"login":"SebastianMarzjan","id":2051084,"avatar_url":"https://avatars.githubusercontent.com/u/2051084?v=3","gravatar_id":"","url":"https://api.github.com/users/SebastianMarzjan","html_url":"https://github.com/SebastianMarzjan","followers_url":"https://api.github.com/users/SebastianMarzjan/followers","following_url":"https://api.github.com/users/SebastianMarzjan/following{/other_user}","gists_url":"https://api.github.com/users/SebastianMarzjan/gists{/gist_id}","starred_url":"https://api.github.com/users/SebastianMarzjan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SebastianMarzjan/subscriptions","organizations_url":"https://api.github.com/users/SebastianMarzjan/orgs","repos_url":"https://api.github.com/users/SebastianMarzjan/repos","events_url":"https://api.github.com/users/SebastianMarzjan/events{/privacy}","received_events_url":"https://api.github.com/users/SebastianMarzjan/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-27T13:59:22Z","updated_at":"2016-06-02T17:08:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4485f36dfce2e0a57f86a0d3ddb88a03259dbfc4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Wikia/selenium-tests/pulls/1231/commits","review_comments_url":"https://api.github.com/repos/Wikia/selenium-tests/pulls/1231/comments","review_comment_url":"https://api.github.com/repos/Wikia/selenium-tests/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wikia/selenium-tests/issues/1231/comments","statuses_url":"https://api.github.com/repos/Wikia/selenium-tests/statuses/19c5c447128daf9541d456ff037aee6670cc907d","head":{"label":"Wikia:DAT-4199","ref":"DAT-4199","sha":"19c5c447128daf9541d456ff037aee6670cc907d","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":6275065,"name":"selenium-tests","full_name":"Wikia/selenium-tests","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/selenium-tests","description":"","fork":false,"url":"https://api.github.com/repos/Wikia/selenium-tests","forks_url":"https://api.github.com/repos/Wikia/selenium-tests/forks","keys_url":"https://api.github.com/repos/Wikia/selenium-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/selenium-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/selenium-tests/teams","hooks_url":"https://api.github.com/repos/Wikia/selenium-tests/hooks","issue_events_url":"https://api.github.com/repos/Wikia/selenium-tests/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/selenium-tests/events","assignees_url":"https://api.github.com/repos/Wikia/selenium-tests/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/selenium-tests/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/selenium-tests/tags","blobs_url":"https://api.github.com/repos/Wikia/selenium-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/selenium-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/selenium-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/selenium-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/selenium-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/selenium-tests/languages","stargazers_url":"https://api.github.com/repos/Wikia/selenium-tests/stargazers","contributors_url":"https://api.github.com/repos/Wikia/selenium-tests/contributors","subscribers_url":"https://api.github.com/repos/Wikia/selenium-tests/subscribers","subscription_url":"https://api.github.com/repos/Wikia/selenium-tests/subscription","commits_url":"https://api.github.com/repos/Wikia/selenium-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/selenium-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/selenium-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/selenium-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/selenium-tests/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/selenium-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/selenium-tests/merges","archive_url":"https://api.github.com/repos/Wikia/selenium-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/selenium-tests/downloads","issues_url":"https://api.github.com/repos/Wikia/selenium-tests/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/selenium-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/selenium-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/selenium-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/selenium-tests/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/selenium-tests/releases{/id}","deployments_url":"https://api.github.com/repos/Wikia/selenium-tests/deployments","created_at":"2012-10-18T08:06:11Z","updated_at":"2016-05-19T05:36:25Z","pushed_at":"2016-06-02T17:06:19Z","git_url":"git://github.com/Wikia/selenium-tests.git","ssh_url":"git@github.com:Wikia/selenium-tests.git","clone_url":"https://github.com/Wikia/selenium-tests.git","svn_url":"https://github.com/Wikia/selenium-tests","homepage":null,"size":131980,"stargazers_count":15,"watchers_count":15,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":4,"forks":13,"open_issues":4,"watchers":15,"default_branch":"master"}},"base":{"label":"Wikia:master","ref":"master","sha":"5bcb8cae0c5c08f67955e532b3847401c1bc43ca","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":6275065,"name":"selenium-tests","full_name":"Wikia/selenium-tests","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/selenium-tests","description":"","fork":false,"url":"https://api.github.com/repos/Wikia/selenium-tests","forks_url":"https://api.github.com/repos/Wikia/selenium-tests/forks","keys_url":"https://api.github.com/repos/Wikia/selenium-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/selenium-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/selenium-tests/teams","hooks_url":"https://api.github.com/repos/Wikia/selenium-tests/hooks","issue_events_url":"https://api.github.com/repos/Wikia/selenium-tests/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/selenium-tests/events","assignees_url":"https://api.github.com/repos/Wikia/selenium-tests/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/selenium-tests/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/selenium-tests/tags","blobs_url":"https://api.github.com/repos/Wikia/selenium-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/selenium-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/selenium-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/selenium-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/selenium-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/selenium-tests/languages","stargazers_url":"https://api.github.com/repos/Wikia/selenium-tests/stargazers","contributors_url":"https://api.github.com/repos/Wikia/selenium-tests/contributors","subscribers_url":"https://api.github.com/repos/Wikia/selenium-tests/subscribers","subscription_url":"https://api.github.com/repos/Wikia/selenium-tests/subscription","commits_url":"https://api.github.com/repos/Wikia/selenium-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/selenium-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/selenium-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/selenium-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/selenium-tests/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/selenium-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/selenium-tests/merges","archive_url":"https://api.github.com/repos/Wikia/selenium-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/selenium-tests/downloads","issues_url":"https://api.github.com/repos/Wikia/selenium-tests/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/selenium-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/selenium-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/selenium-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/selenium-tests/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/selenium-tests/releases{/id}","deployments_url":"https://api.github.com/repos/Wikia/selenium-tests/deployments","created_at":"2012-10-18T08:06:11Z","updated_at":"2016-05-19T05:36:25Z","pushed_at":"2016-06-02T17:06:19Z","git_url":"git://github.com/Wikia/selenium-tests.git","ssh_url":"git@github.com:Wikia/selenium-tests.git","clone_url":"https://github.com/Wikia/selenium-tests.git","svn_url":"https://github.com/Wikia/selenium-tests","homepage":null,"size":131980,"stargazers_count":15,"watchers_count":15,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":4,"forks":13,"open_issues":4,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Wikia/selenium-tests/pulls/1231"},"html":{"href":"https://github.com/Wikia/selenium-tests/pull/1231"},"issue":{"href":"https://api.github.com/repos/Wikia/selenium-tests/issues/1231"},"comments":{"href":"https://api.github.com/repos/Wikia/selenium-tests/issues/1231/comments"},"review_comments":{"href":"https://api.github.com/repos/Wikia/selenium-tests/pulls/1231/comments"},"review_comment":{"href":"https://api.github.com/repos/Wikia/selenium-tests/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wikia/selenium-tests/pulls/1231/commits"},"statuses":{"href":"https://api.github.com/repos/Wikia/selenium-tests/statuses/19c5c447128daf9541d456ff037aee6670cc907d"}}}}
{"actor":{"display_login":"WikiaTech"}}