Skip to content
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

Experiment with a different test file design, single file with all mappings #14

Open
wants to merge 2 commits into
base: acacia-test-testdriver
Choose a base branch
from

Conversation

spectranaut
Copy link
Collaborator

@spectranaut spectranaut commented Aug 15, 2024

I'm using the core-aam/acacia/json/ as a temporary directory for these tests.

These tests use js object that contains an entry for each table in core-aam. So the tests are very simple:

<div id=test role=blockquote>quote</div>

<script>
  AAMUtils.verifyAPI(
    'test',   /* dom id of object to test in accessibility tree */
    rolemap['blockquote'],   /* object representing all statements in https://w3c.github.io/core-aam/#blockquote */
    'role=blockquote'   /* string used in subtest name */
  );
</script>

Here is the result of this test: https://spectranaut.github.io/examples/wpt/role_blockquote_test.html

Right now the test has one subtest for each API, regardless of whether or not that API applies to platform the test is being run on. The test was run on linux, so only the first test -- the test of the linux API Atspi -- is useful. The other tests aren't actually run (because you can't run a mac accessibility API test on linux), which you can see by expanding and seeing No assertions run. If you are curious about this design, read more in this other PR's description

"blockquote"
]
]
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the objects that are currently being used in the manual tests, the directory above this one:
https://github.com/web-platform-tests/wpt/blob/master/core-aam/blockquote-manual.html

We could have an entry for every role in the role mapping tables of core-aam. Then, when a role from a different AAM points to core-aam, you can use the same map here. Currently the keys are the id refs for the mapping table, such as: https://w3c.github.io/core-aam/#role-map-blockquote

let result = await test_driver.test_accessibility_api_node('test',
rolemap['role-map-blockquote']
);
assert_equals(result, "match", "role=blockquote");
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little awkward, result is either an error message containing all the statements that were incorrect, or, the string "match"

@spectranaut spectranaut force-pushed the acacia-test-experiment-json branch 3 times, most recently from af6e66f to d98a6ef Compare August 21, 2024 22:52
@spectranaut spectranaut changed the title Experiment with a different test file design, and a JSON for testable statements Experiment with a different test file design, single file with all mappings Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant