Skip to content

Commit

Permalink
Merge pull request #23 from krassowski/completer-scenario-improvements
Browse files Browse the repository at this point in the history
Fix for completer benchmark in CM6 (Lab 4.0)
  • Loading branch information
krassowski authored Dec 25, 2022
2 parents cbe1533 + b8a9ca4 commit 67e53d0
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/scenarios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,12 @@ export class CompleterScenario

if (!this.useNotebook) {
// Scroll down a little bit to avoid out of view bug
this.editor!.querySelector('.CodeMirror-scroll')!.scrollBy({
top: 500,
// `.CodeMirror-scroll` is CM5, `.cm-scroller` is CM6
const scrollArea =
this.editor!.querySelector('.CodeMirror-scroll')! ||
this.editor!.querySelector('.cm-scroller')!;
scrollArea.scrollBy({
top: 20 * this.options.setup.tokenCount,
left: 0,
behavior: 'smooth'
});
Expand Down Expand Up @@ -276,8 +280,12 @@ export class CompleterScenario
// need to query for a completer with programatically set styles (which are
// things like position (top/left/width/height) which are only present in the
// active completer
await page.waitForSelector('.jp-Completer[style]', { state: 'attached' });
await page.waitForSelector('.jp-Completer[style]', { state: 'visible' });
await page.waitForSelector('.jp-Completer.jp-HoverBox[style]', {
state: 'attached'
});
await page.waitForSelector('.jp-Completer.jp-HoverBox[style]', {
state: 'visible'
});
await layoutReady();
}

Expand Down

0 comments on commit 67e53d0

Please sign in to comment.