File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import {
1818 testSetup ,
1919 checkForFailures ,
2020 idle ,
21+ setPauseTime ,
2122} from './test_setup.js' ;
2223
2324suite ( 'Scrolling into view' , function ( ) {
@@ -56,17 +57,19 @@ suite('Scrolling into view', function () {
5657 await checkForFailures ( this . browser , this . currentTest ! . title , this . currentTest ?. state ) ;
5758 } ) ;
5859
59- test ( 'Insert scrolls new block into view' , async function ( ) {
60+ test . only ( 'Insert scrolls new block into view' , async function ( ) {
6061 // Increase timeout to 10s for this longer test.
6162 this . timeout ( PAUSE_TIME ? 0 : 10000 ) ;
6263
64+ setPauseTime ( 0 ) ;
6365 await tabNavigateToWorkspace ( this . browser ) ;
6466
6567 // Separate the two top-level blocks by moving p5_draw_1 further down.
6668 await keyDown ( this . browser , 3 ) ;
6769 await sendKeyAndWait ( this . browser , 'm' ) ;
6870 await sendKeyAndWait ( this . browser , [ Key . Alt , Key . ArrowDown ] , 25 ) ;
6971 await sendKeyAndWait ( this . browser , Key . Enter ) ;
72+ setPauseTime ( 1000 ) ;
7073 const movedBlockBounds = await this . browser . execute ( ( ) => {
7174 const block = Blockly . getFocusManager ( ) . getFocusedNode ( ) as Blockly . BlockSvg ;
7275 const blockBounds = block . getBoundingRectangleWithoutChildren ( ) ;
Original file line number Diff line number Diff line change @@ -42,7 +42,9 @@ let driver: webdriverio.Browser | null = null;
4242 * the browser.wait* functions if you need your test to wait for
4343 * something to happen after sending input.
4444 */
45- export const PAUSE_TIME = 0 ;
45+ export var PAUSE_TIME = 1000 ;
46+
47+ export function setPauseTime ( time : number ) { PAUSE_TIME = time ; }
4648
4749/**
4850 * Start up WebdriverIO and load the test page. This should only be
@@ -595,6 +597,7 @@ export async function sendKeyAndWait(
595597 // Send all keys in one call if no pauses needed.
596598 keys = Array ( times ) . fill ( keys ) . flat ( ) ;
597599 await browser . keys ( keys ) ;
600+ await idle ( browser ) ;
598601 } else {
599602 for ( let i = 0 ; i < times ; i ++ ) {
600603 await browser . keys ( keys ) ;
You can’t perform that action at this time.
0 commit comments