{"action":"created","comment":{"url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments/53475028","id":53475028,"diff_hunk":"@@ -210,20 +210,61 @@ public void clickVisibilityOptionForResponseCommentAndSave(String idString, int\n         ThreadHelper.waitFor(1000);\n     }\n \n-    public boolean verifyAllResultsPanelBodyVisibility(boolean visible) {\n-        int numOfQns = browser.driver.findElements(By.cssSelector(\".panel-heading+.panel-collapse\")).size();\n-        assertTrue(numOfQns > 0);\n-\n-        // Wait for the total duration according to the number of collapse/expand intervals between questions\n-        ThreadHelper.waitFor((numOfQns * 50) + 1000);\n+    /**\n+     * Checks if the body of all the result panels are visible\n+     * @return true if all result panel body are visible\n+     */\n+    public boolean areResultsVisible() {\n+        return isAllResultsPanelBodyVisibilityEquals(true);\n+    }\n \n-        for (WebElement e : browser.driver.findElements(By.cssSelector(\".panel-heading+.panel-collapse\"))) {\n-            if (e.isDisplayed() != visible) {\n+    /**\n+     * Checks if the body of all the result panels are hidden\n+     * @return true if all result panel body are hidden\n+     */\n+    public boolean areResultsHidden() {\n+        return isAllResultsPanelBodyVisibilityEquals(false);\n+    }\n+    \n+    /**\n+     * Checks if the body of all the results panels are collapsed or expanded.\n+     * @param isVisible true to check for expanded, false to check for collapsed.\n+     * @return true if all results panel body are equals to the visibility being checked.\n+     */\n+    private boolean isAllResultsPanelBodyVisibilityEquals(boolean isVisible) {\n+        By panelCollapseSelector = By.cssSelector(\".panel-heading+.panel-collapse\");\n+        List<WebElement> webElements = browser.driver.findElements(panelCollapseSelector);\n+        int numOfQns = webElements.size();\n+        \n+        assertTrue(numOfQns > 0);\n+        \n+        for (WebElement e : webElements) {\n+            if (e.isDisplayed() != isVisible) {\n                 return false;\n             }\n         }\n+        \n         return true;\n     }\n+    \n+    /**\n+     * Method to wait for all the panels to collapse.\n+     */    \n+    public void waitForPanelsToCollapse() {\n+        List<WebElement> panelBodies = browser.driver.findElements(By.cssSelector(\"div[id^='panelBodyCollapse-']\"));\n+        waitForElementsVisibility(panelBodies);\n+        ThreadHelper.waitFor(1000);","path":"src/test/java/teammates/test/pageobjects/InstructorFeedbackResultsPage.java","position":55,"original_position":55,"commit_id":"ab14f2a8a4b96e217787415888a6db13a7c30592","original_commit_id":"ab14f2a8a4b96e217787415888a6db13a7c30592","user":{"login":"kanghj","id":2216119,"avatar_url":"https://avatars.githubusercontent.com/u/2216119?v=3","gravatar_id":"","url":"https://api.github.com/users/kanghj","html_url":"https://github.com/kanghj","followers_url":"https://api.github.com/users/kanghj/followers","following_url":"https://api.github.com/users/kanghj/following{/other_user}","gists_url":"https://api.github.com/users/kanghj/gists{/gist_id}","starred_url":"https://api.github.com/users/kanghj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kanghj/subscriptions","organizations_url":"https://api.github.com/users/kanghj/orgs","repos_url":"https://api.github.com/users/kanghj/repos","events_url":"https://api.github.com/users/kanghj/events{/privacy}","received_events_url":"https://api.github.com/users/kanghj/received_events","type":"User","site_admin":false},"body":":D","created_at":"2016-02-19T15:35:27Z","updated_at":"2016-02-19T15:35:27Z","html_url":"https://github.com/TEAMMATES/teammates/pull/4795#discussion_r53475028","pull_request_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/4795","_links":{"self":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments/53475028"},"html":{"href":"https://github.com/TEAMMATES/teammates/pull/4795#discussion_r53475028"},"pull_request":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/4795"}}},"pull_request":{"url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/4795","id":59842359,"html_url":"https://github.com/TEAMMATES/teammates/pull/4795","diff_url":"https://github.com/TEAMMATES/teammates/pull/4795.diff","patch_url":"https://github.com/TEAMMATES/teammates/pull/4795.patch","issue_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/4795","number":4795,"state":"open","locked":false,"title":"Wait until element appear / disappear as opposed to a fixed delay in InstructorFeedbackResultsPage #4720","user":{"login":"kennho","id":10682388,"avatar_url":"https://avatars.githubusercontent.com/u/10682388?v=3","gravatar_id":"","url":"https://api.github.com/users/kennho","html_url":"https://github.com/kennho","followers_url":"https://api.github.com/users/kennho/followers","following_url":"https://api.github.com/users/kennho/following{/other_user}","gists_url":"https://api.github.com/users/kennho/gists{/gist_id}","starred_url":"https://api.github.com/users/kennho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennho/subscriptions","organizations_url":"https://api.github.com/users/kennho/orgs","repos_url":"https://api.github.com/users/kennho/repos","events_url":"https://api.github.com/users/kennho/events{/privacy}","received_events_url":"https://api.github.com/users/kennho/received_events","type":"User","site_admin":false},"body":"Fixes #4720","created_at":"2016-02-18T18:30:43Z","updated_at":"2016-02-19T15:35:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fe012764eca1c7f78216d077f69daa16a307a968","assignee":{"login":"wkurniawan07","id":7261051,"avatar_url":"https://avatars.githubusercontent.com/u/7261051?v=3","gravatar_id":"","url":"https://api.github.com/users/wkurniawan07","html_url":"https://github.com/wkurniawan07","followers_url":"https://api.github.com/users/wkurniawan07/followers","following_url":"https://api.github.com/users/wkurniawan07/following{/other_user}","gists_url":"https://api.github.com/users/wkurniawan07/gists{/gist_id}","starred_url":"https://api.github.com/users/wkurniawan07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wkurniawan07/subscriptions","organizations_url":"https://api.github.com/users/wkurniawan07/orgs","repos_url":"https://api.github.com/users/wkurniawan07/repos","events_url":"https://api.github.com/users/wkurniawan07/events{/privacy}","received_events_url":"https://api.github.com/users/wkurniawan07/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/4795/commits","review_comments_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/4795/comments","review_comment_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/4795/comments","statuses_url":"https://api.github.com/repos/TEAMMATES/teammates/statuses/ab14f2a8a4b96e217787415888a6db13a7c30592","head":{"label":"nus-fboa2016-TM:4720-wait-for-element-visibility-in-tests","ref":"4720-wait-for-element-visibility-in-tests","sha":"ab14f2a8a4b96e217787415888a6db13a7c30592","user":{"login":"nus-fboa2016-TM","id":16642227,"avatar_url":"https://avatars.githubusercontent.com/u/16642227?v=3","gravatar_id":"","url":"https://api.github.com/users/nus-fboa2016-TM","html_url":"https://github.com/nus-fboa2016-TM","followers_url":"https://api.github.com/users/nus-fboa2016-TM/followers","following_url":"https://api.github.com/users/nus-fboa2016-TM/following{/other_user}","gists_url":"https://api.github.com/users/nus-fboa2016-TM/gists{/gist_id}","starred_url":"https://api.github.com/users/nus-fboa2016-TM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nus-fboa2016-TM/subscriptions","organizations_url":"https://api.github.com/users/nus-fboa2016-TM/orgs","repos_url":"https://api.github.com/users/nus-fboa2016-TM/repos","events_url":"https://api.github.com/users/nus-fboa2016-TM/events{/privacy}","received_events_url":"https://api.github.com/users/nus-fboa2016-TM/received_events","type":"Organization","site_admin":false},"repo":{"id":49403164,"name":"repo","full_name":"nus-fboa2016-TM/repo","owner":{"login":"nus-fboa2016-TM","id":16642227,"avatar_url":"https://avatars.githubusercontent.com/u/16642227?v=3","gravatar_id":"","url":"https://api.github.com/users/nus-fboa2016-TM","html_url":"https://github.com/nus-fboa2016-TM","followers_url":"https://api.github.com/users/nus-fboa2016-TM/followers","following_url":"https://api.github.com/users/nus-fboa2016-TM/following{/other_user}","gists_url":"https://api.github.com/users/nus-fboa2016-TM/gists{/gist_id}","starred_url":"https://api.github.com/users/nus-fboa2016-TM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nus-fboa2016-TM/subscriptions","organizations_url":"https://api.github.com/users/nus-fboa2016-TM/orgs","repos_url":"https://api.github.com/users/nus-fboa2016-TM/repos","events_url":"https://api.github.com/users/nus-fboa2016-TM/events{/privacy}","received_events_url":"https://api.github.com/users/nus-fboa2016-TM/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nus-fboa2016-TM/repo","description":"This is the project website for the TEAMMATES feedback management tool for education","fork":true,"url":"https://api.github.com/repos/nus-fboa2016-TM/repo","forks_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/forks","keys_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/teams","hooks_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/hooks","issue_events_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/issues/events{/number}","events_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/events","assignees_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/assignees{/user}","branches_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/branches{/branch}","tags_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/tags","blobs_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/git/refs{/sha}","trees_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/statuses/{sha}","languages_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/languages","stargazers_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/stargazers","contributors_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/contributors","subscribers_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/subscribers","subscription_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/subscription","commits_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/commits{/sha}","git_commits_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/git/commits{/sha}","comments_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/comments{/number}","issue_comment_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/issues/comments{/number}","contents_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/contents/{+path}","compare_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/merges","archive_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/downloads","issues_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/issues{/number}","pulls_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/pulls{/number}","milestones_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/milestones{/number}","notifications_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/labels{/name}","releases_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/releases{/id}","deployments_url":"https://api.github.com/repos/nus-fboa2016-TM/repo/deployments","created_at":"2016-01-11T05:00:54Z","updated_at":"2016-01-11T05:01:00Z","pushed_at":"2016-02-19T13:12:44Z","git_url":"git://github.com/nus-fboa2016-TM/repo.git","ssh_url":"git@github.com:nus-fboa2016-TM/repo.git","clone_url":"https://github.com/nus-fboa2016-TM/repo.git","svn_url":"https://github.com/nus-fboa2016-TM/repo","homepage":"http://teammatesv4.appspot.com/","size":138181,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"TEAMMATES:master","ref":"master","sha":"f513ab9b70d70ead0dbfbb2922b1956c2116c726","user":{"login":"TEAMMATES","id":7374810,"avatar_url":"https://avatars.githubusercontent.com/u/7374810?v=3","gravatar_id":"","url":"https://api.github.com/users/TEAMMATES","html_url":"https://github.com/TEAMMATES","followers_url":"https://api.github.com/users/TEAMMATES/followers","following_url":"https://api.github.com/users/TEAMMATES/following{/other_user}","gists_url":"https://api.github.com/users/TEAMMATES/gists{/gist_id}","starred_url":"https://api.github.com/users/TEAMMATES/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TEAMMATES/subscriptions","organizations_url":"https://api.github.com/users/TEAMMATES/orgs","repos_url":"https://api.github.com/users/TEAMMATES/repos","events_url":"https://api.github.com/users/TEAMMATES/events{/privacy}","received_events_url":"https://api.github.com/users/TEAMMATES/received_events","type":"Organization","site_admin":false},"repo":{"id":19369035,"name":"teammates","full_name":"TEAMMATES/teammates","owner":{"login":"TEAMMATES","id":7374810,"avatar_url":"https://avatars.githubusercontent.com/u/7374810?v=3","gravatar_id":"","url":"https://api.github.com/users/TEAMMATES","html_url":"https://github.com/TEAMMATES","followers_url":"https://api.github.com/users/TEAMMATES/followers","following_url":"https://api.github.com/users/TEAMMATES/following{/other_user}","gists_url":"https://api.github.com/users/TEAMMATES/gists{/gist_id}","starred_url":"https://api.github.com/users/TEAMMATES/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TEAMMATES/subscriptions","organizations_url":"https://api.github.com/users/TEAMMATES/orgs","repos_url":"https://api.github.com/users/TEAMMATES/repos","events_url":"https://api.github.com/users/TEAMMATES/events{/privacy}","received_events_url":"https://api.github.com/users/TEAMMATES/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TEAMMATES/teammates","description":"This is the project website for the TEAMMATES feedback management tool for education","fork":false,"url":"https://api.github.com/repos/TEAMMATES/teammates","forks_url":"https://api.github.com/repos/TEAMMATES/teammates/forks","keys_url":"https://api.github.com/repos/TEAMMATES/teammates/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TEAMMATES/teammates/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TEAMMATES/teammates/teams","hooks_url":"https://api.github.com/repos/TEAMMATES/teammates/hooks","issue_events_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/events{/number}","events_url":"https://api.github.com/repos/TEAMMATES/teammates/events","assignees_url":"https://api.github.com/repos/TEAMMATES/teammates/assignees{/user}","branches_url":"https://api.github.com/repos/TEAMMATES/teammates/branches{/branch}","tags_url":"https://api.github.com/repos/TEAMMATES/teammates/tags","blobs_url":"https://api.github.com/repos/TEAMMATES/teammates/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TEAMMATES/teammates/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TEAMMATES/teammates/git/refs{/sha}","trees_url":"https://api.github.com/repos/TEAMMATES/teammates/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TEAMMATES/teammates/statuses/{sha}","languages_url":"https://api.github.com/repos/TEAMMATES/teammates/languages","stargazers_url":"https://api.github.com/repos/TEAMMATES/teammates/stargazers","contributors_url":"https://api.github.com/repos/TEAMMATES/teammates/contributors","subscribers_url":"https://api.github.com/repos/TEAMMATES/teammates/subscribers","subscription_url":"https://api.github.com/repos/TEAMMATES/teammates/subscription","commits_url":"https://api.github.com/repos/TEAMMATES/teammates/commits{/sha}","git_commits_url":"https://api.github.com/repos/TEAMMATES/teammates/git/commits{/sha}","comments_url":"https://api.github.com/repos/TEAMMATES/teammates/comments{/number}","issue_comment_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/comments{/number}","contents_url":"https://api.github.com/repos/TEAMMATES/teammates/contents/{+path}","compare_url":"https://api.github.com/repos/TEAMMATES/teammates/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TEAMMATES/teammates/merges","archive_url":"https://api.github.com/repos/TEAMMATES/teammates/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TEAMMATES/teammates/downloads","issues_url":"https://api.github.com/repos/TEAMMATES/teammates/issues{/number}","pulls_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls{/number}","milestones_url":"https://api.github.com/repos/TEAMMATES/teammates/milestones{/number}","notifications_url":"https://api.github.com/repos/TEAMMATES/teammates/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TEAMMATES/teammates/labels{/name}","releases_url":"https://api.github.com/repos/TEAMMATES/teammates/releases{/id}","deployments_url":"https://api.github.com/repos/TEAMMATES/teammates/deployments","created_at":"2014-05-02T07:43:00Z","updated_at":"2016-02-19T13:54:25Z","pushed_at":"2016-02-19T13:31:45Z","git_url":"git://github.com/TEAMMATES/teammates.git","ssh_url":"git@github.com:TEAMMATES/teammates.git","clone_url":"https://github.com/TEAMMATES/teammates.git","svn_url":"https://github.com/TEAMMATES/teammates","homepage":"http://teammatesv4.appspot.com/","size":141059,"stargazers_count":63,"watchers_count":63,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":160,"mirror_url":null,"open_issues_count":496,"forks":160,"open_issues":496,"watchers":63,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/4795"},"html":{"href":"https://github.com/TEAMMATES/teammates/pull/4795"},"issue":{"href":"https://api.github.com/repos/TEAMMATES/teammates/issues/4795"},"comments":{"href":"https://api.github.com/repos/TEAMMATES/teammates/issues/4795/comments"},"review_comments":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/4795/comments"},"review_comment":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/4795/commits"},"statuses":{"href":"https://api.github.com/repos/TEAMMATES/teammates/statuses/ab14f2a8a4b96e217787415888a6db13a7c30592"}}}}