-
Notifications
You must be signed in to change notification settings - Fork 13
test: Make tests faster, more robust, more consistent #660
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
Changes from all commits
12ac3cd
6bd74be
0e57632
0feffcc
074c50a
7b9a026
7c73fc3
80229d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ import { | |
| testSetup, | ||
| testFileLocations, | ||
| PAUSE_TIME, | ||
| sendKeyAndWait, | ||
| tabNavigateToWorkspace, | ||
| keyLeft, | ||
| keyRight, | ||
|
|
@@ -25,10 +26,7 @@ import { | |
| import {Key} from 'webdriverio'; | ||
|
|
||
| suite('Keyboard navigation on Blocks', function () { | ||
| // Setting timeout to unlimited as these tests take a longer time to run than most mocha test | ||
| this.timeout(0); | ||
|
|
||
| // Setup Selenium for all of the tests | ||
| // Clear the workspace and load start blocks. | ||
| suiteSetup(async function () { | ||
| this.browser = await testSetup(testFileLocations.NAVIGATION_TEST_BLOCKS); | ||
| }); | ||
|
|
@@ -239,23 +237,18 @@ suite('Keyboard navigation on Blocks', function () { | |
| await tabNavigateToWorkspace(this.browser); | ||
| await this.browser.pause(PAUSE_TIME); | ||
| await focusOnBlock(this.browser, 'text_print_1'); | ||
| await this.browser.keys('m'); | ||
| await this.browser.pause(PAUSE_TIME); | ||
| await sendKeyAndWait(this.browser, 'm'); | ||
|
|
||
| chai.assert.isTrue(await isDragging(this.browser)); | ||
|
|
||
| await this.browser.keys(Key.Tab); | ||
| await this.browser.pause(PAUSE_TIME); | ||
| await sendKeyAndWait(this.browser, Key.Tab); | ||
|
|
||
| chai.assert.isFalse(await isDragging(this.browser)); | ||
| }); | ||
| }); | ||
|
|
||
| suite('Keyboard navigation on Fields', function () { | ||
| // Setting timeout to unlimited as these tests take a longer time to run than most mocha test | ||
| this.timeout(0); | ||
|
|
||
| // Setup Selenium for all of the tests | ||
| // Clear the workspace and load start blocks. | ||
|
Collaborator
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. Note that unlike the rest of the test files, this one only does this before the entire suite, not before each test. Possibly worth either changing that or adding a comment.
Collaborator
Author
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. Good point re: documentation. I had noticed the |
||
| suiteSetup(async function () { | ||
| this.browser = await testSetup(testFileLocations.NAVIGATION_TEST_BLOCKS); | ||
| }); | ||
|
|
@@ -354,8 +347,7 @@ suite('Keyboard navigation on Fields', function () { | |
| // Open a field editor dropdown | ||
| await focusOnBlockField(this.browser, 'logic_boolean_1', 'BOOL'); | ||
| await this.browser.pause(PAUSE_TIME); | ||
| await this.browser.keys(Key.Enter); | ||
| await this.browser.pause(PAUSE_TIME); | ||
| await sendKeyAndWait(this.browser, Key.Enter); | ||
|
|
||
| // Try to navigate to a different block | ||
| await keyRight(this.browser); | ||
|
|
@@ -368,13 +360,12 @@ suite('Keyboard navigation on Fields', function () { | |
| // Open colour picker | ||
| await focusOnBlockField(this.browser, 'colour_picker_1', 'COLOUR'); | ||
| await this.browser.pause(PAUSE_TIME); | ||
| await this.browser.keys(Key.Enter); | ||
| await this.browser.pause(PAUSE_TIME); | ||
| await sendKeyAndWait(this.browser, Key.Enter); | ||
|
|
||
| // Move right to pick a new colour. | ||
| await keyRight(this.browser); | ||
| // Enter to choose. | ||
| await this.browser.keys(Key.Enter); | ||
| await sendKeyAndWait(this.browser, Key.Enter); | ||
|
|
||
| // Focus seems to take longer than a single pause to settle. | ||
| await this.browser.waitUntil( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.