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

Refactor test design to allow commands.json file in each pattern directory #73

Merged
merged 7 commits into from
Feb 24, 2020

Conversation

spectranaut
Copy link
Contributor

From now on, we will simply add a commands.json file with the tasks/mode/assistive technology to command list data structure.

@@ -0,0 +1 @@
{"navigate to menuitemcheckbox in submenu using interaction mode": {"interaction": {"jaws": [["ENTER"], ["SPACE"], ["DOWN"]]}}, "close submenu of menubar using reading mode": {"reading": {"jaws": [["ESC"]]}}, "open submenu of menubar using interaction mode": {"interaction": {"jaws": [["ENTER"], ["SPACE"], ["UP_AND_DOWN"]]}}, "read menu item in menubar using interaction mode": {"interaction": {"jaws": [["INS_TAB"], ["INS_UP"]]}}, "read disabled menuitem in a submenu using interaction mode": {"interaction": {"jaws": [["INS_TAB"], ["INS_UP"]]}}, "tab to menubar in reading mode": {"reading": {"jaws": [["TAB_AND_SHIFT_TAB"]]}}, "change state of menuitemcheckbox in submenu using interaction mode": {"interaction": {"jaws": [["ENTER"], ["SPACE"]]}}, "navigate to menubar in reading mode": {"reading": {"jaws": [["UP_AND_DOWN"], ["F_AND_SHIFT_F"]]}}, "read menuitemcheckbox in a submenu using reading mode": {"reading": {"jaws": [["INS_TAB"], ["INS_UP"]]}}, "navigate to menuitemcheckbox in submenu using reading mode": {"reading": {"jaws": [["UP_AND_DOWN"]]}}, "change state of menuitemradio in submenu using interaction mode": {"interaction": {"jaws": [["ENTER"], ["SPACE"]]}}, "close submenu of menubar using interaction mode": {"interaction": {"jaws": [["ESC"]]}}, "read disabled menuitem in a submenu using reading mode": {"reading": {"jaws": [["INS_TAB"], ["INS_UP"]]}}, "navigate to menuitem in menubar using interaction mode": {"interaction": {"jaws": [["TAB_AND_SHIFT_TAB"]]}}, "read menuitemradio in a group in submenu using reading mode": {"reading": {"jaws": [["INS_TAB"], ["INS_UP"]]}}, "read menuitemradio in a group in a submenu using interaction mode": {"interaction": {"jaws": [["INS_TAB"], ["INS_UP"]]}}, "read menuitemcheckbox in a submenu using interaction mode": {"interaction": {"jaws": [["INS_TAB"], ["INS_UP"]]}}, "change state of menuitemcheckbox in submenu using reading mode": {"reading": {"jaws": [["ENTER"], ["SPACE"]]}}, "read menu item in menubar using reading mode": {"reading": {"jaws": [["INS_TAB"], ["INS_UP"]]}}, "navigate to menuitemradio in submenu using interaction mode": {"interaction": {"jaws": [["ENTER"], ["SPACE"], ["DOWN"]]}}, "navigate to menuitem in menubar using reading mode": {"reading": {"jaws": [["LEFT_AND_RIGHT", " (with Smart Navigation on)"]]}}, "change state of menuitemradio in submenu using reading mode": {"reading": {"jaws": [["ENTER"], ["SPACE"]]}}, "navigate to menuitemradio in submenu using reading mode": {"reading": {"jaws": [["UP_AND_DOWN"]]}}, "open submenu of menubar using reading mode": {"reading": {"jaws": [["ENTER"], ["SPACE"]]}}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this file be edited so that it spans more than one line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It could, but I did have the suggestion/thought from Mike that if it is printed like this then people might realize it is generated and not for manual editing.

Copy link
Contributor

Choose a reason for hiding this comment

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

It wasn't clear to me. Is there a way for us to note this difference?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

very soon all of these files will be generated, so there won't be a need for the distinction!

// Get the commands for this test file ("commands.json" in the same directory)
// and initialize the commands API.
var xobj = new XMLHttpRequest();
xobj.overrideMimeType("application/json");
Copy link
Contributor

Choose a reason for hiding this comment

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

Is XMLHttpRequest used to explicitly invoke xobj.overrideMimeType?

nvda: 'NVDA',
voiceover: 'VoiceOver'
}
export class commandsAPI {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the commandsAPI the pattern we are going to use in the production system?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right now, this file is part of the test suite, it's for rendering the test files. So only indirectly, because the production system consumes the tests

Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, can we use a more descriptive class name or have a JSDoc about what this class does? commandsAPI wasn't clear enough for me to understand until I saw it in use.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point. There should be documentation. I'll add it right now!

@@ -0,0 +1 @@
{"navigate to menuitemcheckbox in submenu using interaction mode": {"interaction": {"jaws": [["ENTER"], ["SPACE"], ["DOWN"]]}}, "close submenu of menubar using reading mode": {"reading": {"jaws": [["ESC"]]}}, "open submenu of menubar using interaction mode": {"interaction": {"jaws": [["ENTER"], ["SPACE"], ["UP_AND_DOWN"]]}}, "read menu item in menubar using interaction mode": {"interaction": {"jaws": [["INS_TAB"], ["INS_UP"]]}}, "read disabled menuitem in a submenu using interaction mode": {"interaction": {"jaws": [["INS_TAB"], ["INS_UP"]]}}, "tab to menubar in reading mode": {"reading": {"jaws": [["TAB_AND_SHIFT_TAB"]]}}, "change state of menuitemcheckbox in submenu using interaction mode": {"interaction": {"jaws": [["ENTER"], ["SPACE"]]}}, "navigate to menubar in reading mode": {"reading": {"jaws": [["UP_AND_DOWN"], ["F_AND_SHIFT_F"]]}}, "read menuitemcheckbox in a submenu using reading mode": {"reading": {"jaws": [["INS_TAB"], ["INS_UP"]]}}, "navigate to menuitemcheckbox in submenu using reading mode": {"reading": {"jaws": [["UP_AND_DOWN"]]}}, "change state of menuitemradio in submenu using interaction mode": {"interaction": {"jaws": [["ENTER"], ["SPACE"]]}}, "close submenu of menubar using interaction mode": {"interaction": {"jaws": [["ESC"]]}}, "read disabled menuitem in a submenu using reading mode": {"reading": {"jaws": [["INS_TAB"], ["INS_UP"]]}}, "navigate to menuitem in menubar using interaction mode": {"interaction": {"jaws": [["TAB_AND_SHIFT_TAB"]]}}, "read menuitemradio in a group in submenu using reading mode": {"reading": {"jaws": [["INS_TAB"], ["INS_UP"]]}}, "read menuitemradio in a group in a submenu using interaction mode": {"interaction": {"jaws": [["INS_TAB"], ["INS_UP"]]}}, "read menuitemcheckbox in a submenu using interaction mode": {"interaction": {"jaws": [["INS_TAB"], ["INS_UP"]]}}, "change state of menuitemcheckbox in submenu using reading mode": {"reading": {"jaws": [["ENTER"], ["SPACE"]]}}, "read menu item in menubar using reading mode": {"reading": {"jaws": [["INS_TAB"], ["INS_UP"]]}}, "navigate to menuitemradio in submenu using interaction mode": {"interaction": {"jaws": [["ENTER"], ["SPACE"], ["DOWN"]]}}, "navigate to menuitem in menubar using reading mode": {"reading": {"jaws": [["LEFT_AND_RIGHT", " (with Smart Navigation on)"]]}}, "change state of menuitemradio in submenu using reading mode": {"reading": {"jaws": [["ENTER"], ["SPACE"]]}}, "navigate to menuitemradio in submenu using reading mode": {"reading": {"jaws": [["UP_AND_DOWN"]]}}, "open submenu of menubar using reading mode": {"reading": {"jaws": [["ENTER"], ["SPACE"]]}}}
Copy link
Contributor

Choose a reason for hiding this comment

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

It wasn't clear to me. Is there a way for us to note this difference?

nvda: 'NVDA',
voiceover: 'VoiceOver'
}
export class commandsAPI {
Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, can we use a more descriptive class name or have a JSDoc about what this class does? commandsAPI wasn't clear enough for me to understand until I saw it in use.

@evmiguel
Copy link
Contributor

After discussion with @spectranaut, in the future, the commands.json and test files will be generated. The official process of how these files get generated has yet to be solidified, but will be decided in the near future. For now, both generated and manually created commands.json will be committed to this repo.

}
import * as keys from './keys.mjs';

/** Class for getting AT-specific instructions for a test against a design pattern. */
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added comments @evmiguel thanks for that nudge

@spectranaut spectranaut merged commit 515808d into master Feb 24, 2020
@spectranaut spectranaut deleted the at-commands-refactor branch March 9, 2020 22:03
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.

2 participants