{"action":"created","comment":{"url":"https://api.github.com/repos/codebendercc/seleniumTests/pulls/comments/69420654","id":69420654,"diff_hunk":"@@ -0,0 +1,211 @@\n+from codebender_testing.utils import SeleniumTestCase\n+from selenium import webdriver\n+from selenium.webdriver.common.by import By\n+from selenium.webdriver.common.keys import Keys\n+from selenium.webdriver.support.ui import Select\n+from codebender_testing import config\n+from codebender_testing.config import STAGING_SITE_URL\n+from selenium.webdriver.common.action_chains import ActionChains\n+import os\n+import time\n+import pytest\n+\n+class TestSketchesCounters(SeleniumTestCase):\n+\n+    def test_sketches_counters(self):\n+        self.driver.implicitly_wait(30)\n+        driver = self.driver\n+        self.open(\"/\")\n+        #Login and visit the new home page.\n+        credentials = {\n+            'username': os.environ.get('CODEBENDER_TEST_USER'),\n+            'password': os.environ.get('CODEBENDER_TEST_PASS'),\n+        }\n+        driver.find_element_by_id(\"login_btn\").click()\n+        driver.find_element_by_id(\"username\").clear()\n+        driver.find_element_by_id(\"username\").send_keys(credentials['username'])\n+        driver.find_element_by_id(\"password\").clear()\n+        driver.find_element_by_id(\"password\").send_keys(credentials['password'])\n+        driver.find_element_by_id(\"_submit\").click()\n+\n+        assert driver.find_element_by_id(\"private-sketches-counter\").text==\"0\"\n+        assert driver.find_element_by_id(\"public-sketches-counter\").text==\"0\"\n+\n+        #Create 2 public sketches and Create 2 private sketches\n+        driver.find_element_by_id(\"create_sketch_btn\").click()\n+        driver.find_element_by_id(\"create-sketch-modal-action-button\").click()\n+        self.get_element(By.ID, \"save\")\n+        driver.find_element_by_id(\"logo_small\").click()\n+        driver.find_element_by_id(\"create_sketch_btn\").click()\n+        driver.find_element_by_id(\"create-sketch-modal-action-button\").click()\n+        self.get_element(By.ID, \"save\")\n+        driver.find_element_by_id(\"logo_small\").click()\n+        driver.find_element_by_id(\"create_sketch_btn\").click()\n+        driver.find_element_by_xpath(\"(//input[@name='create-sketch-modal-title'])[2]\").click()\n+        driver.find_element_by_id(\"create-sketch-modal-action-button\").click()\n+        self.get_element(By.ID, \"save\")\n+        driver.find_element_by_id(\"logo_small\").click()\n+        driver.find_element_by_id(\"create_sketch_btn\").click()\n+        driver.find_element_by_xpath(\"(//input[@name='create-sketch-modal-title'])[2]\").click()\n+        driver.find_element_by_id(\"create-sketch-modal-action-button\").click()\n+        self.get_element(By.ID, \"save\")\n+        driver.find_element_by_id(\"logo_small\").click()\n+\n+        #Check that the counters have the correct value.\n+        assert driver.find_element_by_id(\"private-sketches-counter\").text==\"2\"\n+        assert driver.find_element_by_id(\"public-sketches-counter\").text==\"2\"\n+\n+        #Check that the counter for private projects also appears at the Badges section and has the correct value.\n+        assert driver.find_element_by_id(\"privateProjectAvailableNumber\").text==\"0\"\n+        assert driver.find_element_by_id(\"available-private-projects-counter\").text==\"0/2\"","path":"tests/common/sketches_counters/test_sketches_counters.py","position":60,"original_position":60,"commit_id":"a331a1f4b0e6725f73299ea39873b8e8845961cd","original_commit_id":"a331a1f4b0e6725f73299ea39873b8e8845961cd","user":{"login":"tsiknas","id":3754652,"avatar_url":"https://avatars.githubusercontent.com/u/3754652?v=3","gravatar_id":"","url":"https://api.github.com/users/tsiknas","html_url":"https://github.com/tsiknas","followers_url":"https://api.github.com/users/tsiknas/followers","following_url":"https://api.github.com/users/tsiknas/following{/other_user}","gists_url":"https://api.github.com/users/tsiknas/gists{/gist_id}","starred_url":"https://api.github.com/users/tsiknas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsiknas/subscriptions","organizations_url":"https://api.github.com/users/tsiknas/orgs","repos_url":"https://api.github.com/users/tsiknas/repos","events_url":"https://api.github.com/users/tsiknas/events{/privacy}","received_events_url":"https://api.github.com/users/tsiknas/received_events","type":"User","site_admin":false},"body":"Missing space.","created_at":"2016-07-04T08:01:17Z","updated_at":"2016-07-04T08:01:17Z","html_url":"https://github.com/codebendercc/seleniumTests/pull/36#discussion_r69420654","pull_request_url":"https://api.github.com/repos/codebendercc/seleniumTests/pulls/36","_links":{"self":{"href":"https://api.github.com/repos/codebendercc/seleniumTests/pulls/comments/69420654"},"html":{"href":"https://github.com/codebendercc/seleniumTests/pull/36#discussion_r69420654"},"pull_request":{"href":"https://api.github.com/repos/codebendercc/seleniumTests/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/codebendercc/seleniumTests/pulls/36","id":74903694,"html_url":"https://github.com/codebendercc/seleniumTests/pull/36","diff_url":"https://github.com/codebendercc/seleniumTests/pull/36.diff","patch_url":"https://github.com/codebendercc/seleniumTests/pull/36.patch","issue_url":"https://api.github.com/repos/codebendercc/seleniumTests/issues/36","number":36,"state":"open","locked":false,"title":" Frontend js unit tests #676","user":{"login":"penelopez","id":17291205,"avatar_url":"https://avatars.githubusercontent.com/u/17291205?v=3","gravatar_id":"","url":"https://api.github.com/users/penelopez","html_url":"https://github.com/penelopez","followers_url":"https://api.github.com/users/penelopez/followers","following_url":"https://api.github.com/users/penelopez/following{/other_user}","gists_url":"https://api.github.com/users/penelopez/gists{/gist_id}","starred_url":"https://api.github.com/users/penelopez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/penelopez/subscriptions","organizations_url":"https://api.github.com/users/penelopez/orgs","repos_url":"https://api.github.com/users/penelopez/repos","events_url":"https://api.github.com/users/penelopez/events{/privacy}","received_events_url":"https://api.github.com/users/penelopez/received_events","type":"User","site_admin":false},"body":"##### Homepage test cases:\r\n- [x] Login and visit the new home page.\r\n- [x] Create 2 public sketches\r\n- [x] Create 2 private sketches\r\n- [x] Check that when the page loads, the loading screen appears and message \"Loading the  Sketches, please wait\" is displayed.\r\n- [x] Check that the counters:\r\n\t- [x] Public sketches (blue) have the correct value.\r\n\t- [x] Private sketches (purple) have the correct value.\t\t\t\r\n- [x] Check that the counter for private projects also appears at the Badges section and has the correct value.\r\n- [x] Check that if your account has private projects (e.g. 2) and all yor projects are public, counter for available private sketches should be 0/number of total private sketches(e.g. 0/2) and the link to the private sketches should be Add more.\r\n \r\n- [x] Check that the number of private projects available is updated each time that you make a change (e.g from private to public and vice versa).\r\n\t- [x] Change the private sketch to public\r\n\t- [x] Change the public to private\r\n\r\n- [x] Check that the counter for available private sketches also appears at the `upload sketch` modal (ino, zip, multiple zip) and at the `create` and `edit` sketch modal.\r\n- [x] Open the `create sketch` modal and try to create a new project without providing a name. The `Create` button should be disabled.\r\n- [x] Check that sketch name is auto-generated as: `Untitled Sketch CURRENT_DATE`.\r\n- [x] Check that when you enter a short description longer than the supported, the extra text is highlighted with a red mark and sketch counter becomes red.\r\n- [x] Check the description Character count is always in sync with the length of the short description.\r\n- [x] Check that when you create the sketch you are redirected into the editor.\r\n- [x] Check that `All`, `Public` and `Private` buttons work, clicking on each of them and verifying that the correct number of sketches is viewed each time.\r\n- [x] Clone one of demo_user's sketches. Go to your home page and see that message ` Cloned from Sketch sketch_name  by username` appears under the cloned project.\r\n\r\n##### Inside sketch block test cases:\r\n- [x] Check that when you click on its name, sketch opens in editor.\r\n- [x] Check that when a sketch has a short description, it appears at the section below the name, else the section does not appear at all.\r\n- [x] Check that the file list of the sketch is at the bottom of the sketch block.\r\n- [ ] Create a sketch using the `Create` button and go back to homepage. Sketch should say `Created` instead of `Modified`.\r\n- [ ] Go back to the sketch previously created and do some changes. Save it and go back to homepage. Sketch should say `Modified` instead of `Created`.\r\n- [x] Check the `Share` button. Click on `Share` button and check that it opens the share modal (titled \"Share your Sketch\").\r\n- [x] Check the clone sketch function. Click on `Clone` button and check that the sketch is cloned and opens in editor.\r\n- [x] Check the delete sketch fuction. Click on `Delete` button and check that the project is correctly deleted (it deletes the sketch and filelist is updated). Check that when the sketch is deleted the modal stays open showing the result of the deletion.\r\n\r\n##### Editor test cases:\r\n- [x] Open a sketch in editor and double click the earth icon on the left of its title to make it `private` .\r\n- [x] Go to the same sketch and double click the earth icon on the left of its title to make it `public` .\r\n- [x] Go to a sketch in editor and change the short description. After the short description is set, make sure it's visible next to the editor (below the file-list).\r\n- [x] Rename the sketch from the editor and verify the name of the sketch is successfully updated.\r\n- [x] Go to a sketch in editor and add a file. Make sure the file-list length is increased by one and that the name of the new element is the filename you provided.\r\n- [x] Go to a sketch in editor and delete a file. Make sure the file no longer exists in the file-list.\r\n- [x] Go to a sketch in editor and rename a file. Make sure the new filename exists in the file-list.\r\n- [x] Go to a sketch in editor and click the `Clone` button. You should get redirected to a new editor, check the name (\"copy\").","created_at":"2016-06-23T06:48:21Z","updated_at":"2016-07-04T08:01:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"679cc7a73b7c44348c012e7f43a062223fd715a1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/codebendercc/seleniumTests/pulls/36/commits","review_comments_url":"https://api.github.com/repos/codebendercc/seleniumTests/pulls/36/comments","review_comment_url":"https://api.github.com/repos/codebendercc/seleniumTests/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codebendercc/seleniumTests/issues/36/comments","statuses_url":"https://api.github.com/repos/codebendercc/seleniumTests/statuses/a331a1f4b0e6725f73299ea39873b8e8845961cd","head":{"label":"codebendercc:frontend_js_unit_tests","ref":"frontend_js_unit_tests","sha":"a331a1f4b0e6725f73299ea39873b8e8845961cd","user":{"login":"codebendercc","id":1754900,"avatar_url":"https://avatars.githubusercontent.com/u/1754900?v=3","gravatar_id":"","url":"https://api.github.com/users/codebendercc","html_url":"https://github.com/codebendercc","followers_url":"https://api.github.com/users/codebendercc/followers","following_url":"https://api.github.com/users/codebendercc/following{/other_user}","gists_url":"https://api.github.com/users/codebendercc/gists{/gist_id}","starred_url":"https://api.github.com/users/codebendercc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codebendercc/subscriptions","organizations_url":"https://api.github.com/users/codebendercc/orgs","repos_url":"https://api.github.com/users/codebendercc/repos","events_url":"https://api.github.com/users/codebendercc/events{/privacy}","received_events_url":"https://api.github.com/users/codebendercc/received_events","type":"Organization","site_admin":false},"repo":{"id":30151633,"name":"seleniumTests","full_name":"codebendercc/seleniumTests","owner":{"login":"codebendercc","id":1754900,"avatar_url":"https://avatars.githubusercontent.com/u/1754900?v=3","gravatar_id":"","url":"https://api.github.com/users/codebendercc","html_url":"https://github.com/codebendercc","followers_url":"https://api.github.com/users/codebendercc/followers","following_url":"https://api.github.com/users/codebendercc/following{/other_user}","gists_url":"https://api.github.com/users/codebendercc/gists{/gist_id}","starred_url":"https://api.github.com/users/codebendercc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codebendercc/subscriptions","organizations_url":"https://api.github.com/users/codebendercc/orgs","repos_url":"https://api.github.com/users/codebendercc/repos","events_url":"https://api.github.com/users/codebendercc/events{/privacy}","received_events_url":"https://api.github.com/users/codebendercc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codebendercc/seleniumTests","description":"Selenium tests for the codebender website","fork":false,"url":"https://api.github.com/repos/codebendercc/seleniumTests","forks_url":"https://api.github.com/repos/codebendercc/seleniumTests/forks","keys_url":"https://api.github.com/repos/codebendercc/seleniumTests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codebendercc/seleniumTests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codebendercc/seleniumTests/teams","hooks_url":"https://api.github.com/repos/codebendercc/seleniumTests/hooks","issue_events_url":"https://api.github.com/repos/codebendercc/seleniumTests/issues/events{/number}","events_url":"https://api.github.com/repos/codebendercc/seleniumTests/events","assignees_url":"https://api.github.com/repos/codebendercc/seleniumTests/assignees{/user}","branches_url":"https://api.github.com/repos/codebendercc/seleniumTests/branches{/branch}","tags_url":"https://api.github.com/repos/codebendercc/seleniumTests/tags","blobs_url":"https://api.github.com/repos/codebendercc/seleniumTests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codebendercc/seleniumTests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codebendercc/seleniumTests/git/refs{/sha}","trees_url":"https://api.github.com/repos/codebendercc/seleniumTests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codebendercc/seleniumTests/statuses/{sha}","languages_url":"https://api.github.com/repos/codebendercc/seleniumTests/languages","stargazers_url":"https://api.github.com/repos/codebendercc/seleniumTests/stargazers","contributors_url":"https://api.github.com/repos/codebendercc/seleniumTests/contributors","subscribers_url":"https://api.github.com/repos/codebendercc/seleniumTests/subscribers","subscription_url":"https://api.github.com/repos/codebendercc/seleniumTests/subscription","commits_url":"https://api.github.com/repos/codebendercc/seleniumTests/commits{/sha}","git_commits_url":"https://api.github.com/repos/codebendercc/seleniumTests/git/commits{/sha}","comments_url":"https://api.github.com/repos/codebendercc/seleniumTests/comments{/number}","issue_comment_url":"https://api.github.com/repos/codebendercc/seleniumTests/issues/comments{/number}","contents_url":"https://api.github.com/repos/codebendercc/seleniumTests/contents/{+path}","compare_url":"https://api.github.com/repos/codebendercc/seleniumTests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codebendercc/seleniumTests/merges","archive_url":"https://api.github.com/repos/codebendercc/seleniumTests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codebendercc/seleniumTests/downloads","issues_url":"https://api.github.com/repos/codebendercc/seleniumTests/issues{/number}","pulls_url":"https://api.github.com/repos/codebendercc/seleniumTests/pulls{/number}","milestones_url":"https://api.github.com/repos/codebendercc/seleniumTests/milestones{/number}","notifications_url":"https://api.github.com/repos/codebendercc/seleniumTests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codebendercc/seleniumTests/labels{/name}","releases_url":"https://api.github.com/repos/codebendercc/seleniumTests/releases{/id}","deployments_url":"https://api.github.com/repos/codebendercc/seleniumTests/deployments","created_at":"2015-02-01T16:25:44Z","updated_at":"2016-01-13T07:54:41Z","pushed_at":"2016-07-04T06:39:09Z","git_url":"git://github.com/codebendercc/seleniumTests.git","ssh_url":"git@github.com:codebendercc/seleniumTests.git","clone_url":"https://github.com/codebendercc/seleniumTests.git","svn_url":"https://github.com/codebendercc/seleniumTests","homepage":null,"size":18656,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"codebendercc:master","ref":"master","sha":"d03dc7ae57684ecc3e856b3d6cf4429d78d15f9d","user":{"login":"codebendercc","id":1754900,"avatar_url":"https://avatars.githubusercontent.com/u/1754900?v=3","gravatar_id":"","url":"https://api.github.com/users/codebendercc","html_url":"https://github.com/codebendercc","followers_url":"https://api.github.com/users/codebendercc/followers","following_url":"https://api.github.com/users/codebendercc/following{/other_user}","gists_url":"https://api.github.com/users/codebendercc/gists{/gist_id}","starred_url":"https://api.github.com/users/codebendercc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codebendercc/subscriptions","organizations_url":"https://api.github.com/users/codebendercc/orgs","repos_url":"https://api.github.com/users/codebendercc/repos","events_url":"https://api.github.com/users/codebendercc/events{/privacy}","received_events_url":"https://api.github.com/users/codebendercc/received_events","type":"Organization","site_admin":false},"repo":{"id":30151633,"name":"seleniumTests","full_name":"codebendercc/seleniumTests","owner":{"login":"codebendercc","id":1754900,"avatar_url":"https://avatars.githubusercontent.com/u/1754900?v=3","gravatar_id":"","url":"https://api.github.com/users/codebendercc","html_url":"https://github.com/codebendercc","followers_url":"https://api.github.com/users/codebendercc/followers","following_url":"https://api.github.com/users/codebendercc/following{/other_user}","gists_url":"https://api.github.com/users/codebendercc/gists{/gist_id}","starred_url":"https://api.github.com/users/codebendercc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codebendercc/subscriptions","organizations_url":"https://api.github.com/users/codebendercc/orgs","repos_url":"https://api.github.com/users/codebendercc/repos","events_url":"https://api.github.com/users/codebendercc/events{/privacy}","received_events_url":"https://api.github.com/users/codebendercc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codebendercc/seleniumTests","description":"Selenium tests for the codebender website","fork":false,"url":"https://api.github.com/repos/codebendercc/seleniumTests","forks_url":"https://api.github.com/repos/codebendercc/seleniumTests/forks","keys_url":"https://api.github.com/repos/codebendercc/seleniumTests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codebendercc/seleniumTests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codebendercc/seleniumTests/teams","hooks_url":"https://api.github.com/repos/codebendercc/seleniumTests/hooks","issue_events_url":"https://api.github.com/repos/codebendercc/seleniumTests/issues/events{/number}","events_url":"https://api.github.com/repos/codebendercc/seleniumTests/events","assignees_url":"https://api.github.com/repos/codebendercc/seleniumTests/assignees{/user}","branches_url":"https://api.github.com/repos/codebendercc/seleniumTests/branches{/branch}","tags_url":"https://api.github.com/repos/codebendercc/seleniumTests/tags","blobs_url":"https://api.github.com/repos/codebendercc/seleniumTests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codebendercc/seleniumTests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codebendercc/seleniumTests/git/refs{/sha}","trees_url":"https://api.github.com/repos/codebendercc/seleniumTests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codebendercc/seleniumTests/statuses/{sha}","languages_url":"https://api.github.com/repos/codebendercc/seleniumTests/languages","stargazers_url":"https://api.github.com/repos/codebendercc/seleniumTests/stargazers","contributors_url":"https://api.github.com/repos/codebendercc/seleniumTests/contributors","subscribers_url":"https://api.github.com/repos/codebendercc/seleniumTests/subscribers","subscription_url":"https://api.github.com/repos/codebendercc/seleniumTests/subscription","commits_url":"https://api.github.com/repos/codebendercc/seleniumTests/commits{/sha}","git_commits_url":"https://api.github.com/repos/codebendercc/seleniumTests/git/commits{/sha}","comments_url":"https://api.github.com/repos/codebendercc/seleniumTests/comments{/number}","issue_comment_url":"https://api.github.com/repos/codebendercc/seleniumTests/issues/comments{/number}","contents_url":"https://api.github.com/repos/codebendercc/seleniumTests/contents/{+path}","compare_url":"https://api.github.com/repos/codebendercc/seleniumTests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codebendercc/seleniumTests/merges","archive_url":"https://api.github.com/repos/codebendercc/seleniumTests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codebendercc/seleniumTests/downloads","issues_url":"https://api.github.com/repos/codebendercc/seleniumTests/issues{/number}","pulls_url":"https://api.github.com/repos/codebendercc/seleniumTests/pulls{/number}","milestones_url":"https://api.github.com/repos/codebendercc/seleniumTests/milestones{/number}","notifications_url":"https://api.github.com/repos/codebendercc/seleniumTests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codebendercc/seleniumTests/labels{/name}","releases_url":"https://api.github.com/repos/codebendercc/seleniumTests/releases{/id}","deployments_url":"https://api.github.com/repos/codebendercc/seleniumTests/deployments","created_at":"2015-02-01T16:25:44Z","updated_at":"2016-01-13T07:54:41Z","pushed_at":"2016-07-04T06:39:09Z","git_url":"git://github.com/codebendercc/seleniumTests.git","ssh_url":"git@github.com:codebendercc/seleniumTests.git","clone_url":"https://github.com/codebendercc/seleniumTests.git","svn_url":"https://github.com/codebendercc/seleniumTests","homepage":null,"size":18656,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codebendercc/seleniumTests/pulls/36"},"html":{"href":"https://github.com/codebendercc/seleniumTests/pull/36"},"issue":{"href":"https://api.github.com/repos/codebendercc/seleniumTests/issues/36"},"comments":{"href":"https://api.github.com/repos/codebendercc/seleniumTests/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/codebendercc/seleniumTests/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/codebendercc/seleniumTests/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codebendercc/seleniumTests/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/codebendercc/seleniumTests/statuses/a331a1f4b0e6725f73299ea39873b8e8845961cd"}}}}
{"actor":{"display_login":"tsiknas"}}