{"action":"created","issue":{"url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/3305","repository_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3","labels_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/3305/labels{/name}","comments_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/3305/comments","events_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/3305/events","html_url":"https://github.com/geoadmin/mf-geoadmin3/pull/3305","id":153811269,"number":3305,"title":"Fix sauclabs search test, add new tests and refactoring","user":{"login":"loicgasser","id":3306154,"avatar_url":"https://avatars.githubusercontent.com/u/3306154?v=3","gravatar_id":"","url":"https://api.github.com/users/loicgasser","html_url":"https://github.com/loicgasser","followers_url":"https://api.github.com/users/loicgasser/followers","following_url":"https://api.github.com/users/loicgasser/following{/other_user}","gists_url":"https://api.github.com/users/loicgasser/gists{/gist_id}","starred_url":"https://api.github.com/users/loicgasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loicgasser/subscriptions","organizations_url":"https://api.github.com/users/loicgasser/orgs","repos_url":"https://api.github.com/users/loicgasser/repos","events_url":"https://api.github.com/users/loicgasser/events{/privacy}","received_events_url":"https://api.github.com/users/loicgasser/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"gjn","id":2572317,"avatar_url":"https://avatars.githubusercontent.com/u/2572317?v=3","gravatar_id":"","url":"https://api.github.com/users/gjn","html_url":"https://github.com/gjn","followers_url":"https://api.github.com/users/gjn/followers","following_url":"https://api.github.com/users/gjn/following{/other_user}","gists_url":"https://api.github.com/users/gjn/gists{/gist_id}","starred_url":"https://api.github.com/users/gjn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gjn/subscriptions","organizations_url":"https://api.github.com/users/gjn/orgs","repos_url":"https://api.github.com/users/gjn/repos","events_url":"https://api.github.com/users/gjn/events{/privacy}","received_events_url":"https://api.github.com/users/gjn/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2016-05-09T16:05:00Z","updated_at":"2016-05-10T07:23:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/3305","html_url":"https://github.com/geoadmin/mf-geoadmin3/pull/3305","diff_url":"https://github.com/geoadmin/mf-geoadmin3/pull/3305.diff","patch_url":"https://github.com/geoadmin/mf-geoadmin3/pull/3305.patch"},"body":"This PR fixes the current issue with the search tests via the `swisssearch` permalink parameter.\r\n\r\nThe same address had 2 entries and as a result the dropDown search list was open instead of zooming directly on the expected location.\r\n\r\nI introduced UI interactions with the input element of the search.\r\n\r\n1. We first change the input value and trigger a search request\r\n2. We check that the dropdown list is open\r\n3. We select a result based on the location entry title\r\n4. We check that the permalink contains the correct coordinates\r\n5. That the dropdown is not visible anymore\r\n6. We clear the input content and check that the input as been cleared\r\n\r\nSimilar tests are performed for the layer search and swisssearch permalink parameter.\r\n\r\nWe now have two use cases for the swisssearch permalink parameter.\r\n\r\n1. Only one result -> we expect to zoom at the correct location\r\n2. Several results -> we expect the dropDown to be open\r\n\r\nIdeally I would like more tests like these ones.\r\nWe should use an extra layer of abstraction using classes for our components (or page element) that we could call from any test. See http://selenium-python.readthedocs.io/page-objects.html#page-elements for instance. That's what I started here with reusable functions that test the same thing.\r\n\r\nping @alcapat @pfanguin -> as a source of inspiration"},"comment":{"url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/comments/218078736","html_url":"https://github.com/geoadmin/mf-geoadmin3/pull/3305#issuecomment-218078736","issue_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/3305","id":218078736,"user":{"login":"loicgasser","id":3306154,"avatar_url":"https://avatars.githubusercontent.com/u/3306154?v=3","gravatar_id":"","url":"https://api.github.com/users/loicgasser","html_url":"https://github.com/loicgasser","followers_url":"https://api.github.com/users/loicgasser/followers","following_url":"https://api.github.com/users/loicgasser/following{/other_user}","gists_url":"https://api.github.com/users/loicgasser/gists{/gist_id}","starred_url":"https://api.github.com/users/loicgasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loicgasser/subscriptions","organizations_url":"https://api.github.com/users/loicgasser/orgs","repos_url":"https://api.github.com/users/loicgasser/repos","events_url":"https://api.github.com/users/loicgasser/events{/privacy}","received_events_url":"https://api.github.com/users/loicgasser/received_events","type":"User","site_admin":false},"created_at":"2016-05-10T07:23:25Z","updated_at":"2016-05-10T07:23:25Z","body":"Because it's a value test that is not avaiable in the native selenium waits.  See\nhttp://selenium-python.readthedocs.io/waits.html"}}