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

Fix for completer benchmark in CM6 (Lab 4.0) #23

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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