{"action":"created","comment":{"url":"https://api.github.com/repos/dkotegov/home-assignment-4/pulls/comments/45906216","id":45906216,"diff_hunk":"@@ -0,0 +1,178 @@\n+# -*- coding: utf-8 -*-\n+import os\n+import time\n+from Pages import  AskPage, MyRoomPage, AuthPage\n+from unittest import TestCase\n+from selenium.webdriver import DesiredCapabilities, Remote\n+__author__ = 'ivansemenov'\n+\n+\n+class SimpleTest(TestCase):\n+    FIRST_U_PASSWORD = os.environ['TTHA2PASSWORD']\n+    FIRST_USER_EMAIL = 'stotch_leopold@inbox.ru'\n+    FIRST_PROFILE_ID = 'profile/id207816682/'\n+\n+    SECOND_U_PASSWORD = os.environ['TTHA2PASSWORD']\n+    SECOND_U_EMAIL = 'lepold.kot@mail.ru'\n+\n+    QUESTION_TEXT = u'Количество вопросов iframe в Selenium?'\n+    SECOND_TEXT = u'Зачем Всего у вас 97 баллов, вы можете заработать больше? Количество вопросов в сутки зависит от вашего уровня'\n+    CATEGORY_NAME = 'Программирование'\n+    SUBCATEGORY_NAME = 'JavaScript'\n+\n+\n+    def auth_of_user(self, my_room_page):\n+\n+        auth_form = my_room_page.auth_form\n+        auth_form.open_form()\n+        auth_form.set_login(self.FIRST_USER_EMAIL)\n+        auth_form.set_password(self.FIRST_U_PASSWORD)\n+        auth_form.submit()\n+\n+        self.driver.switch_to_window(self.driver.window_handles[-1])\n+\n+    def auth_user_askpage(self, page):\n+        auth_form = page.auth_form\n+        auth_form.set_login(self.FIRST_USER_EMAIL)\n+        auth_form.set_password(self.FIRST_U_PASSWORD)\n+        auth_form.submit()\n+\n+        self.driver.switch_to_window(self.driver.window_handles[-1])\n+\n+\n+    def setUp(self):\n+        browser = os.environ.get('TTHA2BROWSER', 'FIREFOX')\n+\n+        self.driver = Remote(\n+            command_executor='http://127.0.0.1:4444/wd/hub',\n+            desired_capabilities=getattr(DesiredCapabilities, browser).copy()\n+        )\n+\n+\n+    def tearDown(self):\n+        self.driver.quit()\n+\n+\n+    def test_ask_question(self):\n+         ask_page = AskPage(self.driver, PATH='ask')\n+         ask_page.open()\n+\n+         self.auth_user_askpage(ask_page)\n+\n+         ask_form = ask_page.question_form\n+         ask_form.set_question(self.QUESTION_TEXT, self.SECOND_TEXT)\n+         ask_form.set_category(self.CATEGORY_NAME)\n+         ask_form.set_subcategory(self.SUBCATEGORY_NAME)\n+         ask_form.publicate_question()\n+         #time.sleep(10)\n+         url_question = ask_form.get_url_question()\n+\n+         my_room_page = MyRoomPage(self.driver, PATH=self.FIRST_PROFILE_ID)\n+         my_room_page.open()\n+\n+\n+         center_form = my_room_page.center_form\n+\n+         href = center_form.last_quest_in_all()\n+\n+         self.assertEquals(url_question, href)\n+\n+         center_form.go_to_open_question()\n+         href = center_form.last_quest_in_open()\n+\n+         self.assertEquals(url_question, href)\n+\n+\n+\n+\n+\n+    def test_ask_question_button(self):\n+        my_room_page = MyRoomPage(self.driver, PATH=self.FIRST_PROFILE_ID)\n+        my_room_page.open()\n+\n+        self.auth_of_user(my_room_page)\n+\n+        my_room = my_room_page.top_ask_question\n+        url = my_room.ask_question_button()\n+        self.assertEquals(url, 'https://otvet.mail.ru/ask')\n+\n+\n+\n+    def test_go_to_MyWorld(self):\n+        my_room_page = MyRoomPage(self.driver, PATH=self.FIRST_PROFILE_ID)\n+        my_room_page.open()\n+\n+\n+        self.auth_of_user(my_room_page)\n+\n+        my_room = my_room_page.my_room\n+        href = my_room.go_to_my_world()\n+        self.assertEquals(href, 'http://my.mail.ru/')\n+\n+\n+    def test_authorization(self):\n+        auth_page = AuthPage(self.driver)\n+        auth_page.open()\n+        auth_form = auth_page.form\n+        auth_form.open_form()\n+        auth_form.set_login(self.FIRST_USER_EMAIL)\n+        auth_form.set_password(self.FIRST_U_PASSWORD)\n+        auth_form.submit()\n+\n+        top_menu = auth_page.top_menu\n+        name = top_menu.get_name()\n+        print (name)","path":"tests.py","position":124,"original_position":124,"commit_id":"e3dd94a03d031ca09bdc90f9c61dbca9306f78ea","original_commit_id":"e3dd94a03d031ca09bdc90f9c61dbca9306f78ea","user":{"login":"dkotegov","id":11413412,"avatar_url":"https://avatars.githubusercontent.com/u/11413412?v=3","gravatar_id":"","url":"https://api.github.com/users/dkotegov","html_url":"https://github.com/dkotegov","followers_url":"https://api.github.com/users/dkotegov/followers","following_url":"https://api.github.com/users/dkotegov/following{/other_user}","gists_url":"https://api.github.com/users/dkotegov/gists{/gist_id}","starred_url":"https://api.github.com/users/dkotegov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkotegov/subscriptions","organizations_url":"https://api.github.com/users/dkotegov/orgs","repos_url":"https://api.github.com/users/dkotegov/repos","events_url":"https://api.github.com/users/dkotegov/events{/privacy}","received_events_url":"https://api.github.com/users/dkotegov/received_events","type":"User","site_admin":false},"body":"Не забывайте убирать дебажные принты ;)","created_at":"2015-11-25T19:01:20Z","updated_at":"2015-11-25T19:01:20Z","html_url":"https://github.com/dkotegov/home-assignment-4/pull/2#discussion_r45906216","pull_request_url":"https://api.github.com/repos/dkotegov/home-assignment-4/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/dkotegov/home-assignment-4/pulls/comments/45906216"},"html":{"href":"https://github.com/dkotegov/home-assignment-4/pull/2#discussion_r45906216"},"pull_request":{"href":"https://api.github.com/repos/dkotegov/home-assignment-4/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/dkotegov/home-assignment-4/pulls/2","id":51558258,"html_url":"https://github.com/dkotegov/home-assignment-4/pull/2","diff_url":"https://github.com/dkotegov/home-assignment-4/pull/2.diff","patch_url":"https://github.com/dkotegov/home-assignment-4/pull/2.patch","issue_url":"https://api.github.com/repos/dkotegov/home-assignment-4/issues/2","number":2,"state":"open","locked":false,"title":"Добрый день!","user":{"login":"Vasiliy-tech","id":11043778,"avatar_url":"https://avatars.githubusercontent.com/u/11043778?v=3","gravatar_id":"","url":"https://api.github.com/users/Vasiliy-tech","html_url":"https://github.com/Vasiliy-tech","followers_url":"https://api.github.com/users/Vasiliy-tech/followers","following_url":"https://api.github.com/users/Vasiliy-tech/following{/other_user}","gists_url":"https://api.github.com/users/Vasiliy-tech/gists{/gist_id}","starred_url":"https://api.github.com/users/Vasiliy-tech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vasiliy-tech/subscriptions","organizations_url":"https://api.github.com/users/Vasiliy-tech/orgs","repos_url":"https://api.github.com/users/Vasiliy-tech/repos","events_url":"https://api.github.com/users/Vasiliy-tech/events{/privacy}","received_events_url":"https://api.github.com/users/Vasiliy-tech/received_events","type":"User","site_admin":false},"body":"Добрый день!\r\n\r\nВыполнили домашнее задание, просим проверить.\r\n\r\nС уважением,\r\nКопытов,\r\nСеменов.","created_at":"2015-11-23T18:05:40Z","updated_at":"2015-11-25T19:01:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3faee0dc2fd810bcfc9d550eab7edbb60e80927d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dkotegov/home-assignment-4/pulls/2/commits","review_comments_url":"https://api.github.com/repos/dkotegov/home-assignment-4/pulls/2/comments","review_comment_url":"https://api.github.com/repos/dkotegov/home-assignment-4/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dkotegov/home-assignment-4/issues/2/comments","statuses_url":"https://api.github.com/repos/dkotegov/home-assignment-4/statuses/e3dd94a03d031ca09bdc90f9c61dbca9306f78ea","head":{"label":"Vasiliy-tech:master","ref":"master","sha":"e3dd94a03d031ca09bdc90f9c61dbca9306f78ea","user":{"login":"Vasiliy-tech","id":11043778,"avatar_url":"https://avatars.githubusercontent.com/u/11043778?v=3","gravatar_id":"","url":"https://api.github.com/users/Vasiliy-tech","html_url":"https://github.com/Vasiliy-tech","followers_url":"https://api.github.com/users/Vasiliy-tech/followers","following_url":"https://api.github.com/users/Vasiliy-tech/following{/other_user}","gists_url":"https://api.github.com/users/Vasiliy-tech/gists{/gist_id}","starred_url":"https://api.github.com/users/Vasiliy-tech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vasiliy-tech/subscriptions","organizations_url":"https://api.github.com/users/Vasiliy-tech/orgs","repos_url":"https://api.github.com/users/Vasiliy-tech/repos","events_url":"https://api.github.com/users/Vasiliy-tech/events{/privacy}","received_events_url":"https://api.github.com/users/Vasiliy-tech/received_events","type":"User","site_admin":false},"repo":{"id":46413463,"name":"home-assignment-4","full_name":"Vasiliy-tech/home-assignment-4","owner":{"login":"Vasiliy-tech","id":11043778,"avatar_url":"https://avatars.githubusercontent.com/u/11043778?v=3","gravatar_id":"","url":"https://api.github.com/users/Vasiliy-tech","html_url":"https://github.com/Vasiliy-tech","followers_url":"https://api.github.com/users/Vasiliy-tech/followers","following_url":"https://api.github.com/users/Vasiliy-tech/following{/other_user}","gists_url":"https://api.github.com/users/Vasiliy-tech/gists{/gist_id}","starred_url":"https://api.github.com/users/Vasiliy-tech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vasiliy-tech/subscriptions","organizations_url":"https://api.github.com/users/Vasiliy-tech/orgs","repos_url":"https://api.github.com/users/Vasiliy-tech/repos","events_url":"https://api.github.com/users/Vasiliy-tech/events{/privacy}","received_events_url":"https://api.github.com/users/Vasiliy-tech/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Vasiliy-tech/home-assignment-4","description":"","fork":true,"url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4","forks_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/forks","keys_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/teams","hooks_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/hooks","issue_events_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/issues/events{/number}","events_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/events","assignees_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/assignees{/user}","branches_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/branches{/branch}","tags_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/tags","blobs_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/git/refs{/sha}","trees_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/statuses/{sha}","languages_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/languages","stargazers_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/stargazers","contributors_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/contributors","subscribers_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/subscribers","subscription_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/subscription","commits_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/commits{/sha}","git_commits_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/git/commits{/sha}","comments_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/comments{/number}","issue_comment_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/issues/comments{/number}","contents_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/contents/{+path}","compare_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/merges","archive_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/downloads","issues_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/issues{/number}","pulls_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/pulls{/number}","milestones_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/milestones{/number}","notifications_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/labels{/name}","releases_url":"https://api.github.com/repos/Vasiliy-tech/home-assignment-4/releases{/id}","created_at":"2015-11-18T11:07:14Z","updated_at":"2015-11-18T11:07:15Z","pushed_at":"2015-11-25T00:13:13Z","git_url":"git://github.com/Vasiliy-tech/home-assignment-4.git","ssh_url":"git@github.com:Vasiliy-tech/home-assignment-4.git","clone_url":"https://github.com/Vasiliy-tech/home-assignment-4.git","svn_url":"https://github.com/Vasiliy-tech/home-assignment-4","homepage":null,"size":33405,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"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":"master"}},"base":{"label":"dkotegov:master","ref":"master","sha":"31868154004e665d212a845ec1fd3bf8abe47a97","user":{"login":"dkotegov","id":11413412,"avatar_url":"https://avatars.githubusercontent.com/u/11413412?v=3","gravatar_id":"","url":"https://api.github.com/users/dkotegov","html_url":"https://github.com/dkotegov","followers_url":"https://api.github.com/users/dkotegov/followers","following_url":"https://api.github.com/users/dkotegov/following{/other_user}","gists_url":"https://api.github.com/users/dkotegov/gists{/gist_id}","starred_url":"https://api.github.com/users/dkotegov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkotegov/subscriptions","organizations_url":"https://api.github.com/users/dkotegov/orgs","repos_url":"https://api.github.com/users/dkotegov/repos","events_url":"https://api.github.com/users/dkotegov/events{/privacy}","received_events_url":"https://api.github.com/users/dkotegov/received_events","type":"User","site_admin":false},"repo":{"id":45605358,"name":"home-assignment-4","full_name":"dkotegov/home-assignment-4","owner":{"login":"dkotegov","id":11413412,"avatar_url":"https://avatars.githubusercontent.com/u/11413412?v=3","gravatar_id":"","url":"https://api.github.com/users/dkotegov","html_url":"https://github.com/dkotegov","followers_url":"https://api.github.com/users/dkotegov/followers","following_url":"https://api.github.com/users/dkotegov/following{/other_user}","gists_url":"https://api.github.com/users/dkotegov/gists{/gist_id}","starred_url":"https://api.github.com/users/dkotegov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkotegov/subscriptions","organizations_url":"https://api.github.com/users/dkotegov/orgs","repos_url":"https://api.github.com/users/dkotegov/repos","events_url":"https://api.github.com/users/dkotegov/events{/privacy}","received_events_url":"https://api.github.com/users/dkotegov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dkotegov/home-assignment-4","description":"","fork":false,"url":"https://api.github.com/repos/dkotegov/home-assignment-4","forks_url":"https://api.github.com/repos/dkotegov/home-assignment-4/forks","keys_url":"https://api.github.com/repos/dkotegov/home-assignment-4/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dkotegov/home-assignment-4/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dkotegov/home-assignment-4/teams","hooks_url":"https://api.github.com/repos/dkotegov/home-assignment-4/hooks","issue_events_url":"https://api.github.com/repos/dkotegov/home-assignment-4/issues/events{/number}","events_url":"https://api.github.com/repos/dkotegov/home-assignment-4/events","assignees_url":"https://api.github.com/repos/dkotegov/home-assignment-4/assignees{/user}","branches_url":"https://api.github.com/repos/dkotegov/home-assignment-4/branches{/branch}","tags_url":"https://api.github.com/repos/dkotegov/home-assignment-4/tags","blobs_url":"https://api.github.com/repos/dkotegov/home-assignment-4/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dkotegov/home-assignment-4/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dkotegov/home-assignment-4/git/refs{/sha}","trees_url":"https://api.github.com/repos/dkotegov/home-assignment-4/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dkotegov/home-assignment-4/statuses/{sha}","languages_url":"https://api.github.com/repos/dkotegov/home-assignment-4/languages","stargazers_url":"https://api.github.com/repos/dkotegov/home-assignment-4/stargazers","contributors_url":"https://api.github.com/repos/dkotegov/home-assignment-4/contributors","subscribers_url":"https://api.github.com/repos/dkotegov/home-assignment-4/subscribers","subscription_url":"https://api.github.com/repos/dkotegov/home-assignment-4/subscription","commits_url":"https://api.github.com/repos/dkotegov/home-assignment-4/commits{/sha}","git_commits_url":"https://api.github.com/repos/dkotegov/home-assignment-4/git/commits{/sha}","comments_url":"https://api.github.com/repos/dkotegov/home-assignment-4/comments{/number}","issue_comment_url":"https://api.github.com/repos/dkotegov/home-assignment-4/issues/comments{/number}","contents_url":"https://api.github.com/repos/dkotegov/home-assignment-4/contents/{+path}","compare_url":"https://api.github.com/repos/dkotegov/home-assignment-4/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dkotegov/home-assignment-4/merges","archive_url":"https://api.github.com/repos/dkotegov/home-assignment-4/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dkotegov/home-assignment-4/downloads","issues_url":"https://api.github.com/repos/dkotegov/home-assignment-4/issues{/number}","pulls_url":"https://api.github.com/repos/dkotegov/home-assignment-4/pulls{/number}","milestones_url":"https://api.github.com/repos/dkotegov/home-assignment-4/milestones{/number}","notifications_url":"https://api.github.com/repos/dkotegov/home-assignment-4/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dkotegov/home-assignment-4/labels{/name}","releases_url":"https://api.github.com/repos/dkotegov/home-assignment-4/releases{/id}","created_at":"2015-11-05T10:49:53Z","updated_at":"2015-11-05T11:00:40Z","pushed_at":"2015-11-25T18:34:14Z","git_url":"git://github.com/dkotegov/home-assignment-4.git","ssh_url":"git@github.com:dkotegov/home-assignment-4.git","clone_url":"https://github.com/dkotegov/home-assignment-4.git","svn_url":"https://github.com/dkotegov/home-assignment-4","homepage":null,"size":120,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":7,"forks":13,"open_issues":7,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dkotegov/home-assignment-4/pulls/2"},"html":{"href":"https://github.com/dkotegov/home-assignment-4/pull/2"},"issue":{"href":"https://api.github.com/repos/dkotegov/home-assignment-4/issues/2"},"comments":{"href":"https://api.github.com/repos/dkotegov/home-assignment-4/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/dkotegov/home-assignment-4/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/dkotegov/home-assignment-4/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dkotegov/home-assignment-4/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/dkotegov/home-assignment-4/statuses/e3dd94a03d031ca09bdc90f9c61dbca9306f78ea"}}}}