{"action":"created","comment":{"url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/comments/30723794","id":30723794,"diff_hunk":"@@ -0,0 +1,94 @@\n+# -*- encoding: utf-8 -*-\n+\"\"\"\n+Implements Monitor->Trends UI\n+\"\"\"\n+\n+from robottelo.ui.base import Base, UIError, UINoSuchElementError\n+from robottelo.ui.locators import locators, common_locators\n+from robottelo.ui.navigator import Navigator\n+from selenium.webdriver.support.select import Select\n+\n+\n+class Trend(Base):\n+    \"\"\"Provides the CRUD functionality for Trends.\"\"\"\n+\n+    def create(self, trend_type, trendable, name):\n+        \"\"\"Creates the trend.\"\"\"\n+        self.wait_until_element(locators['trend.new']).click()\n+\n+        if self.wait_until_element(locators['trend.type']):\n+            Select(\n+                self.find_element(locators['trend.type'])\n+            ).select_by_visible_text(trend_type)\n+\n+            if trendable is not None:\n+                Select(\n+                    self.find_element(locators['trend.trendable'])\n+                ).select_by_visible_text(trendable)\n+\n+            if name is not None and trendable is not None:\n+                self.find_element(locators['trend.name']).send_keys(name)\n+\n+        self.find_element(common_locators['submit']).click()\n+        self.wait_for_ajax()\n+\n+    def update(self, trend_name, entity_name, entity_value):\n+        \"\"\"Updates a trend.\"\"\"\n+        element = self.search(trend_name)\n+        if element is None:\n+            raise UIError(\n+                'Could not find necessary trend \"{0}\"'.format(trend_name)\n+            )\n+        strategy = locators['trend.edit'][0]\n+        value = locators['trend.edit'][1]\n+        edit_fld = self.wait_until_element((strategy, value % trend_name))\n+        edit_fld.click()\n+        strategy = locators['trend.edit_entity'][0]\n+        value = locators['trend.edit_entity'][1]\n+        txt_fld = self.wait_until_element((strategy, value % entity_name))\n+        if txt_fld:\n+            txt_fld.clear()\n+            txt_fld.send_keys(entity_value)\n+        elif txt_fld is None:\n+            raise UINoSuchElementError(\n+                u'Could not find the entity \"{0}\" for update procedure.'\n+                .format(entity_name)\n+            )","path":"robottelo/ui/trend.py","position":56,"original_position":56,"commit_id":"8d998e829d7c8f39eac0116ad777d24ac17942c4","original_commit_id":"8d998e829d7c8f39eac0116ad777d24ac17942c4","user":{"login":"Ichimonji10","id":1012989,"avatar_url":"https://avatars.githubusercontent.com/u/1012989?v=3","gravatar_id":"","url":"https://api.github.com/users/Ichimonji10","html_url":"https://github.com/Ichimonji10","followers_url":"https://api.github.com/users/Ichimonji10/followers","following_url":"https://api.github.com/users/Ichimonji10/following{/other_user}","gists_url":"https://api.github.com/users/Ichimonji10/gists{/gist_id}","starred_url":"https://api.github.com/users/Ichimonji10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ichimonji10/subscriptions","organizations_url":"https://api.github.com/users/Ichimonji10/orgs","repos_url":"https://api.github.com/users/Ichimonji10/repos","events_url":"https://api.github.com/users/Ichimonji10/events{/privacy}","received_events_url":"https://api.github.com/users/Ichimonji10/received_events","type":"User","site_admin":false},"body":"Will this work?\r\n\r\n```python\r\n        if txt_fld is None:\r\n            raise UINoSuchElementError(\r\n                u'Could not find the entity \"{0}\" for update procedure.'\r\n                .format(entity_name)\r\n            )\r\n        txt_fld.clear()\r\n        txt_fld.send_keys(entity_value)\r\n```","created_at":"2015-05-20T16:59:24Z","updated_at":"2015-05-20T16:59:24Z","html_url":"https://github.com/SatelliteQE/robottelo/pull/2258#discussion_r30723794","pull_request_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2258","_links":{"self":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/comments/30723794"},"html":{"href":"https://github.com/SatelliteQE/robottelo/pull/2258#discussion_r30723794"},"pull_request":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2258"}}},"pull_request":{"url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2258","id":35716477,"html_url":"https://github.com/SatelliteQE/robottelo/pull/2258","diff_url":"https://github.com/SatelliteQE/robottelo/pull/2258.diff","patch_url":"https://github.com/SatelliteQE/robottelo/pull/2258.patch","issue_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/2258","number":2258,"state":"open","locked":false,"title":"Implement CRUD for Trends functionality","user":{"login":"oshtaier","id":10895065,"avatar_url":"https://avatars.githubusercontent.com/u/10895065?v=3","gravatar_id":"","url":"https://api.github.com/users/oshtaier","html_url":"https://github.com/oshtaier","followers_url":"https://api.github.com/users/oshtaier/followers","following_url":"https://api.github.com/users/oshtaier/following{/other_user}","gists_url":"https://api.github.com/users/oshtaier/gists{/gist_id}","starred_url":"https://api.github.com/users/oshtaier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oshtaier/subscriptions","organizations_url":"https://api.github.com/users/oshtaier/orgs","repos_url":"https://api.github.com/users/oshtaier/repos","events_url":"https://api.github.com/users/oshtaier/events{/privacy}","received_events_url":"https://api.github.com/users/oshtaier/received_events","type":"User","site_admin":false},"body":"Closes #127\r\n\r\n```\r\nnosetests tests/foreman/ui/test_trend.py\r\n...\r\n----------------------------------------------------------------------\r\nRan 3 tests in 161.157s\r\n\r\nOK\r\n```","created_at":"2015-05-19T10:36:18Z","updated_at":"2015-05-20T16:59:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d8b0a6e1f6a2b1f78f078719a51c83d13806a44f","assignee":{"login":"oshtaier","id":10895065,"avatar_url":"https://avatars.githubusercontent.com/u/10895065?v=3","gravatar_id":"","url":"https://api.github.com/users/oshtaier","html_url":"https://github.com/oshtaier","followers_url":"https://api.github.com/users/oshtaier/followers","following_url":"https://api.github.com/users/oshtaier/following{/other_user}","gists_url":"https://api.github.com/users/oshtaier/gists{/gist_id}","starred_url":"https://api.github.com/users/oshtaier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oshtaier/subscriptions","organizations_url":"https://api.github.com/users/oshtaier/orgs","repos_url":"https://api.github.com/users/oshtaier/repos","events_url":"https://api.github.com/users/oshtaier/events{/privacy}","received_events_url":"https://api.github.com/users/oshtaier/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2258/commits","review_comments_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2258/comments","review_comment_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/2258/comments","statuses_url":"https://api.github.com/repos/SatelliteQE/robottelo/statuses/8d998e829d7c8f39eac0116ad777d24ac17942c4","head":{"label":"oshtaier:Issue_127","ref":"Issue_127","sha":"8d998e829d7c8f39eac0116ad777d24ac17942c4","user":{"login":"oshtaier","id":10895065,"avatar_url":"https://avatars.githubusercontent.com/u/10895065?v=3","gravatar_id":"","url":"https://api.github.com/users/oshtaier","html_url":"https://github.com/oshtaier","followers_url":"https://api.github.com/users/oshtaier/followers","following_url":"https://api.github.com/users/oshtaier/following{/other_user}","gists_url":"https://api.github.com/users/oshtaier/gists{/gist_id}","starred_url":"https://api.github.com/users/oshtaier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oshtaier/subscriptions","organizations_url":"https://api.github.com/users/oshtaier/orgs","repos_url":"https://api.github.com/users/oshtaier/repos","events_url":"https://api.github.com/users/oshtaier/events{/privacy}","received_events_url":"https://api.github.com/users/oshtaier/received_events","type":"User","site_admin":false},"repo":{"id":33350829,"name":"robottelo","full_name":"oshtaier/robottelo","owner":{"login":"oshtaier","id":10895065,"avatar_url":"https://avatars.githubusercontent.com/u/10895065?v=3","gravatar_id":"","url":"https://api.github.com/users/oshtaier","html_url":"https://github.com/oshtaier","followers_url":"https://api.github.com/users/oshtaier/followers","following_url":"https://api.github.com/users/oshtaier/following{/other_user}","gists_url":"https://api.github.com/users/oshtaier/gists{/gist_id}","starred_url":"https://api.github.com/users/oshtaier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oshtaier/subscriptions","organizations_url":"https://api.github.com/users/oshtaier/orgs","repos_url":"https://api.github.com/users/oshtaier/repos","events_url":"https://api.github.com/users/oshtaier/events{/privacy}","received_events_url":"https://api.github.com/users/oshtaier/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oshtaier/robottelo","description":"Robottelo is a test suite which exercises The Foreman.","fork":true,"url":"https://api.github.com/repos/oshtaier/robottelo","forks_url":"https://api.github.com/repos/oshtaier/robottelo/forks","keys_url":"https://api.github.com/repos/oshtaier/robottelo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oshtaier/robottelo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oshtaier/robottelo/teams","hooks_url":"https://api.github.com/repos/oshtaier/robottelo/hooks","issue_events_url":"https://api.github.com/repos/oshtaier/robottelo/issues/events{/number}","events_url":"https://api.github.com/repos/oshtaier/robottelo/events","assignees_url":"https://api.github.com/repos/oshtaier/robottelo/assignees{/user}","branches_url":"https://api.github.com/repos/oshtaier/robottelo/branches{/branch}","tags_url":"https://api.github.com/repos/oshtaier/robottelo/tags","blobs_url":"https://api.github.com/repos/oshtaier/robottelo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oshtaier/robottelo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oshtaier/robottelo/git/refs{/sha}","trees_url":"https://api.github.com/repos/oshtaier/robottelo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oshtaier/robottelo/statuses/{sha}","languages_url":"https://api.github.com/repos/oshtaier/robottelo/languages","stargazers_url":"https://api.github.com/repos/oshtaier/robottelo/stargazers","contributors_url":"https://api.github.com/repos/oshtaier/robottelo/contributors","subscribers_url":"https://api.github.com/repos/oshtaier/robottelo/subscribers","subscription_url":"https://api.github.com/repos/oshtaier/robottelo/subscription","commits_url":"https://api.github.com/repos/oshtaier/robottelo/commits{/sha}","git_commits_url":"https://api.github.com/repos/oshtaier/robottelo/git/commits{/sha}","comments_url":"https://api.github.com/repos/oshtaier/robottelo/comments{/number}","issue_comment_url":"https://api.github.com/repos/oshtaier/robottelo/issues/comments{/number}","contents_url":"https://api.github.com/repos/oshtaier/robottelo/contents/{+path}","compare_url":"https://api.github.com/repos/oshtaier/robottelo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oshtaier/robottelo/merges","archive_url":"https://api.github.com/repos/oshtaier/robottelo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oshtaier/robottelo/downloads","issues_url":"https://api.github.com/repos/oshtaier/robottelo/issues{/number}","pulls_url":"https://api.github.com/repos/oshtaier/robottelo/pulls{/number}","milestones_url":"https://api.github.com/repos/oshtaier/robottelo/milestones{/number}","notifications_url":"https://api.github.com/repos/oshtaier/robottelo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oshtaier/robottelo/labels{/name}","releases_url":"https://api.github.com/repos/oshtaier/robottelo/releases{/id}","created_at":"2015-04-03T06:48:07Z","updated_at":"2015-04-06T12:49:17Z","pushed_at":"2015-05-20T14:08:59Z","git_url":"git://github.com/oshtaier/robottelo.git","ssh_url":"git@github.com:oshtaier/robottelo.git","clone_url":"https://github.com/oshtaier/robottelo.git","svn_url":"https://github.com/oshtaier/robottelo","homepage":"","size":8137,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SatelliteQE:master","ref":"master","sha":"5e1f9e0bce6cf0442474795484c5fd008a41f28e","user":{"login":"SatelliteQE","id":8754276,"avatar_url":"https://avatars.githubusercontent.com/u/8754276?v=3","gravatar_id":"","url":"https://api.github.com/users/SatelliteQE","html_url":"https://github.com/SatelliteQE","followers_url":"https://api.github.com/users/SatelliteQE/followers","following_url":"https://api.github.com/users/SatelliteQE/following{/other_user}","gists_url":"https://api.github.com/users/SatelliteQE/gists{/gist_id}","starred_url":"https://api.github.com/users/SatelliteQE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SatelliteQE/subscriptions","organizations_url":"https://api.github.com/users/SatelliteQE/orgs","repos_url":"https://api.github.com/users/SatelliteQE/repos","events_url":"https://api.github.com/users/SatelliteQE/events{/privacy}","received_events_url":"https://api.github.com/users/SatelliteQE/received_events","type":"Organization","site_admin":false},"repo":{"id":4000279,"name":"robottelo","full_name":"SatelliteQE/robottelo","owner":{"login":"SatelliteQE","id":8754276,"avatar_url":"https://avatars.githubusercontent.com/u/8754276?v=3","gravatar_id":"","url":"https://api.github.com/users/SatelliteQE","html_url":"https://github.com/SatelliteQE","followers_url":"https://api.github.com/users/SatelliteQE/followers","following_url":"https://api.github.com/users/SatelliteQE/following{/other_user}","gists_url":"https://api.github.com/users/SatelliteQE/gists{/gist_id}","starred_url":"https://api.github.com/users/SatelliteQE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SatelliteQE/subscriptions","organizations_url":"https://api.github.com/users/SatelliteQE/orgs","repos_url":"https://api.github.com/users/SatelliteQE/repos","events_url":"https://api.github.com/users/SatelliteQE/events{/privacy}","received_events_url":"https://api.github.com/users/SatelliteQE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SatelliteQE/robottelo","description":"Robottelo is a test suite which exercises The Foreman.","fork":false,"url":"https://api.github.com/repos/SatelliteQE/robottelo","forks_url":"https://api.github.com/repos/SatelliteQE/robottelo/forks","keys_url":"https://api.github.com/repos/SatelliteQE/robottelo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SatelliteQE/robottelo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SatelliteQE/robottelo/teams","hooks_url":"https://api.github.com/repos/SatelliteQE/robottelo/hooks","issue_events_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/events{/number}","events_url":"https://api.github.com/repos/SatelliteQE/robottelo/events","assignees_url":"https://api.github.com/repos/SatelliteQE/robottelo/assignees{/user}","branches_url":"https://api.github.com/repos/SatelliteQE/robottelo/branches{/branch}","tags_url":"https://api.github.com/repos/SatelliteQE/robottelo/tags","blobs_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/refs{/sha}","trees_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SatelliteQE/robottelo/statuses/{sha}","languages_url":"https://api.github.com/repos/SatelliteQE/robottelo/languages","stargazers_url":"https://api.github.com/repos/SatelliteQE/robottelo/stargazers","contributors_url":"https://api.github.com/repos/SatelliteQE/robottelo/contributors","subscribers_url":"https://api.github.com/repos/SatelliteQE/robottelo/subscribers","subscription_url":"https://api.github.com/repos/SatelliteQE/robottelo/subscription","commits_url":"https://api.github.com/repos/SatelliteQE/robottelo/commits{/sha}","git_commits_url":"https://api.github.com/repos/SatelliteQE/robottelo/git/commits{/sha}","comments_url":"https://api.github.com/repos/SatelliteQE/robottelo/comments{/number}","issue_comment_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues/comments{/number}","contents_url":"https://api.github.com/repos/SatelliteQE/robottelo/contents/{+path}","compare_url":"https://api.github.com/repos/SatelliteQE/robottelo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SatelliteQE/robottelo/merges","archive_url":"https://api.github.com/repos/SatelliteQE/robottelo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SatelliteQE/robottelo/downloads","issues_url":"https://api.github.com/repos/SatelliteQE/robottelo/issues{/number}","pulls_url":"https://api.github.com/repos/SatelliteQE/robottelo/pulls{/number}","milestones_url":"https://api.github.com/repos/SatelliteQE/robottelo/milestones{/number}","notifications_url":"https://api.github.com/repos/SatelliteQE/robottelo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SatelliteQE/robottelo/labels{/name}","releases_url":"https://api.github.com/repos/SatelliteQE/robottelo/releases{/id}","created_at":"2012-04-12T01:36:39Z","updated_at":"2015-05-08T20:29:03Z","pushed_at":"2015-05-20T16:23:45Z","git_url":"git://github.com/SatelliteQE/robottelo.git","ssh_url":"git@github.com:SatelliteQE/robottelo.git","clone_url":"https://github.com/SatelliteQE/robottelo.git","svn_url":"https://github.com/SatelliteQE/robottelo","homepage":"","size":19176,"stargazers_count":21,"watchers_count":21,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":27,"mirror_url":null,"open_issues_count":141,"forks":27,"open_issues":141,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2258"},"html":{"href":"https://github.com/SatelliteQE/robottelo/pull/2258"},"issue":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/issues/2258"},"comments":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/issues/2258/comments"},"review_comments":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2258/comments"},"review_comment":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/pulls/2258/commits"},"statuses":{"href":"https://api.github.com/repos/SatelliteQE/robottelo/statuses/8d998e829d7c8f39eac0116ad777d24ac17942c4"}}}}