Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ jobs:
- 'e2e/lib/**'
- 'e2e/test/**'
- 'e2e/scripts/**'
- 'e2e/flows/**'
- 'e2e/tests/**'
- 'e2e/config.yaml'
- 'e2e/config/matrix.yml'
Expand Down
11 changes: 9 additions & 2 deletions e2e/flows/checkout/dismiss-active-field.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@ appId: ${E2E_APP_ID}
commands:
- tapOn: "Done"
- waitForAnimationToEnd
# The checkout page also renders a disabled 24 by 22 pixel node whose accessibility text is
# "selected". Without enabled: true the branch taps that node after every text entry, and the
# field that follows never opens.
- runFlow:
when:
platform: ios
visible: "selected"
visible:
text: "selected"
enabled: true
commands:
- tapOn: "selected"
- tapOn:
text: "selected"
enabled: true
- waitForAnimationToEnd
- runFlow:
when:
Expand Down
30 changes: 30 additions & 0 deletions e2e/test/maestro_test_tags_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,36 @@ def test_the_launch_flow_never_clears_app_state
)
end

def test_the_dismiss_flow_only_taps_an_enabled_element
body = File.read(File.join(E2E_ROOT, "flows", "checkout", "dismiss-active-field.yaml"))

refute_match(
/^\s*(?:visible|tapOn):\s*"selected"\s*$/,
body,
"a bare `selected` selector matches a disabled 24 by 22 pixel node on iOS, and Maestro " \
"then taps the fixed point behind it after every text entry, so the selector must " \
"also require enabled: true"
)
end

# The scripts filter is the only thing that selects the scripts-test job, and that job is the
# only thing that runs this file. Several guards here read flows/, so the filter must watch it.
def scripts_filter_paths
workflow = YAML.safe_load_file(File.expand_path("../.github/workflows/ci.yml", E2E_ROOT), aliases: true)
step = workflow.fetch("jobs").fetch("changes").fetch("steps").find { |candidate| candidate["id"] == "infra" }

YAML.safe_load(step.fetch("with").fetch("filters")).fetch("scripts")
end

def test_ci_runs_the_ruby_suite_when_a_flow_changes
assert_includes(
scripts_filter_paths,
"e2e/flows/**",
"the scripts filter in .github/workflows/ci.yml must watch e2e/flows/**, or a commit that " \
"only edits a flow runs none of the guards in this file"
)
end

def test_there_is_at_least_one_test_to_check
refute_empty(test_files)
refute_empty(shared_test_files)
Expand Down
Loading