Coder Social home page Coder Social logo

jupyterlab / galata Goto Github PK

View Code? Open in Web Editor NEW
30.0 30.0 15.0 10.78 MB

JupyterLab UI Testing Framework

License: BSD 3-Clause "New" or "Revised" License

JavaScript 71.60% TypeScript 21.96% HTML 0.86% Jupyter Notebook 1.20% EJS 4.32% Python 0.06%

galata's Issues

Galata appears to not work with JupyterLab 3.0.9

When using Galata with JupyterLab 3.0.9 I am having the following error in the terminal running Galata:

yarn run v1.22.10
$ galata
 LOG  Deleting existing test output directory 'test'
Determining test suites to run...

 LOG  Using Galata built for JupyterLab version 3.0.3
 LOG  Failed to inject galataip object into browser context

 RUNS  tests/widgets.test.ts
 LOG  jest output not found
 LOG  galata output not found
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

And at the same moment I am getting the following error in the terminal running jupyterlab:

[E 2021-03-29 15:03:37.662 ServerApp] Uncaught exception GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1617023016487 (::1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/lab/api/settings/@jupyterlab/docmanager-extension:plugin?1617023016487', version='HTTP/1.1', remote_ip='::1')
    Traceback (most recent call last):
      File "/home/martin/miniconda3/envs/bqplot/lib/python3.9/site-packages/tornado/web.py", line 1704, in _execute
        result = await result
    tornado.iostream.StreamClosedError: Stream is closed

--update-references could maybe create the reference directory

When running --update-references for the first time, the command fails with:

Reference directory './reference-output' does not exist.
error Command failed with exit code 1.

Maybe Galata could automatically create the reference directory if it doesn't exist?

Allow for custom tab bar ids

Problem

For now the set of tab bar ids is defined here:

type SidebarTabId = 'filebrowser' | 'jp-running-sessions' | 'tab-manager' | 'jp-property-inspector' | 'table-of-contents' | 'extensionmanager.main-view' | 'jp-debugger-sidebar';

It would be great if this could be made configurable, or be able to pass any id.

For example the @jupyterlab/git extension adds a panel to the left area, and this extension could use galata for end to end testing.

Proposed Solution

Allow arbitrary ids (as strings)?

Additional context

Related to #45

From galata using playwright to playwright with galata

Problem

playwright is an amazing tool with a strong support from Microsoft and the community. So we can only expect it to grow in reliability and ease of usage. In particular with v1.12 a test runner was released with the builtin ability to compare image, generate trace, create videos, running tests in parallel, fixtures, reporters,... . I think we should onboard that as there is no value for us to try keeping up the pace by hiding the tool.

Proposed Solution

  • Embrace playwright test runner
    • Port current report generator to be a valid playwright reporter
    • Unlock the ability to create test from the code generator tool by copy-paste

while keeping the nice helpers functions.

Format with ESLint and Prettier

As mentioned in #48, we should adopt ESLint and Prettier to format the code base, so it's consistent with the tooling already in place in the main JupyterLab repo.

Consider using playwright?

Opening a new issue to discuss potential ideas for the next iterations.

I've been trying out playwright lately and it's been really nice. It's also great that chromium, firefox and webkit are all supported by default.

Since the playwright api is very similar to puppeteer (and the same for the 3 browser), maybe it's worth considering it in the future?

The change would most likely be about updating imports, and maybe also about simplifying selectors. The galata cli could also be extended to configure browsers, so they could be set as matrix items on CI.

Rename the default branch to main

I was under the impression this was already the case since this is a new repo, but it could be that it was created a while ago when main was not the default on GitHub yet.

How about renaming the default master branch to main? It should be possible to do that easily via the settings menu.

Now would be a good time since there is no open PRs so it shouldn't be too disruptive.

Support / documentation for Linux users

Really nice library, thanks for putting that together!

At the moment it looks like the chrome path defaults to the one for Mac when using galata on Linux:

https://github.com/mbektasbbg/galata/blob/91f99885a0be2da7c048d587d9ccf697773b180a/packages/galata/bin/cli.js#L142-L144

Wondering whether it should be the default? Or maybe default to /usr/bin/chromium or which chromium?

Otherwise a small section in the documentation / readme could be enough as a starting point.

Add theme option

It would be nice to be able to select the theme with a command-line option, something like:

galata --theme=dark

Publish to npm

We should publish galata to npm, so it can easily be added as a dependency in other projects, list the galata example:

"@jupyterlab/galata": "3.0.3-1"

Things to check before releasing:

  • Release strategy: how often and when (depending on the JupyterLab release cycle?)
  • Versioning
  • API breaking changes

Switch from npm to yarn (or jlpm) for development

To make the tooling consistent across the @jupyterlab repositories, we should consider using yarn or jlpm instead of npm to manage dependencies and run scripts.

This would then also mean replacing the existing package-lock.json by a new yarn.lock.

Support for alternate JupyterLab distributions

Problem

It would be great if galata could also be used to test alternative JupyterLab distributions such as RetroLab.

Proposed Solution

At the moment it looks like the default page hits the /lab endpoint:

let jlabUrl = path.join(baseUrl, 'lab');

There is also this setup logic using /lab by default:

let resourcePath = '/lab';
if (context.jlabWorkspace) {
resourcePath = `${resourcePath}/workspaces/${context.jlabWorkspace}`;
}
await context.page.evaluate(async resourcePath => {
await window.galataip.waitForLaunch(resourcePath);
}, resourcePath);

Additional context

A potential candidate for this would be RetroLab: jupyterlab/retrolab#135

Fix top-level version in `package.json` for the releaser

Description

The top-level version added in #72 was used mostly as a placeholder so it can be npm pack.

"version": "0.1.0",

However it ended as the version added to the changelog:

image

Reproduce

In the automated changelog entry in #73, it picked up 0.1.0 as the version instead of 3.0.11-3 as specified in the workflow.

Probably we could sync the lerna version with the top-level one in package.json

Create RELEASE.md

We should add a RELEASE.md at the top level of the repo, that will list the steps for releasing a new version of Galata.

The file would also explain how to version Galata, and when to upgrade for new version of JupyterLab (#29 could be a reference).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.