{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-app-android/pulls/comments/62021462","id":62021462,"diff_hunk":"@@ -0,0 +1,86 @@\n+package org.edx.mobile.test.feature.interactor;\n+\n+import android.support.test.espresso.ViewInteraction;\n+\n+import org.edx.mobile.R;\n+import org.edx.mobile.base.MainApplication;\n+import org.edx.mobile.core.EdxEnvironment;\n+import org.edx.mobile.module.registration.model.RegistrationDescription;\n+import org.edx.mobile.test.feature.data.Credentials;\n+import org.edx.mobile.util.Config;\n+import org.edx.mobile.util.ResourceUtil;\n+import org.hamcrest.Matchers;\n+\n+import static android.support.test.espresso.Espresso.onData;\n+import static android.support.test.espresso.Espresso.onView;\n+import static android.support.test.espresso.action.ViewActions.click;\n+import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard;\n+import static android.support.test.espresso.action.ViewActions.typeText;\n+import static android.support.test.espresso.assertion.ViewAssertions.matches;\n+import static android.support.test.espresso.matcher.ViewMatchers.isCompletelyDisplayed;\n+import static android.support.test.espresso.matcher.ViewMatchers.withId;\n+import static android.support.test.espresso.matcher.ViewMatchers.withTagValue;\n+import static android.support.test.espresso.matcher.ViewMatchers.withText;\n+import static org.hamcrest.CoreMatchers.is;\n+import static org.hamcrest.Matchers.allOf;\n+import static org.hamcrest.Matchers.instanceOf;\n+\n+public class RegistrationScreenInteractor {\n+\n+    RegistrationDescription registrationFieldsDesc;\n+\n+    public RegistrationScreenInteractor observeRegistrationScreen() {\n+        final MainApplication app = MainApplication.instance();\n+        try {\n+            registrationFieldsDesc = app.getInjector().getInstance(EdxEnvironment.class).getServiceManager().getRegistrationDescription();\n+        } catch (Exception e) {\n+            throw new AssertionError(\"Failed to load registration form fields json\");\n+        }\n+        final CharSequence title = ResourceUtil.getFormattedString(app.getResources(),\n+                R.string.register_title, \"platform_name\",\n+                app.getInjector().getInstance(Config.class).getPlatformName());\n+        onView(withId(R.id.activity_title)).check(matches(withText(title.toString())));\n+        onEmailView().check(matches(isCompletelyDisplayed()));\n+        onNameView().check(matches(isCompletelyDisplayed()));\n+        onUsernameView().check(matches(isCompletelyDisplayed()));\n+        onPasswordView().check(matches(isCompletelyDisplayed()));\n+        onCountryView().check(matches(isCompletelyDisplayed()));\n+        onCreateAccountButton().check(matches(isCompletelyDisplayed()));\n+        return this;\n+    }\n+\n+    public MyCoursesScreenInteractor createAccount(Credentials credentials) {\n+        onEmailView().perform(typeText(credentials.email), closeSoftKeyboard());\n+        onNameView().perform(typeText(\"Test Account\"), closeSoftKeyboard());\n+        onUsernameView().perform(typeText(credentials.username), closeSoftKeyboard());\n+        onPasswordView().perform(typeText(credentials.password), closeSoftKeyboard());\n+        onCountryView().perform(click());\n+        onData(allOf(is(instanceOf(String.class)))).atPosition(1).perform(click());\n+        onCreateAccountButton().perform(click());\n+        return new MyCoursesScreenInteractor();\n+    }\n+\n+    private ViewInteraction onEmailView() {\n+        return onView(withTagValue(Matchers.is((Object) \"email\")));\n+    }\n+\n+    private ViewInteraction onNameView() {\n+        return onView(withTagValue(is((Object) \"name\")));","path":"VideoLocker/src/androidTest/java/org/edx/mobile/test/feature/interactor/RegistrationScreenInteractor.java","position":68,"original_position":68,"commit_id":"14c9986a94b4449264f6c84e2708c094780215ae","original_commit_id":"14c9986a94b4449264f6c84e2708c094780215ae","user":{"login":"1zaman","id":4244109,"avatar_url":"https://avatars.githubusercontent.com/u/4244109?v=3","gravatar_id":"","url":"https://api.github.com/users/1zaman","html_url":"https://github.com/1zaman","followers_url":"https://api.github.com/users/1zaman/followers","following_url":"https://api.github.com/users/1zaman/following{/other_user}","gists_url":"https://api.github.com/users/1zaman/gists{/gist_id}","starred_url":"https://api.github.com/users/1zaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1zaman/subscriptions","organizations_url":"https://api.github.com/users/1zaman/orgs","repos_url":"https://api.github.com/users/1zaman/repos","events_url":"https://api.github.com/users/1zaman/events{/privacy}","received_events_url":"https://api.github.com/users/1zaman/received_events","type":"User","site_admin":false},"body":"Unfortunately, the `withTagValue()` method takes a `Matcher<Object>` item as a parameter, which needs to be a `Matcher` with the generic type of exactly `Object`, instead of `Matcher<? extends Object>` which would have allowed any generic type 😬","created_at":"2016-05-04T11:02:57Z","updated_at":"2016-05-04T11:02:57Z","html_url":"https://github.com/edx/edx-app-android/pull/673#discussion_r62021462","pull_request_url":"https://api.github.com/repos/edx/edx-app-android/pulls/673","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-app-android/pulls/comments/62021462"},"html":{"href":"https://github.com/edx/edx-app-android/pull/673#discussion_r62021462"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-app-android/pulls/673"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-app-android/pulls/673","id":67172525,"html_url":"https://github.com/edx/edx-app-android/pull/673","diff_url":"https://github.com/edx/edx-app-android/pull/673.diff","patch_url":"https://github.com/edx/edx-app-android/pull/673.patch","issue_url":"https://api.github.com/repos/edx/edx-app-android/issues/673","number":673,"state":"open","locked":false,"title":"E2E Test for registration","user":{"login":"miankhalid","id":1710804,"avatar_url":"https://avatars.githubusercontent.com/u/1710804?v=3","gravatar_id":"","url":"https://api.github.com/users/miankhalid","html_url":"https://github.com/miankhalid","followers_url":"https://api.github.com/users/miankhalid/followers","following_url":"https://api.github.com/users/miankhalid/following{/other_user}","gists_url":"https://api.github.com/users/miankhalid/gists{/gist_id}","starred_url":"https://api.github.com/users/miankhalid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miankhalid/subscriptions","organizations_url":"https://api.github.com/users/miankhalid/orgs","repos_url":"https://api.github.com/users/miankhalid/repos","events_url":"https://api.github.com/users/miankhalid/events{/privacy}","received_events_url":"https://api.github.com/users/miankhalid/received_events","type":"User","site_admin":false},"body":"Addresses [MA-2117](https://openedx.atlassian.net/browse/MA-2117)\r\n\r\n@1zaman @BenjiLee @aleffert plz review","created_at":"2016-04-20T11:46:41Z","updated_at":"2016-05-04T11:02:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"18a64bf9c4df8892c5edf56708be1373f8b6588f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-app-android/pulls/673/commits","review_comments_url":"https://api.github.com/repos/edx/edx-app-android/pulls/673/comments","review_comment_url":"https://api.github.com/repos/edx/edx-app-android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-app-android/issues/673/comments","statuses_url":"https://api.github.com/repos/edx/edx-app-android/statuses/14c9986a94b4449264f6c84e2708c094780215ae","head":{"label":"edx:khalid/MA-2117","ref":"khalid/MA-2117","sha":"14c9986a94b4449264f6c84e2708c094780215ae","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":29251742,"name":"edx-app-android","full_name":"edx/edx-app-android","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-app-android","description":"","fork":false,"url":"https://api.github.com/repos/edx/edx-app-android","forks_url":"https://api.github.com/repos/edx/edx-app-android/forks","keys_url":"https://api.github.com/repos/edx/edx-app-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-app-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-app-android/teams","hooks_url":"https://api.github.com/repos/edx/edx-app-android/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-app-android/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-app-android/events","assignees_url":"https://api.github.com/repos/edx/edx-app-android/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-app-android/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-app-android/tags","blobs_url":"https://api.github.com/repos/edx/edx-app-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-app-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-app-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-app-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-app-android/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-app-android/languages","stargazers_url":"https://api.github.com/repos/edx/edx-app-android/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-app-android/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-app-android/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-app-android/subscription","commits_url":"https://api.github.com/repos/edx/edx-app-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-app-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-app-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-app-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-app-android/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-app-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-app-android/merges","archive_url":"https://api.github.com/repos/edx/edx-app-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-app-android/downloads","issues_url":"https://api.github.com/repos/edx/edx-app-android/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-app-android/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-app-android/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-app-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-app-android/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-app-android/releases{/id}","deployments_url":"https://api.github.com/repos/edx/edx-app-android/deployments","created_at":"2015-01-14T15:49:47Z","updated_at":"2016-04-28T23:47:00Z","pushed_at":"2016-05-04T04:08:58Z","git_url":"git://github.com/edx/edx-app-android.git","ssh_url":"git@github.com:edx/edx-app-android.git","clone_url":"https://github.com/edx/edx-app-android.git","svn_url":"https://github.com/edx/edx-app-android","homepage":null,"size":22640,"stargazers_count":69,"watchers_count":69,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":85,"mirror_url":null,"open_issues_count":9,"forks":85,"open_issues":9,"watchers":69,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"3d5bf80c49a9065f7b2d72080ca5fabed3817a2b","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":29251742,"name":"edx-app-android","full_name":"edx/edx-app-android","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-app-android","description":"","fork":false,"url":"https://api.github.com/repos/edx/edx-app-android","forks_url":"https://api.github.com/repos/edx/edx-app-android/forks","keys_url":"https://api.github.com/repos/edx/edx-app-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-app-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-app-android/teams","hooks_url":"https://api.github.com/repos/edx/edx-app-android/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-app-android/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-app-android/events","assignees_url":"https://api.github.com/repos/edx/edx-app-android/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-app-android/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-app-android/tags","blobs_url":"https://api.github.com/repos/edx/edx-app-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-app-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-app-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-app-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-app-android/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-app-android/languages","stargazers_url":"https://api.github.com/repos/edx/edx-app-android/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-app-android/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-app-android/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-app-android/subscription","commits_url":"https://api.github.com/repos/edx/edx-app-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-app-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-app-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-app-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-app-android/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-app-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-app-android/merges","archive_url":"https://api.github.com/repos/edx/edx-app-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-app-android/downloads","issues_url":"https://api.github.com/repos/edx/edx-app-android/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-app-android/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-app-android/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-app-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-app-android/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-app-android/releases{/id}","deployments_url":"https://api.github.com/repos/edx/edx-app-android/deployments","created_at":"2015-01-14T15:49:47Z","updated_at":"2016-04-28T23:47:00Z","pushed_at":"2016-05-04T04:08:58Z","git_url":"git://github.com/edx/edx-app-android.git","ssh_url":"git@github.com:edx/edx-app-android.git","clone_url":"https://github.com/edx/edx-app-android.git","svn_url":"https://github.com/edx/edx-app-android","homepage":null,"size":22640,"stargazers_count":69,"watchers_count":69,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":85,"mirror_url":null,"open_issues_count":9,"forks":85,"open_issues":9,"watchers":69,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-app-android/pulls/673"},"html":{"href":"https://github.com/edx/edx-app-android/pull/673"},"issue":{"href":"https://api.github.com/repos/edx/edx-app-android/issues/673"},"comments":{"href":"https://api.github.com/repos/edx/edx-app-android/issues/673/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-app-android/pulls/673/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-app-android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-app-android/pulls/673/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-app-android/statuses/14c9986a94b4449264f6c84e2708c094780215ae"}}}}