{"action":"created","comment":{"url":"https://api.github.com/repos/Iteatime/Acrabadabra/pulls/comments/238486430","pull_request_review_id":181036801,"id":238486430,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODQ4NjQzMA==","diff_hunk":"@@ -0,0 +1,187 @@\n+import { EditCraPage } from './editCra.po';\n+\n+import { browser, by, ElementFinder } from 'protractor';\n+import { getDate, getDay, lastDayOfMonth, setDate, startOfMonth } from 'date-fns';\n+import { link } from 'fs';\n+\n+describe('When I input my timesheet', () => {\n+  let editCraPage: EditCraPage,\n+      nameInput: ElementFinder,\n+      emailInput: ElementFinder,\n+      titleInput: ElementFinder,\n+      clientInput: ElementFinder,\n+      selectedNumber: ElementFinder;\n+\n+  const getBusinessDaysNumber = function(): number {\n+    let workingDays = 0;\n+    const date = startOfMonth(new Date());\n+\n+    for (let day = 1; day <= getDate(lastDayOfMonth(date)); day++) {\n+      const weekDay = getDay(setDate(date, day));\n+      workingDays += (weekDay === 0 || weekDay === 6) ? 0 : 1;\n+    }\n+\n+    return workingDays;\n+  };\n+\n+  beforeEach(() => {\n+    editCraPage = new EditCraPage();\n+    editCraPage.navigateTo();\n+    browser.waitForAngular();\n+\n+    nameInput = editCraPage.getInputByLabelText('Nom');\n+    emailInput = editCraPage.getInputByLabelText('Email');\n+    titleInput = editCraPage.getInputByLabelText('Intitulé');\n+    clientInput = editCraPage.getInputByLabelText('Client final');\n+\n+    selectedNumber = editCraPage.getElementsByText('Nombre total de journées :')\n+            .first()\n+            .element(by.xpath('..//span[@class=\"highlight\"]'));\n+  });\n+\n+  it('should be possible to enter my name', () => {\n+    nameInput.sendKeys('Tester');\n+    expect(nameInput.getAttribute('value')).toBe('Tester');\n+  });\n+\n+  it('should be possible to enter my email', () => {\n+    emailInput.sendKeys('tester@test.com');\n+    expect(emailInput.getAttribute('value')).toBe('tester@test.com');\n+  });\n+\n+  it('should be possible to enter a mission title', () => {\n+    titleInput.sendKeys('Testing');\n+    expect(titleInput.getAttribute('value')).toBe('Testing');\n+  });\n+\n+  it('should be possible to enter the client\\'s name', () => {\n+    clientInput.sendKeys('Test.com');\n+    expect(clientInput.getAttribute('value')).toBe('Test.com');\n+  });\n+\n+  describe('On the calendar', () => {\n+    let aDayCell: ElementFinder;\n+\n+    beforeEach(() => {\n+      aDayCell = editCraPage.getElementsByText('4').first();\n+      aDayCell.click();\n+    });\n+\n+    it('should be possible to select days', () => {\n+      expect(editCraPage.getADayBadge(aDayCell).getText()).toBe('1\\njour');\n+    });\n+\n+    it('should be possible to select every working day', () => {\n+      editCraPage.getElementsByText('Sélectionner les jours ouvrés').first().click();\n+      expect(selectedNumber.getText()).toBe(getBusinessDaysNumber().toString());\n+    });\n+\n+    describe('', () => {\n+      let dayBadge: ElementFinder;\n+\n+      beforeEach(() => {\n+        dayBadge = editCraPage.getADayBadge(aDayCell);\n+\n+        browser.actions()\n+            .mouseMove(dayBadge)\n+            .perform();\n+\n+        // Sleeping to wait for the annimation end\n+        browser.sleep(50);\n+\n+        browser.actions()\n+            .click(editCraPage.getElementsByText('0,5').first())\n+            .perform();\n+\n+        // Sleeping to wait for the annimation end\n+        browser.sleep(50);\n+\n+        // Moving the mouse away to read the value\n+        browser.actions()\n+            .mouseMove(aDayCell)\n+            .perform();\n+\n+        // Sleeping to wait for the annimation end\n+        browser.sleep(170);","path":"e2e/src/editCra.e2e-spec.ts","position":105,"original_position":105,"commit_id":"954a74b048456ee299244b12cfb3d1533f6df8c4","original_commit_id":"954a74b048456ee299244b12cfb3d1533f6df8c4","user":{"login":"RomainOliva","id":16322590,"node_id":"MDQ6VXNlcjE2MzIyNTkw","avatar_url":"https://avatars3.githubusercontent.com/u/16322590?v=4","gravatar_id":"","url":"https://api.github.com/users/RomainOliva","html_url":"https://github.com/RomainOliva","followers_url":"https://api.github.com/users/RomainOliva/followers","following_url":"https://api.github.com/users/RomainOliva/following{/other_user}","gists_url":"https://api.github.com/users/RomainOliva/gists{/gist_id}","starred_url":"https://api.github.com/users/RomainOliva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RomainOliva/subscriptions","organizations_url":"https://api.github.com/users/RomainOliva/orgs","repos_url":"https://api.github.com/users/RomainOliva/repos","events_url":"https://api.github.com/users/RomainOliva/events{/privacy}","received_events_url":"https://api.github.com/users/RomainOliva/received_events","type":"User","site_admin":false},"body":"The e2e are always very long, especially because of the many sleep we write in the code.\r\nTry to reduce them to the maximum, and use something else if it's possible.\r\nSome people disable css animation on protractor, I don't know if it's a good practice","created_at":"2018-12-04T00:04:04Z","updated_at":"2018-12-04T00:17:51Z","html_url":"https://github.com/Iteatime/Acrabadabra/pull/26#discussion_r238486430","pull_request_url":"https://api.github.com/repos/Iteatime/Acrabadabra/pulls/26","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Iteatime/Acrabadabra/pulls/comments/238486430"},"html":{"href":"https://github.com/Iteatime/Acrabadabra/pull/26#discussion_r238486430"},"pull_request":{"href":"https://api.github.com/repos/Iteatime/Acrabadabra/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/Iteatime/Acrabadabra/pulls/26","id":235442058,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1NDQyMDU4","html_url":"https://github.com/Iteatime/Acrabadabra/pull/26","diff_url":"https://github.com/Iteatime/Acrabadabra/pull/26.diff","patch_url":"https://github.com/Iteatime/Acrabadabra/pull/26.patch","issue_url":"https://api.github.com/repos/Iteatime/Acrabadabra/issues/26","number":26,"state":"open","locked":false,"title":"test: create the e2e tests","user":{"login":"mrclemds","id":5255256,"node_id":"MDQ6VXNlcjUyNTUyNTY=","avatar_url":"https://avatars1.githubusercontent.com/u/5255256?v=4","gravatar_id":"","url":"https://api.github.com/users/mrclemds","html_url":"https://github.com/mrclemds","followers_url":"https://api.github.com/users/mrclemds/followers","following_url":"https://api.github.com/users/mrclemds/following{/other_user}","gists_url":"https://api.github.com/users/mrclemds/gists{/gist_id}","starred_url":"https://api.github.com/users/mrclemds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrclemds/subscriptions","organizations_url":"https://api.github.com/users/mrclemds/orgs","repos_url":"https://api.github.com/users/mrclemds/repos","events_url":"https://api.github.com/users/mrclemds/events{/privacy}","received_events_url":"https://api.github.com/users/mrclemds/received_events","type":"User","site_admin":false},"body":"Add tests:\r\n  on the form inputs\r\n  on the calendar\r\n  on the validation\r\n  on the links\r\n\r\nAdd methods:\r\n  getElementByText return a list of element containing the text\r\n  getInputByLabelText return the input corresponding to the label provided\r\n getSubmitButton which return the submit button\r\n getADayBadge which return the badge of the given day element","created_at":"2018-12-03T13:11:46Z","updated_at":"2018-12-04T00:17:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8fb7dd6b358cd9d53816bfad8ba6b9c5f4b36a66","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Iteatime/Acrabadabra/pulls/26/commits","review_comments_url":"https://api.github.com/repos/Iteatime/Acrabadabra/pulls/26/comments","review_comment_url":"https://api.github.com/repos/Iteatime/Acrabadabra/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Iteatime/Acrabadabra/issues/26/comments","statuses_url":"https://api.github.com/repos/Iteatime/Acrabadabra/statuses/954a74b048456ee299244b12cfb3d1533f6df8c4","head":{"label":"Iteatime:cpont-editcra-e2e","ref":"cpont-editcra-e2e","sha":"954a74b048456ee299244b12cfb3d1533f6df8c4","user":{"login":"Iteatime","id":44466349,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0NDY2MzQ5","avatar_url":"https://avatars0.githubusercontent.com/u/44466349?v=4","gravatar_id":"","url":"https://api.github.com/users/Iteatime","html_url":"https://github.com/Iteatime","followers_url":"https://api.github.com/users/Iteatime/followers","following_url":"https://api.github.com/users/Iteatime/following{/other_user}","gists_url":"https://api.github.com/users/Iteatime/gists{/gist_id}","starred_url":"https://api.github.com/users/Iteatime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Iteatime/subscriptions","organizations_url":"https://api.github.com/users/Iteatime/orgs","repos_url":"https://api.github.com/users/Iteatime/repos","events_url":"https://api.github.com/users/Iteatime/events{/privacy}","received_events_url":"https://api.github.com/users/Iteatime/received_events","type":"Organization","site_admin":false},"repo":{"id":154660172,"node_id":"MDEwOlJlcG9zaXRvcnkxNTQ2NjAxNzI=","name":"Acrabadabra","full_name":"Iteatime/Acrabadabra","private":false,"owner":{"login":"Iteatime","id":44466349,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0NDY2MzQ5","avatar_url":"https://avatars0.githubusercontent.com/u/44466349?v=4","gravatar_id":"","url":"https://api.github.com/users/Iteatime","html_url":"https://github.com/Iteatime","followers_url":"https://api.github.com/users/Iteatime/followers","following_url":"https://api.github.com/users/Iteatime/following{/other_user}","gists_url":"https://api.github.com/users/Iteatime/gists{/gist_id}","starred_url":"https://api.github.com/users/Iteatime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Iteatime/subscriptions","organizations_url":"https://api.github.com/users/Iteatime/orgs","repos_url":"https://api.github.com/users/Iteatime/repos","events_url":"https://api.github.com/users/Iteatime/events{/privacy}","received_events_url":"https://api.github.com/users/Iteatime/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Iteatime/Acrabadabra","description":null,"fork":false,"url":"https://api.github.com/repos/Iteatime/Acrabadabra","forks_url":"https://api.github.com/repos/Iteatime/Acrabadabra/forks","keys_url":"https://api.github.com/repos/Iteatime/Acrabadabra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Iteatime/Acrabadabra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Iteatime/Acrabadabra/teams","hooks_url":"https://api.github.com/repos/Iteatime/Acrabadabra/hooks","issue_events_url":"https://api.github.com/repos/Iteatime/Acrabadabra/issues/events{/number}","events_url":"https://api.github.com/repos/Iteatime/Acrabadabra/events","assignees_url":"https://api.github.com/repos/Iteatime/Acrabadabra/assignees{/user}","branches_url":"https://api.github.com/repos/Iteatime/Acrabadabra/branches{/branch}","tags_url":"https://api.github.com/repos/Iteatime/Acrabadabra/tags","blobs_url":"https://api.github.com/repos/Iteatime/Acrabadabra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Iteatime/Acrabadabra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Iteatime/Acrabadabra/git/refs{/sha}","trees_url":"https://api.github.com/repos/Iteatime/Acrabadabra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Iteatime/Acrabadabra/statuses/{sha}","languages_url":"https://api.github.com/repos/Iteatime/Acrabadabra/languages","stargazers_url":"https://api.github.com/repos/Iteatime/Acrabadabra/stargazers","contributors_url":"https://api.github.com/repos/Iteatime/Acrabadabra/contributors","subscribers_url":"https://api.github.com/repos/Iteatime/Acrabadabra/subscribers","subscription_url":"https://api.github.com/repos/Iteatime/Acrabadabra/subscription","commits_url":"https://api.github.com/repos/Iteatime/Acrabadabra/commits{/sha}","git_commits_url":"https://api.github.com/repos/Iteatime/Acrabadabra/git/commits{/sha}","comments_url":"https://api.github.com/repos/Iteatime/Acrabadabra/comments{/number}","issue_comment_url":"https://api.github.com/repos/Iteatime/Acrabadabra/issues/comments{/number}","contents_url":"https://api.github.com/repos/Iteatime/Acrabadabra/contents/{+path}","compare_url":"https://api.github.com/repos/Iteatime/Acrabadabra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Iteatime/Acrabadabra/merges","archive_url":"https://api.github.com/repos/Iteatime/Acrabadabra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Iteatime/Acrabadabra/downloads","issues_url":"https://api.github.com/repos/Iteatime/Acrabadabra/issues{/number}","pulls_url":"https://api.github.com/repos/Iteatime/Acrabadabra/pulls{/number}","milestones_url":"https://api.github.com/repos/Iteatime/Acrabadabra/milestones{/number}","notifications_url":"https://api.github.com/repos/Iteatime/Acrabadabra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Iteatime/Acrabadabra/labels{/name}","releases_url":"https://api.github.com/repos/Iteatime/Acrabadabra/releases{/id}","deployments_url":"https://api.github.com/repos/Iteatime/Acrabadabra/deployments","created_at":"2018-10-25T11:33:35Z","updated_at":"2018-11-28T08:08:03Z","pushed_at":"2018-12-03T16:28:19Z","git_url":"git://github.com/Iteatime/Acrabadabra.git","ssh_url":"git@github.com:Iteatime/Acrabadabra.git","clone_url":"https://github.com/Iteatime/Acrabadabra.git","svn_url":"https://github.com/Iteatime/Acrabadabra","homepage":null,"size":591,"stargazers_count":2,"watchers_count":2,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":1,"open_issues":2,"watchers":2,"default_branch":"master"}},"base":{"label":"Iteatime:staging","ref":"staging","sha":"0a64200f5d21fefeeb9b213512c7b76a578528c9","user":{"login":"Iteatime","id":44466349,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0NDY2MzQ5","avatar_url":"https://avatars0.githubusercontent.com/u/44466349?v=4","gravatar_id":"","url":"https://api.github.com/users/Iteatime","html_url":"https://github.com/Iteatime","followers_url":"https://api.github.com/users/Iteatime/followers","following_url":"https://api.github.com/users/Iteatime/following{/other_user}","gists_url":"https://api.github.com/users/Iteatime/gists{/gist_id}","starred_url":"https://api.github.com/users/Iteatime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Iteatime/subscriptions","organizations_url":"https://api.github.com/users/Iteatime/orgs","repos_url":"https://api.github.com/users/Iteatime/repos","events_url":"https://api.github.com/users/Iteatime/events{/privacy}","received_events_url":"https://api.github.com/users/Iteatime/received_events","type":"Organization","site_admin":false},"repo":{"id":154660172,"node_id":"MDEwOlJlcG9zaXRvcnkxNTQ2NjAxNzI=","name":"Acrabadabra","full_name":"Iteatime/Acrabadabra","private":false,"owner":{"login":"Iteatime","id":44466349,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0NDY2MzQ5","avatar_url":"https://avatars0.githubusercontent.com/u/44466349?v=4","gravatar_id":"","url":"https://api.github.com/users/Iteatime","html_url":"https://github.com/Iteatime","followers_url":"https://api.github.com/users/Iteatime/followers","following_url":"https://api.github.com/users/Iteatime/following{/other_user}","gists_url":"https://api.github.com/users/Iteatime/gists{/gist_id}","starred_url":"https://api.github.com/users/Iteatime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Iteatime/subscriptions","organizations_url":"https://api.github.com/users/Iteatime/orgs","repos_url":"https://api.github.com/users/Iteatime/repos","events_url":"https://api.github.com/users/Iteatime/events{/privacy}","received_events_url":"https://api.github.com/users/Iteatime/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Iteatime/Acrabadabra","description":null,"fork":false,"url":"https://api.github.com/repos/Iteatime/Acrabadabra","forks_url":"https://api.github.com/repos/Iteatime/Acrabadabra/forks","keys_url":"https://api.github.com/repos/Iteatime/Acrabadabra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Iteatime/Acrabadabra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Iteatime/Acrabadabra/teams","hooks_url":"https://api.github.com/repos/Iteatime/Acrabadabra/hooks","issue_events_url":"https://api.github.com/repos/Iteatime/Acrabadabra/issues/events{/number}","events_url":"https://api.github.com/repos/Iteatime/Acrabadabra/events","assignees_url":"https://api.github.com/repos/Iteatime/Acrabadabra/assignees{/user}","branches_url":"https://api.github.com/repos/Iteatime/Acrabadabra/branches{/branch}","tags_url":"https://api.github.com/repos/Iteatime/Acrabadabra/tags","blobs_url":"https://api.github.com/repos/Iteatime/Acrabadabra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Iteatime/Acrabadabra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Iteatime/Acrabadabra/git/refs{/sha}","trees_url":"https://api.github.com/repos/Iteatime/Acrabadabra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Iteatime/Acrabadabra/statuses/{sha}","languages_url":"https://api.github.com/repos/Iteatime/Acrabadabra/languages","stargazers_url":"https://api.github.com/repos/Iteatime/Acrabadabra/stargazers","contributors_url":"https://api.github.com/repos/Iteatime/Acrabadabra/contributors","subscribers_url":"https://api.github.com/repos/Iteatime/Acrabadabra/subscribers","subscription_url":"https://api.github.com/repos/Iteatime/Acrabadabra/subscription","commits_url":"https://api.github.com/repos/Iteatime/Acrabadabra/commits{/sha}","git_commits_url":"https://api.github.com/repos/Iteatime/Acrabadabra/git/commits{/sha}","comments_url":"https://api.github.com/repos/Iteatime/Acrabadabra/comments{/number}","issue_comment_url":"https://api.github.com/repos/Iteatime/Acrabadabra/issues/comments{/number}","contents_url":"https://api.github.com/repos/Iteatime/Acrabadabra/contents/{+path}","compare_url":"https://api.github.com/repos/Iteatime/Acrabadabra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Iteatime/Acrabadabra/merges","archive_url":"https://api.github.com/repos/Iteatime/Acrabadabra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Iteatime/Acrabadabra/downloads","issues_url":"https://api.github.com/repos/Iteatime/Acrabadabra/issues{/number}","pulls_url":"https://api.github.com/repos/Iteatime/Acrabadabra/pulls{/number}","milestones_url":"https://api.github.com/repos/Iteatime/Acrabadabra/milestones{/number}","notifications_url":"https://api.github.com/repos/Iteatime/Acrabadabra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Iteatime/Acrabadabra/labels{/name}","releases_url":"https://api.github.com/repos/Iteatime/Acrabadabra/releases{/id}","deployments_url":"https://api.github.com/repos/Iteatime/Acrabadabra/deployments","created_at":"2018-10-25T11:33:35Z","updated_at":"2018-11-28T08:08:03Z","pushed_at":"2018-12-03T16:28:19Z","git_url":"git://github.com/Iteatime/Acrabadabra.git","ssh_url":"git@github.com:Iteatime/Acrabadabra.git","clone_url":"https://github.com/Iteatime/Acrabadabra.git","svn_url":"https://github.com/Iteatime/Acrabadabra","homepage":null,"size":591,"stargazers_count":2,"watchers_count":2,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":1,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Iteatime/Acrabadabra/pulls/26"},"html":{"href":"https://github.com/Iteatime/Acrabadabra/pull/26"},"issue":{"href":"https://api.github.com/repos/Iteatime/Acrabadabra/issues/26"},"comments":{"href":"https://api.github.com/repos/Iteatime/Acrabadabra/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/Iteatime/Acrabadabra/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/Iteatime/Acrabadabra/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Iteatime/Acrabadabra/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/Iteatime/Acrabadabra/statuses/954a74b048456ee299244b12cfb3d1533f6df8c4"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"RomainOliva"}}