{"action":"created","comment":{"url":"https://api.github.com/repos/dkotegov/selenium-homework/pulls/comments/92919104","pull_request_review_id":13444278,"id":92919104,"diff_hunk":"@@ -0,0 +1,159 @@\n+# coding=utf-8\n+from seismograph.ext import selenium\n+from seismograph.ext.selenium.exceptions import PollingTimeoutExceeded\n+from seismograph.ext.selenium.query import Contains\n+\n+from utils.xpath_query import XPathQueryObject\n+\n+\n+class PaymentModal(selenium.Page):\n+    buy_link = selenium.PageElement(\n+        XPathQueryObject(\n+            u'//a/span[contains(text(), \"Купить ОКи\")]'\n+        )\n+    )\n+\n+    modal_close_button = selenium.PageElement(\n+        selenium.query(\n+            selenium.query.A,\n+            _id='nohook_modal_close'\n+        )\n+    )\n+\n+    iframe = selenium.PageElement(\n+        selenium.query(\n+            selenium.query.DIV,\n+            _id='pmntWzrdCtr',\n+        )\n+    )\n+\n+    def open(self):\n+        self.browser.execute_script('document.getElementById(\"topPanel\").style.visibility=\"hidden\"')\n+        self.buy_link.click()\n+\n+        try:\n+            self.iframe.wait(10)\n+        except PollingTimeoutExceeded:\n+            self.buy_link.click()\n+\n+    def close(self):\n+        self.modal_close_button.click()\n+\n+    def is_open(self):\n+        return self.iframe.is_displayed()\n+\n+    def switch_to_iframe(self, sel='*'):\n+        self.browser.switch_to.default_content()\n+        frames = self.browser.find_elements_by_css_selector('iframe')\n+\n+        try:\n+            self.iframe.wait(10)\n+        except PollingTimeoutExceeded:\n+            found = False\n+            for frame in frames:\n+                if frame.find_element_by_xpath('..').get_attribute('id') == 'pmntWzrdCtr':\n+                    found = True\n+                    break\n+\n+            if not found:\n+                self.open()\n+                self.iframe.wait(10)\n+\n+        max_els = 0\n+        max_els_frame = 1\n+        for i in range(0, len(frames)):\n+            try:\n+                self.browser.switch_to.frame(i)\n+            except:","path":"pages/payment_modal.py","position":67,"original_position":67,"commit_id":"944666ed841297479e0e8b7e979560adeeffbd37","original_commit_id":"758c9b573dbbbdcf201f1fa554e5f15928a72439","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":"2016-12-17T10:02:01Z","updated_at":"2016-12-17T10:57:28Z","html_url":"https://github.com/dkotegov/selenium-homework/pull/2#discussion_r92919104","pull_request_url":"https://api.github.com/repos/dkotegov/selenium-homework/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/dkotegov/selenium-homework/pulls/comments/92919104"},"html":{"href":"https://github.com/dkotegov/selenium-homework/pull/2#discussion_r92919104"},"pull_request":{"href":"https://api.github.com/repos/dkotegov/selenium-homework/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/dkotegov/selenium-homework/pulls/2","id":97438668,"html_url":"https://github.com/dkotegov/selenium-homework/pull/2","diff_url":"https://github.com/dkotegov/selenium-homework/pull/2.diff","patch_url":"https://github.com/dkotegov/selenium-homework/pull/2.patch","issue_url":"https://api.github.com/repos/dkotegov/selenium-homework/issues/2","number":2,"state":"open","locked":false,"title":"Команда #2","user":{"login":"ValerGit","id":13929288,"avatar_url":"https://avatars.githubusercontent.com/u/13929288?v=3","gravatar_id":"","url":"https://api.github.com/users/ValerGit","html_url":"https://github.com/ValerGit","followers_url":"https://api.github.com/users/ValerGit/followers","following_url":"https://api.github.com/users/ValerGit/following{/other_user}","gists_url":"https://api.github.com/users/ValerGit/gists{/gist_id}","starred_url":"https://api.github.com/users/ValerGit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ValerGit/subscriptions","organizations_url":"https://api.github.com/users/ValerGit/orgs","repos_url":"https://api.github.com/users/ValerGit/repos","events_url":"https://api.github.com/users/ValerGit/events{/privacy}","received_events_url":"https://api.github.com/users/ValerGit/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-10T21:28:49Z","updated_at":"2016-12-17T10:57:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5c0b21d93a98ab747dd4689ab3c6e5c28ca312f1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dkotegov/selenium-homework/pulls/2/commits","review_comments_url":"https://api.github.com/repos/dkotegov/selenium-homework/pulls/2/comments","review_comment_url":"https://api.github.com/repos/dkotegov/selenium-homework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dkotegov/selenium-homework/issues/2/comments","statuses_url":"https://api.github.com/repos/dkotegov/selenium-homework/statuses/944666ed841297479e0e8b7e979560adeeffbd37","head":{"label":"SchadkoAO:master","ref":"master","sha":"944666ed841297479e0e8b7e979560adeeffbd37","user":{"login":"SchadkoAO","id":12786230,"avatar_url":"https://avatars.githubusercontent.com/u/12786230?v=3","gravatar_id":"","url":"https://api.github.com/users/SchadkoAO","html_url":"https://github.com/SchadkoAO","followers_url":"https://api.github.com/users/SchadkoAO/followers","following_url":"https://api.github.com/users/SchadkoAO/following{/other_user}","gists_url":"https://api.github.com/users/SchadkoAO/gists{/gist_id}","starred_url":"https://api.github.com/users/SchadkoAO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SchadkoAO/subscriptions","organizations_url":"https://api.github.com/users/SchadkoAO/orgs","repos_url":"https://api.github.com/users/SchadkoAO/repos","events_url":"https://api.github.com/users/SchadkoAO/events{/privacy}","received_events_url":"https://api.github.com/users/SchadkoAO/received_events","type":"User","site_admin":false},"repo":{"id":74774683,"name":"selenium-homework","full_name":"SchadkoAO/selenium-homework","owner":{"login":"SchadkoAO","id":12786230,"avatar_url":"https://avatars.githubusercontent.com/u/12786230?v=3","gravatar_id":"","url":"https://api.github.com/users/SchadkoAO","html_url":"https://github.com/SchadkoAO","followers_url":"https://api.github.com/users/SchadkoAO/followers","following_url":"https://api.github.com/users/SchadkoAO/following{/other_user}","gists_url":"https://api.github.com/users/SchadkoAO/gists{/gist_id}","starred_url":"https://api.github.com/users/SchadkoAO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SchadkoAO/subscriptions","organizations_url":"https://api.github.com/users/SchadkoAO/orgs","repos_url":"https://api.github.com/users/SchadkoAO/repos","events_url":"https://api.github.com/users/SchadkoAO/events{/privacy}","received_events_url":"https://api.github.com/users/SchadkoAO/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SchadkoAO/selenium-homework","description":null,"fork":true,"url":"https://api.github.com/repos/SchadkoAO/selenium-homework","forks_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/forks","keys_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/teams","hooks_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/hooks","issue_events_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/issues/events{/number}","events_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/events","assignees_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/assignees{/user}","branches_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/branches{/branch}","tags_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/tags","blobs_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/statuses/{sha}","languages_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/languages","stargazers_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/stargazers","contributors_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/contributors","subscribers_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/subscribers","subscription_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/subscription","commits_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/contents/{+path}","compare_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/merges","archive_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/downloads","issues_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/issues{/number}","pulls_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/pulls{/number}","milestones_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/milestones{/number}","notifications_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/labels{/name}","releases_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/releases{/id}","deployments_url":"https://api.github.com/repos/SchadkoAO/selenium-homework/deployments","created_at":"2016-11-25T16:49:35Z","updated_at":"2016-11-25T16:49:36Z","pushed_at":"2016-12-17T10:42:06Z","git_url":"git://github.com/SchadkoAO/selenium-homework.git","ssh_url":"git@github.com:SchadkoAO/selenium-homework.git","clone_url":"https://github.com/SchadkoAO/selenium-homework.git","svn_url":"https://github.com/SchadkoAO/selenium-homework","homepage":null,"size":98505,"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":"e127f105363dfe0fc6b68798a672b7410876d041","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":74622555,"name":"selenium-homework","full_name":"dkotegov/selenium-homework","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/selenium-homework","description":null,"fork":false,"url":"https://api.github.com/repos/dkotegov/selenium-homework","forks_url":"https://api.github.com/repos/dkotegov/selenium-homework/forks","keys_url":"https://api.github.com/repos/dkotegov/selenium-homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dkotegov/selenium-homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dkotegov/selenium-homework/teams","hooks_url":"https://api.github.com/repos/dkotegov/selenium-homework/hooks","issue_events_url":"https://api.github.com/repos/dkotegov/selenium-homework/issues/events{/number}","events_url":"https://api.github.com/repos/dkotegov/selenium-homework/events","assignees_url":"https://api.github.com/repos/dkotegov/selenium-homework/assignees{/user}","branches_url":"https://api.github.com/repos/dkotegov/selenium-homework/branches{/branch}","tags_url":"https://api.github.com/repos/dkotegov/selenium-homework/tags","blobs_url":"https://api.github.com/repos/dkotegov/selenium-homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dkotegov/selenium-homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dkotegov/selenium-homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/dkotegov/selenium-homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dkotegov/selenium-homework/statuses/{sha}","languages_url":"https://api.github.com/repos/dkotegov/selenium-homework/languages","stargazers_url":"https://api.github.com/repos/dkotegov/selenium-homework/stargazers","contributors_url":"https://api.github.com/repos/dkotegov/selenium-homework/contributors","subscribers_url":"https://api.github.com/repos/dkotegov/selenium-homework/subscribers","subscription_url":"https://api.github.com/repos/dkotegov/selenium-homework/subscription","commits_url":"https://api.github.com/repos/dkotegov/selenium-homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/dkotegov/selenium-homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/dkotegov/selenium-homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/dkotegov/selenium-homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/dkotegov/selenium-homework/contents/{+path}","compare_url":"https://api.github.com/repos/dkotegov/selenium-homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dkotegov/selenium-homework/merges","archive_url":"https://api.github.com/repos/dkotegov/selenium-homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dkotegov/selenium-homework/downloads","issues_url":"https://api.github.com/repos/dkotegov/selenium-homework/issues{/number}","pulls_url":"https://api.github.com/repos/dkotegov/selenium-homework/pulls{/number}","milestones_url":"https://api.github.com/repos/dkotegov/selenium-homework/milestones{/number}","notifications_url":"https://api.github.com/repos/dkotegov/selenium-homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dkotegov/selenium-homework/labels{/name}","releases_url":"https://api.github.com/repos/dkotegov/selenium-homework/releases{/id}","deployments_url":"https://api.github.com/repos/dkotegov/selenium-homework/deployments","created_at":"2016-11-23T23:43:51Z","updated_at":"2016-11-23T23:46:09Z","pushed_at":"2016-12-17T10:42:07Z","git_url":"git://github.com/dkotegov/selenium-homework.git","ssh_url":"git@github.com:dkotegov/selenium-homework.git","clone_url":"https://github.com/dkotegov/selenium-homework.git","svn_url":"https://github.com/dkotegov/selenium-homework","homepage":null,"size":1,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":8,"forks":17,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dkotegov/selenium-homework/pulls/2"},"html":{"href":"https://github.com/dkotegov/selenium-homework/pull/2"},"issue":{"href":"https://api.github.com/repos/dkotegov/selenium-homework/issues/2"},"comments":{"href":"https://api.github.com/repos/dkotegov/selenium-homework/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/dkotegov/selenium-homework/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/dkotegov/selenium-homework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dkotegov/selenium-homework/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/dkotegov/selenium-homework/statuses/944666ed841297479e0e8b7e979560adeeffbd37"}}}}
{"actor":{"display_login":"dkotegov"}}