|
@@ -41,52 +41,6 @@ async function main() {
|
|
|
console.error(`Parsed an error from text content: ${error.message}`, error);
|
|
|
}
|
|
|
|
|
|
- function delay(duration) {
|
|
|
- return function() {
|
|
|
- return new Promise(function(resolve, reject) {
|
|
|
- setTimeout(function() {
|
|
|
- resolve();
|
|
|
- }, duration);
|
|
|
- });
|
|
|
- };
|
|
|
- }
|
|
|
-
|
|
|
- const w1Id = await page.evaluate(async () => {
|
|
|
- const jlab = window.jupyterlab;
|
|
|
- const w1 = await jlab.commands.execute('fileeditor:create-new');
|
|
|
- const w2 = await jlab.commands.execute('fileeditor:create-new');
|
|
|
- await new Promise((resolve, reject) => {
|
|
|
- setTimeout(() => {
|
|
|
- resolve();
|
|
|
- }, 1000);
|
|
|
- });
|
|
|
- w1.content._ensureFocus();
|
|
|
- await new Promise((resolve, reject) => {
|
|
|
- setTimeout(() => {
|
|
|
- resolve();
|
|
|
- }, 1000);
|
|
|
- });
|
|
|
- // jlab.shell.activateById(w1.id);
|
|
|
- // w2.activate();
|
|
|
- // jlab._pluginMap['@jupyterlab/docmanager-extension:plugin'].service.mode;
|
|
|
- return w1.id;
|
|
|
- });
|
|
|
-
|
|
|
- // foundId = await page.evaluate(async (w1Id) => {
|
|
|
- // const jlab = window.jupyterlab;
|
|
|
- // jlab.shell.activateById(w1Id);
|
|
|
- // return jlab.shell.currentWidget.id;
|
|
|
- // }, w1Id);
|
|
|
-
|
|
|
- // const sel = "#" + w1Id + " .CodeMirror";
|
|
|
- // console.log(sel);
|
|
|
- // // await page.focus(sel);
|
|
|
-
|
|
|
- // console.log(foundId);
|
|
|
-
|
|
|
- await page.waitFor(2000);
|
|
|
- console.log(page.url());
|
|
|
-
|
|
|
await browser.close();
|
|
|
|
|
|
if (testError) {
|