Repository navigation
Conversation
The flow-yaml reference said '^$' checks that a field is empty and named only the iOS text field as an exception. On Android a password field, an empty field with a hint and a field with a content description read text; on Chromium a password input and an input or textarea with an aria-label, aria-labelledby, placeholder or title do. List them, and pin each row with a test.
This branch has not been deployed
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.
Problem
reference/e2e-yaml.mdx(flow-yaml.mdxin #1288) says "Use'^$'to check that a field is empty" and names only the iOS text field as an exception. Many empty fields have text in the flow tree, so'^$'can never pass on them.Fix
Docs only. The paragraph now says
'^$'checks an element with no text, and a table lists the empty fields it never passes on, with the text Argent reads instead. Tests pin each row. A code comment and a test comment that repeated "can check an empty field" are corrected.'^$'passes[password]'^$'passes'^$'passesinput'^$'passes[password]input/textareawitharia-label,aria-labelledbyorplaceholder'^$'passesinput/textareawithtitle'^$'passesNo workaround is documented: Chromium never reads the value of those fields, and the only candidate elsewhere (
equals: <hint>) also passes when the typed text equals the hint.E2E on Electron: same 26 flows, before (0.29.0 bundle, = origin/main code) and after (this branch's
packages/argent/dist/cli.js)Fixture: one page with each field kind; one flow per field asserting
matches: '^$'while empty, thentype abc+contains: abc. Run withargent flow run <file> --device chromium-cdp-9391. Results are identical on both builds (only the docs changed); the after run's tool-server waspackages/argent/dist/tool-server.cjsfrom this branch.'^$'abc,contains: abc<input>,<input>with<label for>,<textarea>aria-labelinput / textareaName/Long textaria-labelledbyinputEmailplaceholderinput / textareaType here/Notestitleinput / textareaHint/Commenttype=password[password][password]A raw-CDP oracle confirmed every field held
abcafter typing.Android rows: source (
flow-android-tree.tslabelOf/[password]; the devtools helper dumps an empty hinted field'stextas its hint) plus earlier emulator runs offlow-executeon 0.28.0 and 0.29.0:element matched id="ff" but its text was "Type here" (wanted to match /^$/)and... id="fg" but its text was "[password]"for an empty password field.Tests and local CI
New tests pin each documented row. Each was checked against a mutation of the code it pins; every mutation fails only the new test in its file:
[password]only when the field has textcontent-descon an EditText""forshowing-hinttitlefallbacknpx tsc --build,typecheck:tests,typecheck:scripts: pass@argent/installeropencode globalPathfailing only because this machine has a real~/.config/opencode/opencode.jsonc(passes with a clean HOME; test(installer): keep the opencode default globalPath test out of the real home #1351)prettier --check .,npm run knip(dist-free tree), eslint on the changed files: passnpx docusaurus buildand docstypecheck: pass