{"action":"created","comment":{"url":"https://api.github.com/repos/HubTurbo/addressbook/pulls/comments/72042867","id":72042867,"diff_hunk":"@@ -42,35 +45,116 @@ public void editPerson() {\n         editPersonDialog.enterNewValues(newAlice);\n         editPersonDialog.pressEnter();\n \n-        assertTrue(descOnFail(alicePersonCard, newAlice), alicePersonCard.isSamePerson(newAlice));\n-        //TODO: write a more elegant function that uses assertEquals but compare two different types of objects\n+        //Confirm pending state correctness\n+        assertTrue(alicePersonCard.isShowingGracePeriod(\"Editing\"));\n+\n+        //Confirm the right card is selected after the edit\n+        assertEquals(alicePersonCard, newAlice);\n+        assertTrue(personListPanel.isSelected(newAlice));\n \n-        //TODO: Confirm the right card is selected after the edit, as follows\n-        //assertEquals(1, personListPanel.getSelectedCards().size();\n-        //assertEquals(alicePersonCard, personListPanel.getSelectedCards().get(0);\n \n         //Confirm right values are displayed after grace period is over\n-        guiRobot.sleep(5000); //wait for grace period\n-        //TODO: link up to grace period\n-        //TODO: confirm the person card display behave as expected during grace period\n-        assertTrue(descOnFail(alicePersonCard, newAlice), alicePersonCard.isSamePerson(newAlice));\n+        sleepForGracePeriod();\n+        assertEquals(alicePersonCard, newAlice);\n \n         //Confirm the underlying person object has the right values\n         assertEquals(newAlice.toString(), personListPanel.getSelectedPerson().toString());\n \n-        //TODO: confirm again after the next sync\n-        //TODO: confirm other cards are unaffected\n-        //TODO: confirm the right card is selected after the edit\n-        //TODO: confirm status bar is updated correctly\n \n+        //Confirm again after the next sync\n+        sleep(getTestingConfig().getUpdateInterval(), TimeUnit.MILLISECONDS);\n+        assertEquals(newAlice.toString(), personListPanel.getSelectedPerson().toString());\n+\n+        //Confirm other cards are unaffected.\n+        personListPanel.clickOnListView();\n+        assertTrue(personListPanel.isListMatching(1, td.benson, td.charlie, td.dan, td.elizabeth));\n+\n+        //Confirm status bar is updated correctly\n+        assertEquals(statusBar.getText(), \"Edit Person [ Alice Brown -> Alicia Brownstone ] completed successfully.\");\n+    }\n+\n+    @Test\n+    public void editPerson_usingContextMenu() {\n+        personListPanel.rightClickOnPerson(td.alice);\n+        EditPersonDialogHandle editPersonDialog = personListPanel.clickOnContextMenu(\n+                PersonListPanelHandle.ContextMenuChoice.EDIT);\n+        assertTrue(editPersonDialog.isValidEditDialog());\n+    }\n+\n+    @Test\n+    public void editPerson_usingEditButton() {\n+        personListPanel.clickOnPerson(td.alice);\n+        EditPersonDialogHandle editPersonDialog =  personListPanel.clickEdit();\n+        assertTrue(editPersonDialog.isValidEditDialog());\n+    }\n+\n+    @Test\n+    public void editPerson_dataValidation() {\n+\n+        personListPanel.clickOnPerson(td.alice);\n+        EditPersonDialogHandle editPersonDialog =  personListPanel.clickEdit();\n+        editPersonDialog.enterFirstName(\"Peter\");\n+        editPersonDialog.enterLastName(\"\");\n+        editPersonDialog.clickOk();\n+\n+        assertTrue(editPersonDialog.isInputValidationErrorDialogShown());\n+        editPersonDialog.dissmissErrorMessage(\"Invalid Fields\");\n+        assertFalse(editPersonDialog.isInputValidationErrorDialogShown());\n     }\n \n-    /* TODO:\n-     * Test using 'Edit' context menu\n-     * Test using 'Edit' button\n-     * Test 'Cancel'\n-     * Test 'OK'\n-     * Test data validation (just one case)\n-     */\n+    @Test\n+    public void cancelOperation_usingAccelerator() {\n+\n+        //Delete\n+        PersonCardHandle aliceCard = personListPanel.selectCard(td.alice);\n+        personListPanel.use_PERSON_DELETE_ACCELERATOR();\n+        assertTrue(aliceCard.isShowingGracePeriod(\"Deleting\"));\n+\n+        personListPanel.use_PERSON_CHANGE_CANCEL_ACCELERATOR();\n+        assertFalse(aliceCard.isShowingGracePeriod(\"Deleting\"));\n+        assertEquals(statusBar.getText(), \"Delete Person [ \" + aliceCard.getFirstName() + \" \"\n+                     + aliceCard.getLastName() + \" ] was cancelled.\");\n+\n+        //Edit\n+        Person newAlice = new PersonBuilder(td.alice.copy()).withFirstName(\"Alicia\").withLastName(\"Brownstone\")\n+                .withStreet(\"Updated street\").withCity(\"Singapore\").withPostalCode(\"123123\")\n+                .withBirthday(\"01.01.1979\").withGithubUsername(\"alicebrown123\").withTags(td.colleagues, td.friends).build();\n+\n+        //Get a reference to the card displaying Alice's details\n+        PersonCardHandle alicePersonCard = personListPanel.selectCard(td.alice);\n+\n+        //Edit Alice to change to new values\n+        EditPersonDialogHandle editPersonDialog = personListPanel.use_PERSON_EDIT_ACCELERATOR();\n+        editPersonDialog.enterNewValues(newAlice);\n+        editPersonDialog.pressEnter();\n+\n+        personListPanel.clickOnPerson(newAlice);\n+        assertEquals(alicePersonCard, newAlice);\n+        personListPanel.use_PERSON_CHANGE_CANCEL_ACCELERATOR();\n+        assertEquals(alicePersonCard, td.alice);\n+        assertEquals(statusBar.getText(), \"Edit Person [ Alice Brown -> Alicia Brownstone ] was cancelled.\");\n+\n+        //New\n+        EditPersonDialogHandle addPersonDialog = personListPanel.clickNew();\n+        Person pandaWong = new PersonBuilder(\"Panda\", \"Wong\")\n+                .withStreet(\"Chengdu Panda Street\").withCity(\"Chengdu\").withPostalCode(\"PANDA\")\n+                .withBirthday(\"01.01.1979\").withGithubUsername(\"panda\").withTags(td.colleagues, td.friends).build();\n+        addPersonDialog.enterNewValues(pandaWong);\n+        addPersonDialog.clickOk();\n+\n+        personListPanel.clickOnListView(); // To ensure shortcut keys work properly.","path":"src/test/java/guitests/PersonEditGuiTest.java","position":152,"original_position":152,"commit_id":"86d8702f5944d1845fc49df9b3c14a7c9b76daa2","original_commit_id":"86d8702f5944d1845fc49df9b3c14a7c9b76daa2","user":{"login":"yl-coder","id":9070608,"avatar_url":"https://avatars.githubusercontent.com/u/9070608?v=3","gravatar_id":"","url":"https://api.github.com/users/yl-coder","html_url":"https://github.com/yl-coder","followers_url":"https://api.github.com/users/yl-coder/followers","following_url":"https://api.github.com/users/yl-coder/following{/other_user}","gists_url":"https://api.github.com/users/yl-coder/gists{/gist_id}","starred_url":"https://api.github.com/users/yl-coder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yl-coder/subscriptions","organizations_url":"https://api.github.com/users/yl-coder/orgs","repos_url":"https://api.github.com/users/yl-coder/repos","events_url":"https://api.github.com/users/yl-coder/events{/privacy}","received_events_url":"https://api.github.com/users/yl-coder/received_events","type":"User","site_admin":false},"body":"I think the problem was not on the focus. The listview was in focus before the failure. Clicking it just magically make it to work. I give it a shot.","created_at":"2016-07-25T10:43:30Z","updated_at":"2016-07-25T10:43:30Z","html_url":"https://github.com/HubTurbo/addressbook/pull/508#discussion_r72042867","pull_request_url":"https://api.github.com/repos/HubTurbo/addressbook/pulls/508","_links":{"self":{"href":"https://api.github.com/repos/HubTurbo/addressbook/pulls/comments/72042867"},"html":{"href":"https://github.com/HubTurbo/addressbook/pull/508#discussion_r72042867"},"pull_request":{"href":"https://api.github.com/repos/HubTurbo/addressbook/pulls/508"}}},"pull_request":{"url":"https://api.github.com/repos/HubTurbo/addressbook/pulls/508","id":77249385,"html_url":"https://github.com/HubTurbo/addressbook/pull/508","diff_url":"https://github.com/HubTurbo/addressbook/pull/508.diff","patch_url":"https://github.com/HubTurbo/addressbook/pull/508.patch","issue_url":"https://api.github.com/repos/HubTurbo/addressbook/issues/508","number":508,"state":"closed","locked":false,"title":"Finish PersonEditGuiTest and Gui Todos","user":{"login":"yl-coder","id":9070608,"avatar_url":"https://avatars.githubusercontent.com/u/9070608?v=3","gravatar_id":"","url":"https://api.github.com/users/yl-coder","html_url":"https://github.com/yl-coder","followers_url":"https://api.github.com/users/yl-coder/followers","following_url":"https://api.github.com/users/yl-coder/following{/other_user}","gists_url":"https://api.github.com/users/yl-coder/gists{/gist_id}","starred_url":"https://api.github.com/users/yl-coder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yl-coder/subscriptions","organizations_url":"https://api.github.com/users/yl-coder/orgs","repos_url":"https://api.github.com/users/yl-coder/repos","events_url":"https://api.github.com/users/yl-coder/events{/privacy}","received_events_url":"https://api.github.com/users/yl-coder/received_events","type":"User","site_admin":false},"body":"As per title","created_at":"2016-07-13T08:32:42Z","updated_at":"2016-07-25T10:43:30Z","closed_at":"2016-07-25T08:04:13Z","merged_at":"2016-07-25T08:04:13Z","merge_commit_sha":"5ee70a3ffe7c13392b7d754d5c258c36d8a5b5d1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/HubTurbo/addressbook/pulls/508/commits","review_comments_url":"https://api.github.com/repos/HubTurbo/addressbook/pulls/508/comments","review_comment_url":"https://api.github.com/repos/HubTurbo/addressbook/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HubTurbo/addressbook/issues/508/comments","statuses_url":"https://api.github.com/repos/HubTurbo/addressbook/statuses/86d8702f5944d1845fc49df9b3c14a7c9b76daa2","head":{"label":"HubTurbo:Finish-PersonEditGuiTset-and-gui-todos","ref":"Finish-PersonEditGuiTset-and-gui-todos","sha":"86d8702f5944d1845fc49df9b3c14a7c9b76daa2","user":{"login":"HubTurbo","id":7955871,"avatar_url":"https://avatars.githubusercontent.com/u/7955871?v=3","gravatar_id":"","url":"https://api.github.com/users/HubTurbo","html_url":"https://github.com/HubTurbo","followers_url":"https://api.github.com/users/HubTurbo/followers","following_url":"https://api.github.com/users/HubTurbo/following{/other_user}","gists_url":"https://api.github.com/users/HubTurbo/gists{/gist_id}","starred_url":"https://api.github.com/users/HubTurbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HubTurbo/subscriptions","organizations_url":"https://api.github.com/users/HubTurbo/orgs","repos_url":"https://api.github.com/users/HubTurbo/repos","events_url":"https://api.github.com/users/HubTurbo/events{/privacy}","received_events_url":"https://api.github.com/users/HubTurbo/received_events","type":"Organization","site_admin":false},"repo":{"id":58317461,"name":"addressbook","full_name":"HubTurbo/addressbook","owner":{"login":"HubTurbo","id":7955871,"avatar_url":"https://avatars.githubusercontent.com/u/7955871?v=3","gravatar_id":"","url":"https://api.github.com/users/HubTurbo","html_url":"https://github.com/HubTurbo","followers_url":"https://api.github.com/users/HubTurbo/followers","following_url":"https://api.github.com/users/HubTurbo/following{/other_user}","gists_url":"https://api.github.com/users/HubTurbo/gists{/gist_id}","starred_url":"https://api.github.com/users/HubTurbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HubTurbo/subscriptions","organizations_url":"https://api.github.com/users/HubTurbo/orgs","repos_url":"https://api.github.com/users/HubTurbo/repos","events_url":"https://api.github.com/users/HubTurbo/events{/privacy}","received_events_url":"https://api.github.com/users/HubTurbo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/HubTurbo/addressbook","description":"A small app for training and experimentation","fork":false,"url":"https://api.github.com/repos/HubTurbo/addressbook","forks_url":"https://api.github.com/repos/HubTurbo/addressbook/forks","keys_url":"https://api.github.com/repos/HubTurbo/addressbook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HubTurbo/addressbook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HubTurbo/addressbook/teams","hooks_url":"https://api.github.com/repos/HubTurbo/addressbook/hooks","issue_events_url":"https://api.github.com/repos/HubTurbo/addressbook/issues/events{/number}","events_url":"https://api.github.com/repos/HubTurbo/addressbook/events","assignees_url":"https://api.github.com/repos/HubTurbo/addressbook/assignees{/user}","branches_url":"https://api.github.com/repos/HubTurbo/addressbook/branches{/branch}","tags_url":"https://api.github.com/repos/HubTurbo/addressbook/tags","blobs_url":"https://api.github.com/repos/HubTurbo/addressbook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HubTurbo/addressbook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HubTurbo/addressbook/git/refs{/sha}","trees_url":"https://api.github.com/repos/HubTurbo/addressbook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HubTurbo/addressbook/statuses/{sha}","languages_url":"https://api.github.com/repos/HubTurbo/addressbook/languages","stargazers_url":"https://api.github.com/repos/HubTurbo/addressbook/stargazers","contributors_url":"https://api.github.com/repos/HubTurbo/addressbook/contributors","subscribers_url":"https://api.github.com/repos/HubTurbo/addressbook/subscribers","subscription_url":"https://api.github.com/repos/HubTurbo/addressbook/subscription","commits_url":"https://api.github.com/repos/HubTurbo/addressbook/commits{/sha}","git_commits_url":"https://api.github.com/repos/HubTurbo/addressbook/git/commits{/sha}","comments_url":"https://api.github.com/repos/HubTurbo/addressbook/comments{/number}","issue_comment_url":"https://api.github.com/repos/HubTurbo/addressbook/issues/comments{/number}","contents_url":"https://api.github.com/repos/HubTurbo/addressbook/contents/{+path}","compare_url":"https://api.github.com/repos/HubTurbo/addressbook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HubTurbo/addressbook/merges","archive_url":"https://api.github.com/repos/HubTurbo/addressbook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HubTurbo/addressbook/downloads","issues_url":"https://api.github.com/repos/HubTurbo/addressbook/issues{/number}","pulls_url":"https://api.github.com/repos/HubTurbo/addressbook/pulls{/number}","milestones_url":"https://api.github.com/repos/HubTurbo/addressbook/milestones{/number}","notifications_url":"https://api.github.com/repos/HubTurbo/addressbook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HubTurbo/addressbook/labels{/name}","releases_url":"https://api.github.com/repos/HubTurbo/addressbook/releases{/id}","deployments_url":"https://api.github.com/repos/HubTurbo/addressbook/deployments","created_at":"2016-05-08T15:05:27Z","updated_at":"2016-05-08T23:35:38Z","pushed_at":"2016-07-25T10:25:40Z","git_url":"git://github.com/HubTurbo/addressbook.git","ssh_url":"git@github.com:HubTurbo/addressbook.git","clone_url":"https://github.com/HubTurbo/addressbook.git","svn_url":"https://github.com/HubTurbo/addressbook","homepage":null,"size":4896,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":58,"forks":3,"open_issues":58,"watchers":1,"default_branch":"master"}},"base":{"label":"HubTurbo:master","ref":"master","sha":"201f3c5b05969a4f60f1d424f3d0c599f749932b","user":{"login":"HubTurbo","id":7955871,"avatar_url":"https://avatars.githubusercontent.com/u/7955871?v=3","gravatar_id":"","url":"https://api.github.com/users/HubTurbo","html_url":"https://github.com/HubTurbo","followers_url":"https://api.github.com/users/HubTurbo/followers","following_url":"https://api.github.com/users/HubTurbo/following{/other_user}","gists_url":"https://api.github.com/users/HubTurbo/gists{/gist_id}","starred_url":"https://api.github.com/users/HubTurbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HubTurbo/subscriptions","organizations_url":"https://api.github.com/users/HubTurbo/orgs","repos_url":"https://api.github.com/users/HubTurbo/repos","events_url":"https://api.github.com/users/HubTurbo/events{/privacy}","received_events_url":"https://api.github.com/users/HubTurbo/received_events","type":"Organization","site_admin":false},"repo":{"id":58317461,"name":"addressbook","full_name":"HubTurbo/addressbook","owner":{"login":"HubTurbo","id":7955871,"avatar_url":"https://avatars.githubusercontent.com/u/7955871?v=3","gravatar_id":"","url":"https://api.github.com/users/HubTurbo","html_url":"https://github.com/HubTurbo","followers_url":"https://api.github.com/users/HubTurbo/followers","following_url":"https://api.github.com/users/HubTurbo/following{/other_user}","gists_url":"https://api.github.com/users/HubTurbo/gists{/gist_id}","starred_url":"https://api.github.com/users/HubTurbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HubTurbo/subscriptions","organizations_url":"https://api.github.com/users/HubTurbo/orgs","repos_url":"https://api.github.com/users/HubTurbo/repos","events_url":"https://api.github.com/users/HubTurbo/events{/privacy}","received_events_url":"https://api.github.com/users/HubTurbo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/HubTurbo/addressbook","description":"A small app for training and experimentation","fork":false,"url":"https://api.github.com/repos/HubTurbo/addressbook","forks_url":"https://api.github.com/repos/HubTurbo/addressbook/forks","keys_url":"https://api.github.com/repos/HubTurbo/addressbook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HubTurbo/addressbook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HubTurbo/addressbook/teams","hooks_url":"https://api.github.com/repos/HubTurbo/addressbook/hooks","issue_events_url":"https://api.github.com/repos/HubTurbo/addressbook/issues/events{/number}","events_url":"https://api.github.com/repos/HubTurbo/addressbook/events","assignees_url":"https://api.github.com/repos/HubTurbo/addressbook/assignees{/user}","branches_url":"https://api.github.com/repos/HubTurbo/addressbook/branches{/branch}","tags_url":"https://api.github.com/repos/HubTurbo/addressbook/tags","blobs_url":"https://api.github.com/repos/HubTurbo/addressbook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HubTurbo/addressbook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HubTurbo/addressbook/git/refs{/sha}","trees_url":"https://api.github.com/repos/HubTurbo/addressbook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HubTurbo/addressbook/statuses/{sha}","languages_url":"https://api.github.com/repos/HubTurbo/addressbook/languages","stargazers_url":"https://api.github.com/repos/HubTurbo/addressbook/stargazers","contributors_url":"https://api.github.com/repos/HubTurbo/addressbook/contributors","subscribers_url":"https://api.github.com/repos/HubTurbo/addressbook/subscribers","subscription_url":"https://api.github.com/repos/HubTurbo/addressbook/subscription","commits_url":"https://api.github.com/repos/HubTurbo/addressbook/commits{/sha}","git_commits_url":"https://api.github.com/repos/HubTurbo/addressbook/git/commits{/sha}","comments_url":"https://api.github.com/repos/HubTurbo/addressbook/comments{/number}","issue_comment_url":"https://api.github.com/repos/HubTurbo/addressbook/issues/comments{/number}","contents_url":"https://api.github.com/repos/HubTurbo/addressbook/contents/{+path}","compare_url":"https://api.github.com/repos/HubTurbo/addressbook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HubTurbo/addressbook/merges","archive_url":"https://api.github.com/repos/HubTurbo/addressbook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HubTurbo/addressbook/downloads","issues_url":"https://api.github.com/repos/HubTurbo/addressbook/issues{/number}","pulls_url":"https://api.github.com/repos/HubTurbo/addressbook/pulls{/number}","milestones_url":"https://api.github.com/repos/HubTurbo/addressbook/milestones{/number}","notifications_url":"https://api.github.com/repos/HubTurbo/addressbook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HubTurbo/addressbook/labels{/name}","releases_url":"https://api.github.com/repos/HubTurbo/addressbook/releases{/id}","deployments_url":"https://api.github.com/repos/HubTurbo/addressbook/deployments","created_at":"2016-05-08T15:05:27Z","updated_at":"2016-05-08T23:35:38Z","pushed_at":"2016-07-25T10:25:40Z","git_url":"git://github.com/HubTurbo/addressbook.git","ssh_url":"git@github.com:HubTurbo/addressbook.git","clone_url":"https://github.com/HubTurbo/addressbook.git","svn_url":"https://github.com/HubTurbo/addressbook","homepage":null,"size":4896,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":58,"forks":3,"open_issues":58,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/HubTurbo/addressbook/pulls/508"},"html":{"href":"https://github.com/HubTurbo/addressbook/pull/508"},"issue":{"href":"https://api.github.com/repos/HubTurbo/addressbook/issues/508"},"comments":{"href":"https://api.github.com/repos/HubTurbo/addressbook/issues/508/comments"},"review_comments":{"href":"https://api.github.com/repos/HubTurbo/addressbook/pulls/508/comments"},"review_comment":{"href":"https://api.github.com/repos/HubTurbo/addressbook/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HubTurbo/addressbook/pulls/508/commits"},"statuses":{"href":"https://api.github.com/repos/HubTurbo/addressbook/statuses/86d8702f5944d1845fc49df9b3c14a7c9b76daa2"}}}}
{"actor":{"display_login":"yl-coder"}}