{"id":14969319,"url":"https://github.com/sebaslogen/cleanguitestarchitecture","last_synced_at":"2026-03-13T15:38:28.617Z","repository":{"id":147290310,"uuid":"42465298","full_name":"sebaslogen/CleanGUITestArchitecture","owner":"sebaslogen","description":"Sample project of Android GUI test automation using Espresso, Cucumber and the Page Object Pattern","archived":false,"fork":false,"pushed_at":"2017-06-14T21:26:23.000Z","size":155,"stargazers_count":137,"open_issues_count":9,"forks_count":31,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-01-31T00:25:17.048Z","etag":null,"topics":["android","cucumber","espresso","pageobject-pattern"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sebaslogen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-14T17:33:55.000Z","updated_at":"2024-07-03T20:20:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"32b83daf-b874-4bb4-add0-0248c69648f7","html_url":"https://github.com/sebaslogen/CleanGUITestArchitecture","commit_stats":{"total_commits":72,"total_committers":4,"mean_commits":18.0,"dds":0.08333333333333337,"last_synced_commit":"a9da908cca5d4ac2639d58e7003dfe0531b64378"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebaslogen%2FCleanGUITestArchitecture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebaslogen%2FCleanGUITestArchitecture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebaslogen%2FCleanGUITestArchitecture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebaslogen%2FCleanGUITestArchitecture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebaslogen","download_url":"https://codeload.github.com/sebaslogen/CleanGUITestArchitecture/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237926611,"owners_count":19388577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","cucumber","espresso","pageobject-pattern"],"created_at":"2024-09-24T13:41:36.095Z","updated_at":"2026-03-13T15:38:28.588Z","avatar_url":"https://github.com/sebaslogen.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/sebaslogen/CleanGUITestArchitecture.svg?branch=master)](https://travis-ci.org/sebaslogen/CleanGUITestArchitecture)\n\n# Clean GUI Test Architecture\nSample project of Android GUI test automation using Espresso, Cucumber and the Page Object Pattern\n\nThe evolution journey of Android GUI testing\n============\nThe code in this repository serves as a support example of all the test solutions discussed in this published article:\n\nhttps://medium.com/@sebaslogen/the-evolution-journey-of-android-gui-testing-f65005f7ced8\n\nExecute the project\n-------\nOpen the project in Android Studio and select the gradle task '**connectedCheck**'\n\nAlternative, from the command line run ```gradlew connectedCheck```\n\nCucumber supports **filtering execution of test scenarios with tags** (i.e. @login-scenarios). To filter by tags you have the following options (which can't be combined):\n- Hard coded tags in annotation ```@CucumberOptions``` inside ```CucumberTestCase.java```\n- Use parameters in command line like ```./gradlew connectedAndroidTest -Ptags=\"@login-scenarios,@kitkat\"```\n- In Android Studio, run connectedAndroidTest in the right Gradle tab and then edit the run configuration to add under the `Script parameters` something like `-Ptags=\"@login-scenarios,@kitkat\"`\n\nMore information about how to use and combine [Cucumber tags here](https://github.com/cucumber/cucumber/wiki/Tags).\n\n_Note: Make sure to connect a phone to the computer or start an emulator before running the tests._\n\nIn a nutshell\n-------\nThe sample test code can be summarized in these three elements:\n\n1- Feature file describing the test scenario in English:\n```gherkin\n@ScenarioId(\"MyApp-135\") @login-scenarios\nScenario: User can login with valid user name and password\n    Given I see the login page\n    When I login with user name \"Sebas\" and password \"passion\"\n    Then I see the welcome page\n    And the title is \"Welcome Sebas\"\n```\n\n2- Java glue code to translate English to Java (this is a step definition):\n```java\n@Given(\"^I see the login page$\")\npublic void i_see_the_login_page() {\n    mCurrentPage = new LoginPage();\n}\n\n@When(\"^I login with user name \\\"(.+)\\\" and password \\\"(.+)\\\"$\")\npublic void i_login_with_username_and_password(final String userName, final String password) {\n    mCurrentPage = mCurrentPage.is(LoginPage.class).doLogin(userName, password);\n}\n\n@Then(\"^I see the welcome page$\")\npublic void i_see_the_welcome_page() {\n    mCurrentPage.is(WelcomePage.class);\n}\n\n@And(\"^the title is \\\"(.+)\\\"$\")\npublic void the_title_is(final String title) {\n    mCurrentPage.is(WelcomePage.class).checkTitle(title);\n}\n```\n\n3- Page Object class implementing the interactions between tests and tested application:\n```java\n/**\n * Perform the login and return the next Welcome page/view\n * @param userName Name of the user to login\n * @param password Password of the user to login\n * @return Welcome page/view\n */\npublic WelcomePage doLogin(String userName, String password) {\n    onView(withId(R.id.username)).perform(typeText(userName));\n    onView(withId(R.id.password)).perform(typeText(password), closeSoftKeyboard());\n    onView(withId(R.id.login_button)).perform(click());\n    return new WelcomePage();\n}\n```\n\nAdvanced scenarios\n-------\nWhen the code of your application and tests mature enough you will be doing things like this:\n- A test step from a test scenario that can be reused across multiple tests:\n```gherkin\n    Given I login into premium account\n```\n- The step definition describes a lot of steps that need to happen to perform the requested action:\n```java\n@Given(\"^I login into premium account$\")\npublic void i_log_in_to_premium() {\n    mCurrentPage = mCurrentPage\n      .is(MainPage.class).openMenu()\n      .is(MenuPage.class).selectMenuItem(\"Accounts\")\n      .is(AccountsPage.class).selectNewAccountLogin()\n      .is(LoginPage.class).doLogin()\n      .is(AgreementPage.class).agreeToPrivacyInformation();\n}\n```\nThis step definition still hides most of the implementation details inside the Page Objects that contain the actual how-to communicate with the tested application.\n\nLicense\n-------\nThis content is released under the MIT License: http://opensource.org/licenses/MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebaslogen%2Fcleanguitestarchitecture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebaslogen%2Fcleanguitestarchitecture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebaslogen%2Fcleanguitestarchitecture/lists"}