{"action":"created","comment":{"url":"https://api.github.com/repos/oppia/oppia/pulls/comments/40509886","id":40509886,"diff_hunk":"@@ -0,0 +1,63 @@\n+// Copyright 2014 The Oppia Authors. All Rights Reserved.\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//\n+//      http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS-IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+\n+/**\n+ * @fileoverview End-to-end tests of the i18n platform and the completion of\n+ * translations.\n+ *\n+ * @author Milagro Teruel (milagro.teruel@gmail.com)\n+ */\n+\n+var general = require('../protractor_utils/general.js');\n+var gallery = require('../protractor_utils/gallery.js');\n+var users = require('../protractor_utils/users.js');\n+var workflow = require('../protractor_utils/workflow.js');\n+\n+var checkForTranslationIds = function (selector) {\n+  element(by.css('.oppia-base-container')).then(function (value) {\n+    value.getInnerHtml().then(function (promiseValue) {\n+      expect(promiseValue).not.toContain('I18N_GALLERY');\n+    });\n+  });\n+};\n+\n+describe('Gallery page', function() {\n+  it('should not have any non translated strings', function() {\n+    var EXPLORATION_SILMARILS = 'silmarils';\n+    var EXPLORATION_VINGILOT = 'Vingilot';\n+    var CATEGORY_ENVIRONMENT = 'Environment';\n+    var CATEGORY_BUSINESS = 'Business';\n+    var LANGUAGE_FRANCAIS = 'français';\n+    users.createUser('feanor@exmple.com', 'Feanor');\n+\n+    users.login('feanor@exmple.com');\n+    workflow.createAndPublishExploration(\n+      EXPLORATION_SILMARILS, CATEGORY_BUSINESS,\n+      'hold the light of the two trees', LANGUAGE_FRANCAIS);\n+    workflow.createAndPublishExploration(\n+      EXPLORATION_VINGILOT, CATEGORY_ENVIRONMENT, 'seek the aid of the Valar');\n+    users.logout();\n+\n+    browser.get('/gallery');\n+    checkForTranslationIds();","path":"core/tests/protractor/i18n.js","position":53,"original_position":53,"commit_id":"85b6c80cb0f61e0b02f73b3e078d586b5869cad0","original_commit_id":"85b6c80cb0f61e0b02f73b3e078d586b5869cad0","user":{"login":"seanlip","id":10575562,"avatar_url":"https://avatars.githubusercontent.com/u/10575562?v=3","gravatar_id":"","url":"https://api.github.com/users/seanlip","html_url":"https://github.com/seanlip","followers_url":"https://api.github.com/users/seanlip/followers","following_url":"https://api.github.com/users/seanlip/following{/other_user}","gists_url":"https://api.github.com/users/seanlip/gists{/gist_id}","starred_url":"https://api.github.com/users/seanlip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanlip/subscriptions","organizations_url":"https://api.github.com/users/seanlip/orgs","repos_url":"https://api.github.com/users/seanlip/repos","events_url":"https://api.github.com/users/seanlip/events{/privacy}","received_events_url":"https://api.github.com/users/seanlip/received_events","type":"User","site_admin":false},"body":"Ah, I see. Thanks for explaining!\r\n\r\nI would implement a function in protractor_utils/general.js called general.ensurePageHasNoTranslationIds(), and call it from the various test suites as desired. The new name also makes the intention of the function clearer, I think.\r\n\r\nAnd then, I'd lean towards adding the test that's here into the gallery.js file as a separate describe/it block, since it's really only testing the gallery and our tests are currently grouped by the page being tested. In that test, you could just add a check for one string that's not too likely to change (and if it does change, we'll change it going forward; if this becomes too much of a burden, we'll revisit). The alternative is to implement a dummy set of translations that is meant to be only used for tests; this has the benefit that there'll be no need to change the dummy set, but then we'd have to ensure it's turned on for the integration tests and not otherwise -- which seems like a fair amount of work. So I think that, for now, it would be simpler to just test for a single string in one of the pages.","created_at":"2015-09-27T21:16:33Z","updated_at":"2015-09-27T21:16:33Z","html_url":"https://github.com/oppia/oppia/pull/948#discussion_r40509886","pull_request_url":"https://api.github.com/repos/oppia/oppia/pulls/948","_links":{"self":{"href":"https://api.github.com/repos/oppia/oppia/pulls/comments/40509886"},"html":{"href":"https://github.com/oppia/oppia/pull/948#discussion_r40509886"},"pull_request":{"href":"https://api.github.com/repos/oppia/oppia/pulls/948"}}},"pull_request":{"url":"https://api.github.com/repos/oppia/oppia/pulls/948","id":44316548,"html_url":"https://github.com/oppia/oppia/pull/948","diff_url":"https://github.com/oppia/oppia/pull/948.diff","patch_url":"https://github.com/oppia/oppia/pull/948.patch","issue_url":"https://api.github.com/repos/oppia/oppia/issues/948","number":948,"state":"open","locked":false,"title":"I18n issue 103","user":{"login":"mit0110","id":5737003,"avatar_url":"https://avatars.githubusercontent.com/u/5737003?v=3","gravatar_id":"","url":"https://api.github.com/users/mit0110","html_url":"https://github.com/mit0110","followers_url":"https://api.github.com/users/mit0110/followers","following_url":"https://api.github.com/users/mit0110/following{/other_user}","gists_url":"https://api.github.com/users/mit0110/gists{/gist_id}","starred_url":"https://api.github.com/users/mit0110/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mit0110/subscriptions","organizations_url":"https://api.github.com/users/mit0110/orgs","repos_url":"https://api.github.com/users/mit0110/repos","events_url":"https://api.github.com/users/mit0110/events{/privacy}","received_events_url":"https://api.github.com/users/mit0110/received_events","type":"User","site_admin":false},"body":"This pull request contains:\r\n-- The fixes based on the comments of Sean's last code review.\r\n-- Fixes for a bug (strings not translated after filtering explorations in the gallery) and for a failure in the tests, where the original strings were replaced for the translations ids,\r\n-- A first approximation to integration tests for i18n. This would have detected the bug from the previous point. The downside is each test takes a while because is creating explorations. I took the initiative here because I wanted to learn how to use Protractor, they can be removed with no problem!","created_at":"2015-09-07T02:58:18Z","updated_at":"2015-09-27T21:16:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a228e1a219dda09aa08e760c4f1a10462402dbce","assignee":{"login":"seanlip","id":10575562,"avatar_url":"https://avatars.githubusercontent.com/u/10575562?v=3","gravatar_id":"","url":"https://api.github.com/users/seanlip","html_url":"https://github.com/seanlip","followers_url":"https://api.github.com/users/seanlip/followers","following_url":"https://api.github.com/users/seanlip/following{/other_user}","gists_url":"https://api.github.com/users/seanlip/gists{/gist_id}","starred_url":"https://api.github.com/users/seanlip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanlip/subscriptions","organizations_url":"https://api.github.com/users/seanlip/orgs","repos_url":"https://api.github.com/users/seanlip/repos","events_url":"https://api.github.com/users/seanlip/events{/privacy}","received_events_url":"https://api.github.com/users/seanlip/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/oppia/oppia/pulls/948/commits","review_comments_url":"https://api.github.com/repos/oppia/oppia/pulls/948/comments","review_comment_url":"https://api.github.com/repos/oppia/oppia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oppia/oppia/issues/948/comments","statuses_url":"https://api.github.com/repos/oppia/oppia/statuses/85b6c80cb0f61e0b02f73b3e078d586b5869cad0","head":{"label":"mit0110:i18n-issue-103","ref":"i18n-issue-103","sha":"85b6c80cb0f61e0b02f73b3e078d586b5869cad0","user":{"login":"mit0110","id":5737003,"avatar_url":"https://avatars.githubusercontent.com/u/5737003?v=3","gravatar_id":"","url":"https://api.github.com/users/mit0110","html_url":"https://github.com/mit0110","followers_url":"https://api.github.com/users/mit0110/followers","following_url":"https://api.github.com/users/mit0110/following{/other_user}","gists_url":"https://api.github.com/users/mit0110/gists{/gist_id}","starred_url":"https://api.github.com/users/mit0110/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mit0110/subscriptions","organizations_url":"https://api.github.com/users/mit0110/orgs","repos_url":"https://api.github.com/users/mit0110/repos","events_url":"https://api.github.com/users/mit0110/events{/privacy}","received_events_url":"https://api.github.com/users/mit0110/received_events","type":"User","site_admin":false},"repo":{"id":41835426,"name":"oppia","full_name":"mit0110/oppia","owner":{"login":"mit0110","id":5737003,"avatar_url":"https://avatars.githubusercontent.com/u/5737003?v=3","gravatar_id":"","url":"https://api.github.com/users/mit0110","html_url":"https://github.com/mit0110","followers_url":"https://api.github.com/users/mit0110/followers","following_url":"https://api.github.com/users/mit0110/following{/other_user}","gists_url":"https://api.github.com/users/mit0110/gists{/gist_id}","starred_url":"https://api.github.com/users/mit0110/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mit0110/subscriptions","organizations_url":"https://api.github.com/users/mit0110/orgs","repos_url":"https://api.github.com/users/mit0110/repos","events_url":"https://api.github.com/users/mit0110/events{/privacy}","received_events_url":"https://api.github.com/users/mit0110/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mit0110/oppia","description":"Tool for creating interactive tutors.","fork":true,"url":"https://api.github.com/repos/mit0110/oppia","forks_url":"https://api.github.com/repos/mit0110/oppia/forks","keys_url":"https://api.github.com/repos/mit0110/oppia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mit0110/oppia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mit0110/oppia/teams","hooks_url":"https://api.github.com/repos/mit0110/oppia/hooks","issue_events_url":"https://api.github.com/repos/mit0110/oppia/issues/events{/number}","events_url":"https://api.github.com/repos/mit0110/oppia/events","assignees_url":"https://api.github.com/repos/mit0110/oppia/assignees{/user}","branches_url":"https://api.github.com/repos/mit0110/oppia/branches{/branch}","tags_url":"https://api.github.com/repos/mit0110/oppia/tags","blobs_url":"https://api.github.com/repos/mit0110/oppia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mit0110/oppia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mit0110/oppia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mit0110/oppia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mit0110/oppia/statuses/{sha}","languages_url":"https://api.github.com/repos/mit0110/oppia/languages","stargazers_url":"https://api.github.com/repos/mit0110/oppia/stargazers","contributors_url":"https://api.github.com/repos/mit0110/oppia/contributors","subscribers_url":"https://api.github.com/repos/mit0110/oppia/subscribers","subscription_url":"https://api.github.com/repos/mit0110/oppia/subscription","commits_url":"https://api.github.com/repos/mit0110/oppia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mit0110/oppia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mit0110/oppia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mit0110/oppia/issues/comments{/number}","contents_url":"https://api.github.com/repos/mit0110/oppia/contents/{+path}","compare_url":"https://api.github.com/repos/mit0110/oppia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mit0110/oppia/merges","archive_url":"https://api.github.com/repos/mit0110/oppia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mit0110/oppia/downloads","issues_url":"https://api.github.com/repos/mit0110/oppia/issues{/number}","pulls_url":"https://api.github.com/repos/mit0110/oppia/pulls{/number}","milestones_url":"https://api.github.com/repos/mit0110/oppia/milestones{/number}","notifications_url":"https://api.github.com/repos/mit0110/oppia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mit0110/oppia/labels{/name}","releases_url":"https://api.github.com/repos/mit0110/oppia/releases{/id}","created_at":"2015-09-03T00:56:07Z","updated_at":"2015-09-03T00:56:09Z","pushed_at":"2015-09-07T02:56:04Z","git_url":"git://github.com/mit0110/oppia.git","ssh_url":"git@github.com:mit0110/oppia.git","clone_url":"https://github.com/mit0110/oppia.git","svn_url":"https://github.com/mit0110/oppia","homepage":"https://www.oppia.org","size":36955,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"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":"develop"}},"base":{"label":"oppia:i18n-issue-103","ref":"i18n-issue-103","sha":"1c404b6158337ca2f6bdaedf41f56c502e6ae1fb","user":{"login":"oppia","id":11620230,"avatar_url":"https://avatars.githubusercontent.com/u/11620230?v=3","gravatar_id":"","url":"https://api.github.com/users/oppia","html_url":"https://github.com/oppia","followers_url":"https://api.github.com/users/oppia/followers","following_url":"https://api.github.com/users/oppia/following{/other_user}","gists_url":"https://api.github.com/users/oppia/gists{/gist_id}","starred_url":"https://api.github.com/users/oppia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oppia/subscriptions","organizations_url":"https://api.github.com/users/oppia/orgs","repos_url":"https://api.github.com/users/oppia/repos","events_url":"https://api.github.com/users/oppia/events{/privacy}","received_events_url":"https://api.github.com/users/oppia/received_events","type":"Organization","site_admin":false},"repo":{"id":40687563,"name":"oppia","full_name":"oppia/oppia","owner":{"login":"oppia","id":11620230,"avatar_url":"https://avatars.githubusercontent.com/u/11620230?v=3","gravatar_id":"","url":"https://api.github.com/users/oppia","html_url":"https://github.com/oppia","followers_url":"https://api.github.com/users/oppia/followers","following_url":"https://api.github.com/users/oppia/following{/other_user}","gists_url":"https://api.github.com/users/oppia/gists{/gist_id}","starred_url":"https://api.github.com/users/oppia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oppia/subscriptions","organizations_url":"https://api.github.com/users/oppia/orgs","repos_url":"https://api.github.com/users/oppia/repos","events_url":"https://api.github.com/users/oppia/events{/privacy}","received_events_url":"https://api.github.com/users/oppia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oppia/oppia","description":"Tool for creating interactive tutors.","fork":false,"url":"https://api.github.com/repos/oppia/oppia","forks_url":"https://api.github.com/repos/oppia/oppia/forks","keys_url":"https://api.github.com/repos/oppia/oppia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oppia/oppia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oppia/oppia/teams","hooks_url":"https://api.github.com/repos/oppia/oppia/hooks","issue_events_url":"https://api.github.com/repos/oppia/oppia/issues/events{/number}","events_url":"https://api.github.com/repos/oppia/oppia/events","assignees_url":"https://api.github.com/repos/oppia/oppia/assignees{/user}","branches_url":"https://api.github.com/repos/oppia/oppia/branches{/branch}","tags_url":"https://api.github.com/repos/oppia/oppia/tags","blobs_url":"https://api.github.com/repos/oppia/oppia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oppia/oppia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oppia/oppia/git/refs{/sha}","trees_url":"https://api.github.com/repos/oppia/oppia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oppia/oppia/statuses/{sha}","languages_url":"https://api.github.com/repos/oppia/oppia/languages","stargazers_url":"https://api.github.com/repos/oppia/oppia/stargazers","contributors_url":"https://api.github.com/repos/oppia/oppia/contributors","subscribers_url":"https://api.github.com/repos/oppia/oppia/subscribers","subscription_url":"https://api.github.com/repos/oppia/oppia/subscription","commits_url":"https://api.github.com/repos/oppia/oppia/commits{/sha}","git_commits_url":"https://api.github.com/repos/oppia/oppia/git/commits{/sha}","comments_url":"https://api.github.com/repos/oppia/oppia/comments{/number}","issue_comment_url":"https://api.github.com/repos/oppia/oppia/issues/comments{/number}","contents_url":"https://api.github.com/repos/oppia/oppia/contents/{+path}","compare_url":"https://api.github.com/repos/oppia/oppia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oppia/oppia/merges","archive_url":"https://api.github.com/repos/oppia/oppia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oppia/oppia/downloads","issues_url":"https://api.github.com/repos/oppia/oppia/issues{/number}","pulls_url":"https://api.github.com/repos/oppia/oppia/pulls{/number}","milestones_url":"https://api.github.com/repos/oppia/oppia/milestones{/number}","notifications_url":"https://api.github.com/repos/oppia/oppia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oppia/oppia/labels{/name}","releases_url":"https://api.github.com/repos/oppia/oppia/releases{/id}","created_at":"2015-08-14T00:16:14Z","updated_at":"2015-09-27T20:23:23Z","pushed_at":"2015-09-27T20:34:54Z","git_url":"git://github.com/oppia/oppia.git","ssh_url":"git@github.com:oppia/oppia.git","clone_url":"https://github.com/oppia/oppia.git","svn_url":"https://github.com/oppia/oppia","homepage":"https://www.oppia.org","size":43221,"stargazers_count":38,"watchers_count":38,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":167,"forks":46,"open_issues":167,"watchers":38,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/oppia/oppia/pulls/948"},"html":{"href":"https://github.com/oppia/oppia/pull/948"},"issue":{"href":"https://api.github.com/repos/oppia/oppia/issues/948"},"comments":{"href":"https://api.github.com/repos/oppia/oppia/issues/948/comments"},"review_comments":{"href":"https://api.github.com/repos/oppia/oppia/pulls/948/comments"},"review_comment":{"href":"https://api.github.com/repos/oppia/oppia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oppia/oppia/pulls/948/commits"},"statuses":{"href":"https://api.github.com/repos/oppia/oppia/statuses/85b6c80cb0f61e0b02f73b3e078d586b5869cad0"}}}}