-
Notifications
You must be signed in to change notification settings - Fork 419
Infrastructure: Address failing macOS regression tests #3115
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
efaa27c
Use Key.META for text area all text selection for OS agnostic testing…
stalgiag 25084fd
Use getOSPreferredModifierKey() utility to off cross-platform support
stalgiag ef0f7ba
Fix disclosure_navigation_hybrid test, support platform specific key …
stalgiag 0a84f39
Skip tests in combobox that cannot be replicated on macOS, reset disc…
stalgiag 75bf788
Remove errant Home and End assumption in combobox test
stalgiag 900f783
Example click retry logic for flakey macOS disclosure_navigation_hybr…
stalgiag 856188e
Add small delay to handle scroll event, disclosure_navigation_hybrid …
stalgiag 05cdaa6
Add macOS regression test runner, don't test cursor move on macOS
stalgiag 7b3c6a5
Missing matrix os yaml property for macos regression testing
stalgiag a0b7fde
Use GNU grep in regression tests
stalgiag a4688c0
Add GNU grep for macOS in regression-tests workflow
stalgiag bc9922f
Merge branch 'fix-toolbar_toolbar-tests' of https://github.com/w3c/ar…
stalgiag 60d40b1
Revert mac os CI testing
stalgiag aa905f6
JSDoc example for translatePlatformKeys, rename translatePlatformKey
stalgiag 607299d
Add TODO and issue link for combobox grid combo
stalgiag File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,7 +82,11 @@ ariaTest( | |
|
||
if (links.length > 0) { | ||
await buttons[b].click(); | ||
|
||
await links[0].click(); | ||
// Add a small delay here to ensure that the scroll to focus event | ||
// has time to complete and doesn't interfere with the next assertion | ||
await t.context.session.sleep(300); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test was giving intermittent failures. I determined that this was due to the scroll to focus event fired by the link click interfering with the assertion ( |
||
|
||
t.is( | ||
await links[0].getAttribute('aria-current'), | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* Returns true if the current platform is macOS | ||
* | ||
* @returns {boolean} | ||
*/ | ||
module.exports = function isMacOS() { | ||
return process.platform === 'darwin'; | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
const { Key } = require('selenium-webdriver'); | ||
const isMacOS = require('./isMacOS'); | ||
|
||
const MAC_KEY_MAPPINGS = { | ||
[Key.CONTROL]: Key.META, | ||
}; | ||
|
||
/** | ||
* Translates a key or key combination for the current OS | ||
* | ||
* @param {string|string[]} keys - The key(s) to translate | ||
* @returns {string[]} - The translated key(s) as a flat array ready for spreading | ||
* | ||
* @example | ||
* // On macOS, translates CONTROL to META (Command key) | ||
* translatePlatformKey(Key.CONTROL) | ||
* // Returns: [Key.META] | ||
* | ||
* // On non-macOS systems, returns key unchanged | ||
* translatePlatformKey(Key.CONTROL) | ||
* // Returns: [Key.CONTROL] | ||
* | ||
* // Works with arrays of keys for key combinations | ||
* translatePlatformKey([Key.CONTROL, 'a']) | ||
* // Returns on macOS: [Key.META, 'a'] | ||
* // Returns on Windows/Linux: [Key.CONTROL, 'a'] | ||
* | ||
* // Usage with Selenium WebDriver: | ||
* const selectAllKeys = translatePlatformKey([Key.CONTROL, 'a']); | ||
* const selectAllChord = Key.chord(...selectAllKeys); | ||
* await element.sendKeys(selectAllChord); | ||
*/ | ||
function translatePlatformKeys(keys) { | ||
const keyArray = Array.isArray(keys) ? keys : [keys]; | ||
if (!isMacOS()) { | ||
return keyArray; | ||
} | ||
|
||
return keyArray.reduce((acc, key) => { | ||
const mappedKey = MAC_KEY_MAPPINGS[key] || key; | ||
return acc.concat(mappedKey); | ||
}, []); | ||
} | ||
|
||
module.exports = translatePlatformKeys; |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.