Repository navigation
test: Mobilewright Basic UI loop flow (fill, screenshot, back x20) - #15
Open
mobile-kevin wants to merge 1 commit into
Open
mobile-kevin wants to merge 1 commit into
mobile-kevin wants to merge 1 commit into
Conversation
Adds a Mobilewright end-to-end test plus the Node/Mobilewright harness
(package.json, mobilewright.config.ts, tsconfig.json) at the repo root.
The test, per iteration: relaunches the app, opens the Basic UI screen from
Home, fills the first text field (text_field) with 'hello world', asserts the
value, screenshots, presses Android back, and asserts it is back on Home.
Runs 20 iterations. Assertions guard each step.
Locators are grounded in the real layouts (getByText('Basic UI') for the Home
nav row, getByTestId('text_field') for the first EditText). Typechecks under
strict tsc and is discovered by 'mobilewright test --list' (20 tests).
Not yet run against a live emulator — a starting point for refinement.
An Android-native (Espresso/UiAutomator) variant is left as a TODO.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this adds
A Mobilewright end-to-end test for the Playground Android app, plus the minimal Node/Mobilewright harness to run it:
tests/basic-ui-loop.spec.ts— the flow (see below)mobilewright.config.ts—platform: android,bundleId: com.mobilenext.playground, HTML reporterpackage.json/package-lock.json—mobilewright+@mobilewright/test0.0.22,typescripttsconfig.json— strict typecheck for the test dir.gitignore— ignoresnode_modules/,test-results/, reportsThe flow (one iteration)
text_field) with"hello world"and assert its value.test-results/basic-ui-loop/iteration-N.png).It runs 20 iterations via
test.describe+ a loop. Assertions guard each step (Basic UI shown, field holds the text, back on Home).Locators (grounded in the real layouts, not guessed)
screen.getByText('Basic UI')— the tappablebtn_basic_uirow inactivity_main.xml.screen.getByTestId('text_field')— the firstEditTextinactivity_basic_ui.xml(id="text_field",contentDescription="text_field", hint"Text Field"). Mobilewright derives a testId from the Android resource-id / content-description, so this is the highest-priority, deterministic locator.getByText('Web View')— a Home row that does not appear on the Basic UI screen (the toolbar there is titled "Basic UI", so that string alone wouldn't distinguish the two screens).Status — please run it, Gil
tscand is discovered bymobilewright test --list(20 tests).toHaveValueon an Android EditText) is unvalidated. This is a correct, readable starting point for you to run and refine.How to run
mobilewright 0.0.22's config has noinstallAppsoption, so app install is a documented prerequisite (step 1) rather than automated in config.Follow-up (not in this PR)
TODOin the spec, intentionally not built. This PR is Mobilewright-first only.getByTestId('text_field')doesn't resolve on-device, the fallback isgetByLabel('text_field')(contentDescription surfaces as the accessibility label on Android).Opened from a fork (
mobile-kevin/playground) — the shared bot account has read but not push access to the upstream repo.