{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-e2e-tests/pulls/comments/71871378","id":71871378,"diff_hunk":"@@ -0,0 +1,84 @@\n+\"\"\"\n+Test uploaded files.\n+\"\"\"\n+from bok_choy.web_app_test import WebAppTest\n+\n+from regression.pages.studio.utils import upload_new_file\n+from regression.pages.studio.login_studio import StudioLogin\n+from regression.tests.helpers import LoginHelper, get_course_info\n+\n+from regression.pages.studio.asset_index_studio import AssetIndexPageExtended\n+\n+\n+class UploadedFileTest(WebAppTest):\n+    \"\"\"\n+    Test uploaded files.\n+    \"\"\"\n+    def setUp(self):\n+        super(UploadedFileTest, self).setUp()\n+        self.login_page = StudioLogin(self.browser)\n+        LoginHelper.login(self.login_page)\n+        self.course_info = get_course_info()\n+\n+        self.asset_page = AssetIndexPageExtended(\n+            self.browser,\n+            self.course_info['org'],\n+            self.course_info['number'],\n+            self.course_info['run']\n+        )\n+        self.asset_page.visit()\n+        self.file_names = [\n+            'README.rst',\n+            'Image.png'\n+        ]\n+\n+    def upload_files(self):\n+        \"\"\"\n+        Uploads files\n+        \"\"\"\n+        # Open file upload prompt.\n+        self.asset_page.open_upload_file_prompt()\n+        # Upload the files.\n+        upload_new_file(self.asset_page, self.file_names)\n+        # Assert that files has been uploaded.\n+        self.assertEqual(self.file_names, self.asset_page.get_file_names())\n+\n+    def test_lock_files(self):\n+        \"\"\"\n+        Tests locking a file in \"Files & uploads\" section of course.\n+        \"\"\"\n+        self.upload_files()\n+        index_of_lock_file = 0\n+        # Lock the asset present at index passed.\n+        self.asset_page.lock_asset(index_of_lock_file)\n+        locked_file_elements = self.asset_page.q(\n+            css='.assets-table tbody tr .actions-col .lock-checkbox')\n+        # Assert that file has been locked.\n+        self.assertTrue(\n+            locked_file_elements.attrs('checked')[index_of_lock_file])\n+\n+    def test_sort_files(self):\n+        \"\"\"\n+        Tests sorting of files present in \"Files & Uploads\"\n+        section of course\n+        \"\"\"\n+        self.upload_files()\n+        initial_order = self.asset_page.get_file_names()\n+        # Sort the assets\n+        self.asset_page.sort_assets()\n+        initial_order.sort()\n+        # Assert that assets has been sorted.\n+        self.assertEqual(initial_order, self.asset_page.get_file_names())\n+\n+    def test_delete_files(self):\n+        \"\"\"\n+        Tests deletion of files present in \"Files & Uploads\"\n+        section of course\n+        \"\"\"\n+        self.upload_files()\n+        # Index of files to be deleted.\n+        file_index_to_delete = [0, 1]\n+        # Delete the files.\n+        self.asset_page.delete_file(file_index_to_delete)\n+        # Assert files has been deleted.\n+        self.assertNotIn(self.file_names, self.asset_page.get_file_names())","path":"regression/tests/studio/test_uploaded_files.py","position":84,"original_position":84,"commit_id":"fcc373273c5542505ce2e5c772fe9bb35bedbdfd","original_commit_id":"fcc373273c5542505ce2e5c772fe9bb35bedbdfd","user":{"login":"muhammad-ammar","id":6767924,"avatar_url":"https://avatars.githubusercontent.com/u/6767924?v=3","gravatar_id":"","url":"https://api.github.com/users/muhammad-ammar","html_url":"https://github.com/muhammad-ammar","followers_url":"https://api.github.com/users/muhammad-ammar/followers","following_url":"https://api.github.com/users/muhammad-ammar/following{/other_user}","gists_url":"https://api.github.com/users/muhammad-ammar/gists{/gist_id}","starred_url":"https://api.github.com/users/muhammad-ammar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muhammad-ammar/subscriptions","organizations_url":"https://api.github.com/users/muhammad-ammar/orgs","repos_url":"https://api.github.com/users/muhammad-ammar/repos","events_url":"https://api.github.com/users/muhammad-ammar/events{/privacy}","received_events_url":"https://api.github.com/users/muhammad-ammar/received_events","type":"User","site_admin":false},"body":"@Muddasser Add BDD style docstrings for tests in this file.","created_at":"2016-07-22T12:35:32Z","updated_at":"2016-07-22T12:35:32Z","html_url":"https://github.com/edx/edx-e2e-tests/pull/67#discussion_r71871378","pull_request_url":"https://api.github.com/repos/edx/edx-e2e-tests/pulls/67","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-e2e-tests/pulls/comments/71871378"},"html":{"href":"https://github.com/edx/edx-e2e-tests/pull/67#discussion_r71871378"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-e2e-tests/pulls/67"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-e2e-tests/pulls/67","id":77971337,"html_url":"https://github.com/edx/edx-e2e-tests/pull/67","diff_url":"https://github.com/edx/edx-e2e-tests/pull/67.diff","patch_url":"https://github.com/edx/edx-e2e-tests/pull/67.patch","issue_url":"https://api.github.com/repos/edx/edx-e2e-tests/issues/67","number":67,"state":"open","locked":false,"title":"TE-1516 Automated upload file regression scenarios","user":{"login":"Muddasser","id":4279899,"avatar_url":"https://avatars.githubusercontent.com/u/4279899?v=3","gravatar_id":"","url":"https://api.github.com/users/Muddasser","html_url":"https://github.com/Muddasser","followers_url":"https://api.github.com/users/Muddasser/followers","following_url":"https://api.github.com/users/Muddasser/following{/other_user}","gists_url":"https://api.github.com/users/Muddasser/gists{/gist_id}","starred_url":"https://api.github.com/users/Muddasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Muddasser/subscriptions","organizations_url":"https://api.github.com/users/Muddasser/orgs","repos_url":"https://api.github.com/users/Muddasser/repos","events_url":"https://api.github.com/users/Muddasser/events{/privacy}","received_events_url":"https://api.github.com/users/Muddasser/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-19T12:59:51Z","updated_at":"2016-07-22T12:35:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5a210a253b50c6a32e0390fb699d19179aedd4ea","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-e2e-tests/pulls/67/commits","review_comments_url":"https://api.github.com/repos/edx/edx-e2e-tests/pulls/67/comments","review_comment_url":"https://api.github.com/repos/edx/edx-e2e-tests/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-e2e-tests/issues/67/comments","statuses_url":"https://api.github.com/repos/edx/edx-e2e-tests/statuses/fcc373273c5542505ce2e5c772fe9bb35bedbdfd","head":{"label":"edx:muddasser/file_upload","ref":"muddasser/file_upload","sha":"fcc373273c5542505ce2e5c772fe9bb35bedbdfd","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":13808625,"name":"edx-e2e-tests","full_name":"edx/edx-e2e-tests","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-e2e-tests","description":"End-to-end tests for edx applications","fork":false,"url":"https://api.github.com/repos/edx/edx-e2e-tests","forks_url":"https://api.github.com/repos/edx/edx-e2e-tests/forks","keys_url":"https://api.github.com/repos/edx/edx-e2e-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-e2e-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-e2e-tests/teams","hooks_url":"https://api.github.com/repos/edx/edx-e2e-tests/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-e2e-tests/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-e2e-tests/events","assignees_url":"https://api.github.com/repos/edx/edx-e2e-tests/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-e2e-tests/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-e2e-tests/tags","blobs_url":"https://api.github.com/repos/edx/edx-e2e-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-e2e-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-e2e-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-e2e-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-e2e-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-e2e-tests/languages","stargazers_url":"https://api.github.com/repos/edx/edx-e2e-tests/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-e2e-tests/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-e2e-tests/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-e2e-tests/subscription","commits_url":"https://api.github.com/repos/edx/edx-e2e-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-e2e-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-e2e-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-e2e-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-e2e-tests/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-e2e-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-e2e-tests/merges","archive_url":"https://api.github.com/repos/edx/edx-e2e-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-e2e-tests/downloads","issues_url":"https://api.github.com/repos/edx/edx-e2e-tests/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-e2e-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-e2e-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-e2e-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-e2e-tests/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-e2e-tests/releases{/id}","deployments_url":"https://api.github.com/repos/edx/edx-e2e-tests/deployments","created_at":"2013-10-23T16:45:07Z","updated_at":"2016-06-24T17:39:20Z","pushed_at":"2016-07-22T11:56:47Z","git_url":"git://github.com/edx/edx-e2e-tests.git","ssh_url":"git@github.com:edx/edx-e2e-tests.git","clone_url":"https://github.com/edx/edx-e2e-tests.git","svn_url":"https://github.com/edx/edx-e2e-tests","homepage":null,"size":10658,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":2,"forks":7,"open_issues":2,"watchers":2,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"489f4cdf116cbc5e052f0cbb3cf87fae5dc9d1a3","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":13808625,"name":"edx-e2e-tests","full_name":"edx/edx-e2e-tests","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-e2e-tests","description":"End-to-end tests for edx applications","fork":false,"url":"https://api.github.com/repos/edx/edx-e2e-tests","forks_url":"https://api.github.com/repos/edx/edx-e2e-tests/forks","keys_url":"https://api.github.com/repos/edx/edx-e2e-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-e2e-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-e2e-tests/teams","hooks_url":"https://api.github.com/repos/edx/edx-e2e-tests/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-e2e-tests/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-e2e-tests/events","assignees_url":"https://api.github.com/repos/edx/edx-e2e-tests/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-e2e-tests/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-e2e-tests/tags","blobs_url":"https://api.github.com/repos/edx/edx-e2e-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-e2e-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-e2e-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-e2e-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-e2e-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-e2e-tests/languages","stargazers_url":"https://api.github.com/repos/edx/edx-e2e-tests/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-e2e-tests/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-e2e-tests/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-e2e-tests/subscription","commits_url":"https://api.github.com/repos/edx/edx-e2e-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-e2e-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-e2e-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-e2e-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-e2e-tests/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-e2e-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-e2e-tests/merges","archive_url":"https://api.github.com/repos/edx/edx-e2e-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-e2e-tests/downloads","issues_url":"https://api.github.com/repos/edx/edx-e2e-tests/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-e2e-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-e2e-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-e2e-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-e2e-tests/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-e2e-tests/releases{/id}","deployments_url":"https://api.github.com/repos/edx/edx-e2e-tests/deployments","created_at":"2013-10-23T16:45:07Z","updated_at":"2016-06-24T17:39:20Z","pushed_at":"2016-07-22T11:56:47Z","git_url":"git://github.com/edx/edx-e2e-tests.git","ssh_url":"git@github.com:edx/edx-e2e-tests.git","clone_url":"https://github.com/edx/edx-e2e-tests.git","svn_url":"https://github.com/edx/edx-e2e-tests","homepage":null,"size":10658,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":2,"forks":7,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-e2e-tests/pulls/67"},"html":{"href":"https://github.com/edx/edx-e2e-tests/pull/67"},"issue":{"href":"https://api.github.com/repos/edx/edx-e2e-tests/issues/67"},"comments":{"href":"https://api.github.com/repos/edx/edx-e2e-tests/issues/67/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-e2e-tests/pulls/67/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-e2e-tests/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-e2e-tests/pulls/67/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-e2e-tests/statuses/fcc373273c5542505ce2e5c772fe9bb35bedbdfd"}}}}
{"actor":{"display_login":"muhammad-ammar"}}