{"id":27399040,"url":"https://github.com/stalksa/appespresso","last_synced_at":"2025-06-19T04:33:50.305Z","repository":{"id":208102288,"uuid":"720823029","full_name":"STALKSA/AppEspresso","owner":"STALKSA","description":"Реализация теста на проверку главного экрана","archived":false,"fork":false,"pushed_at":"2024-01-21T11:18:14.000Z","size":140,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T02:56:17.374Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/STALKSA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2023-11-19T17:53:30.000Z","updated_at":"2023-11-19T17:54:33.000Z","dependencies_parsed_at":"2025-04-14T02:56:18.287Z","dependency_job_id":"6cba66ab-ef2c-458a-83f9-d3bede314052","html_url":"https://github.com/STALKSA/AppEspresso","commit_stats":null,"previous_names":["stalksa/appespresso"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/STALKSA/AppEspresso","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STALKSA%2FAppEspresso","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STALKSA%2FAppEspresso/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STALKSA%2FAppEspresso/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STALKSA%2FAppEspresso/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/STALKSA","download_url":"https://codeload.github.com/STALKSA/AppEspresso/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STALKSA%2FAppEspresso/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260687851,"owners_count":23046802,"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":[],"created_at":"2025-04-14T02:56:16.831Z","updated_at":"2025-06-19T04:33:45.294Z","avatar_url":"https://github.com/STALKSA.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Добавление зависимостей\n\n1. Открыть файл /app/build.gradle.\n2. Проверить наличие и при необходимости добавить зависимости в блок «dependencies»:\n```java\n     testImplementation 'junit:junit:4.13.2' \n     androidTestImplementation 'androidx.test.ext:junit:1.1.3' \n     androidTestImplementation 'androidx.test:rules:1.4.0'  \n     androidTestImplementation 'androidx.test:runner:1.4.0' \n     androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' \n```\n\n### Создание и настройка класса тестов\n\n1. Создать новый класс в директории /app/src/androidTest/java/ru/kkuzmichev/simpleappforespresso/.\n2. Добавить @RunWith(AndroidJUnit4.class) над именем класса.\n3. Задать правило для MainActivity внутри класса:\n```java\n@Rule\npublic ActivityTestRule\u003cMainActivity\u003e activityTestRule =\n\tnew ActivityTestRule\u003c\u003e(MainActivity.class);\n```\n\n### Написание теста\n\n1. Запустить приложение.\n2. Построить иерархию элементов с помощью Layout Inspector: [инструкция от Google](https://developer.android.com/studio/debug/layout-inspector).\n3. Найти элемент с текстом «This is home fragment» и его ID.\n4. Написать тест, проверяющий, что у найденного ID текст «This is home fragment».\n\nШаблон теста:\n```java\n@Test\npublic void testName() {\n    ViewInteraction mainText = onView(\n        withId(R.id.найденный id)\n    );\n    mainText.check(\n        matches(\n            withText(Проверяемый текст)\n        )\n    );\n}\n```\n\n### Запуск теста и просмотр отчёта\n\n1. Запустить тест, нажав кнопку запуска возле метода теста.\n2. Проверить, что тест прошёл успешно.\n3. Экспортировать отчёт в html-файл.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstalksa%2Fappespresso","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstalksa%2Fappespresso","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstalksa%2Fappespresso/lists"}