-
Notifications
You must be signed in to change notification settings - Fork 7
chore: Update to plugin #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pat-deque
wants to merge
8
commits into
main
Choose a base branch
from
update-to-plugin
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+179
−44
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
77be2a0
WIP
pat-deque 26c5c38
WIP
pat-deque 479e025
Update the sample app to give examples of an auto scan implementation…
pat-deque c03bb67
Fixing build errors
pat-deque 0c476f2
Updating readme
pat-deque 776a089
Potential fix for pull request finding
pat-deque 11d665c
Apply suggestions from code review
pat-deque 5aeea98
remove unecessary deps
pat-deque File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
app/src/androidTest/java/com/deque/mobile/axedevtoolssampleapp/AutoScanDemoTest.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| package com.deque.mobile.axedevtoolssampleapp | ||
|
|
||
| import androidx.compose.ui.test.assertIsDisplayed | ||
| import androidx.compose.ui.test.junit4.createAndroidComposeRule | ||
| import androidx.compose.ui.test.onNodeWithText | ||
| import androidx.test.espresso.Espresso.onView | ||
| import androidx.test.espresso.action.ViewActions.click | ||
| import androidx.test.espresso.assertion.ViewAssertions.matches | ||
| import androidx.test.espresso.matcher.ViewMatchers.isDisplayed | ||
| import androidx.test.espresso.matcher.ViewMatchers.withId | ||
| import androidx.test.espresso.matcher.ViewMatchers.withText | ||
| import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
| import org.junit.Rule | ||
| import org.junit.Test | ||
| import org.junit.runner.RunWith | ||
|
|
||
| /** | ||
| * Auto Scan Sample Test Suite: | ||
| * | ||
| * The purpose of this test class is to provide a sample test suite that emulates what a typical user | ||
| * experience might be like while using our Auto Scan feature. | ||
| * | ||
| * Please follow the README to ensure that you have properly set up the build.gradle file for this feature. | ||
| * If the project is properly set up for Auto Scan you should see an HTML report show up in your build/reports | ||
| * directory as well as a result uploaded to your scan result dashboard. | ||
| */ | ||
| @RunWith(AndroidJUnit4::class) | ||
| class AutoScanDemoTest { | ||
|
|
||
| @get:Rule | ||
| val composeTestRule = createAndroidComposeRule<MainActivity>() | ||
|
|
||
| private fun openTab(menuItemId: Int) = onView(withId(menuItemId)).perform(click()) | ||
|
|
||
| private fun getString(resId: Int): String = | ||
| composeTestRule.activity.getString(resId) | ||
|
|
||
| @Test | ||
| fun catalogTabIsShownOnLaunch() { | ||
| // Catalog is the start destination, so its heading should be visible immediately. | ||
| onView(withId(R.id.catalog_heading)) | ||
| .check(matches(isDisplayed())) | ||
| .check(matches(withText(R.string.catalog))) | ||
| } | ||
|
|
||
| @Test | ||
| fun navigatingToMenuShowsComposeContent() { | ||
| openTab(R.id.menu) | ||
|
|
||
| // The Menu screen is rendered with Compose, so assert against the Compose tree. | ||
| composeTestRule.waitForIdle() | ||
| composeTestRule.onNodeWithText(getString(R.string.customer)).assertIsDisplayed() | ||
| composeTestRule.onNodeWithText(getString(R.string.james_anderson)).assertIsDisplayed() | ||
| composeTestRule.onNodeWithText(getString(R.string.log_out)).assertIsDisplayed() | ||
| } | ||
|
|
||
| @Test | ||
| fun tabSelectionStateIsRestoredWhenReturningToCatalog() { | ||
| openTab(R.id.catalog) | ||
| onView(withId(R.id.catalog_heading)) | ||
| .check(matches(isDisplayed())) | ||
| .check(matches(withText(R.string.catalog))) | ||
| } | ||
| } |
37 changes: 37 additions & 0 deletions
37
app/src/androidTest/java/com/deque/mobile/axedevtoolssampleapp/AxeTestClass.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| package com.deque.mobile.axedevtoolssampleapp | ||
|
|
||
| import com.deque.mobile.axedevtoolssampleapp.test.BuildConfig | ||
| import com.deque.mobile.devtools.AxeDevTools | ||
| import org.junit.AfterClass | ||
|
|
||
| abstract class AxeTestClass { | ||
|
|
||
| init { | ||
| /** | ||
| * Start a session on axe Developer Hub with a valid API key and your project ID. If | ||
| * a session has already been started for this test suite, that session will be used instead | ||
| * of creating a new session. | ||
| * | ||
| * You can find and create projects here: https://axe.deque.com/axe-watcher | ||
| */ | ||
|
pat-deque marked this conversation as resolved.
|
||
|
|
||
| axe.startScanSession( | ||
| apiKey = BuildConfig.AXE_DEVTOOLS_APIKEY, | ||
| projectId = BuildConfig.AXE_DEVTOOLS_PROJECT_ID | ||
| ) | ||
| } | ||
|
|
||
| companion object { | ||
| val axe = AxeDevTools() | ||
|
|
||
| @JvmStatic | ||
| @AfterClass | ||
| fun afterClass() { | ||
| // Generates a report of all scans in a given test class to a report that | ||
| // tells you which accessibility violations we found. | ||
| axe.generateHtmlReportAndSummary("axe") | ||
|
|
||
| axe.tearDown() | ||
| } | ||
|
Copilot marked this conversation as resolved.
|
||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.