-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Convert JS tests to Selenium #3335
Comments
I would like to take this on. Getting started on it now |
Hmm. It appears that the Selenium IDE is no longer being supported in Firefox: There is a chrome extension, but it is still under development and has a lot of issues. Have we considered Endtest? Are there any other testing frameworks we would consider using? |
The Selenium IDE isn't important to us - I haven't used it at all. We're using Selenium Webdriver, and the Firefox backend is still supported. |
Ah, ok! Can I be assigned this issue? |
I want to contribute to this good first issue. |
Github only lets us assign issues to people with push access to the repo, so just commenting that you plan to work on it is sufficient - especially since this is one a large task which multiple people can work on. You can see the existing JS tests, for example this file. By comparison, here's the initial Selenium test. We want to add a Selenium (Python) version of each JS test, check that it passes, and then delete the JS test. |
PhantomJS has suspended development, providing some extra impetus to make this switch. |
I see this is a good first issue. |
If no one is working in this issue I'd be happy to help |
This is an issue that can be split up into small pieces, so multiple people can work on it at once. However, as I describe in the first message, it's not the easiest issue. You need to look at the Javascript tests (see the links in the first message), pick a test and understand what it's doing. Then look at the Selenium tests (also linked in the first message), and understand how they work. Then translate the Javascript test you chose to Selenium. This should get easier as we convert more of the tests, because there will be more examples to look at. @mpacer and I are working on converting some of them, so if you're not sure what to do, I can hopefully point you to an example pull request soon. |
From the example selenium test you posted in the description I got an initial good idea. I'm familiar with selenium and webdrivers and I'm willing to invest time understanding the phantomjs tests so I can start working on https://github.com/jupyter/notebook/tree/master/notebook/tests/notebook if that's okay. And once your pull request is ready I can use it as a guide to make sure my code is consistent with yours and also in case I got stuck or something. But before I do that I have a question, you would want all tests from the three directories you linked above in the same
Let me know if it's okay to start tackling the |
For now, let's keep the |
Okay great! I'll start tackling the test files in the |
Sounds good. @mpacer was looking at converting We also hit one or two fiddly bits with opening a new notebook and switching between edit and command mode. @mpacer was writing a couple of utility functions to do those things. |
In order to support multiple tests in the same notebook I’m running into some issues with the utility functions as they are currently. I’m going to try to make something a bit more comprehensive for manipulating the notebook on the page. If you want to do any tests on the tree page though (not on notebooks themselves) I won’t be touching that outside of #3412 until I get these utilities working. |
@takluyver Hi! Do you mind giving a brief overview as to what the example tests do? To me they look like they're doing something quite different, and I'm a bit confused |
I would like to contribute as well. Need some help getting started. |
You mean the test that's already converted to Selenium? The changes in #3412 make it easier to follow, so I'll describe this version of it It gets The first loop clicks down into directories in the list, until it reaches one with no subdirectories. At each level, it waits for something with the HTML class The second loop goes back up the levels, using browser history. Again, at each step it waits for something with class This may not seem like much of a test, but we recently made it navigate directories without reloading the page, using the history API in Javascript, and there were a few bugs in that. |
Ah thank you for explaining. Just for clarification though, this Selenium test |
Nope, those are different. I removed the equivalent Javascript test when I added the Selenium, but you can still see it in history: this Javascript test was the equivalent of this Selenium test in master. |
So basically write python code that is equivalent to the JS file that you already have? Which one can i start with? |
Yup, that's about right. However, it's somewhat blocked at the moment because @mpacer is working on some utilities for the test framework to interact with the notebook UI, and there was only one test for the file list, which was already converted. The tests in the Alternatively, you could write new Selenium tests for parts of the UI other than the notebook editor - e.g. the 'running' tab in the dashboard, or authentication (visit |
I had a go at creating a mocha test loading |
@mpacer I'm trying to convert |
Hi, i am interested in contributing. What can i work on? |
I am also interested in contributing, what tasks are recommended to work on? |
Hi all - so long as there are JS test files left (there are - see the links in the initial issue description), there are things to do. Briefly:
There are several which have been done and merged already which can serve as examples - see the "this was referenced" links in this issue. I marked this as 'good first issue' because it doesn't require deep understanding of Jupyter, and it's fairly unlikely to clash with other work people might be doing. But it's not easy: you'll need to set up Selenium, understand the intent behind some Javascript code, and figure out how to check the same thing from Selenium. Maybe 'good second issue' would be more accurate, but we don't have a tag like that. |
Hello. I'm interested in convert some JS to selenium. Can I start working on the move_multiselection.js test ? |
Hello. i would like to contribute by converting Javascript tests to Selenium. I am going to start with safe_append_output.js |
* Add selenium test helper to wait for JS expressions * Convert notifications JS test to selenium (#3335)
Hi, is there a particular reason why none of the JS tests inside the tests/base folder have been converted? If not, I'd like to start working on converting security.js to selenium. |
I believe I could do convert a few tests, Let me know if that's good with Y'all |
I would also be willing to help out. I will convert a few also. Is there a way to check which still need to be converted? |
Hi, I'd love to help out, I have a lot of experience with Python and Selenium, and some experience in JS. Is this issue still open? What can I do? |
Although we're not entertaining new features at this time, I think contained test improvements would qualify as the kinds of changes we can still consider. @maxhw98, @brian-ketelboeter, @ikyman, and @06fahad - thank you for your interest and I really apologize for the delay in getting back to you. As there have been a number of you recently interested in helping (thank you!), I would suggest some coordination. Please ping back via a comment when you'd like to take things up. If there are multiple, perhaps some coordination can take place (dividing by subsystem/service perhaps?) as this may be a large task. Since this issue is front-end-oriented, I won't be of much help, but I'm sure we can find folks to answer any questions you might have. Thank you! |
Hello! I'd like to contribute with some test cases. Are there any specific ones you guys think it will be better to start with? Plese let me know. |
Hi, yeah I’m also super interested in contributing.
… On Sep 7, 2021, at 9:50 AM, Lucas Tosetto Morvillo ***@***.***> wrote:
Hello! I'd like to contribute with some test cases. Are there any specific ones you guys think it will be better to start with? Plese let me know.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#3335 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AOBJOTP6S4VHZJNCF6KI5TLUAYKA3ANCNFSM4EQQSCPA>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
@lucastosetto - Thank you again for your interest (@maxhw98 as well). Unfortunately, I cannot direct you as I'm not a front-end dev/maintainer and am not familiar with any of the tests or their structure. From a practical standpoint, I would say that kernel and content services are two primary areas of focus. Since they are relatively disjoint (from the backend service perspective), they might prove to be a good separation point. |
Closing as the |
We have a number of Javascript tests:
We would like to convert these to use Selenium, in this folder. To run selenium tests, you will need the Selenium Python package and a 'driver' (a backend for it to talk to your browser). Once you have those, you can run:
This is quite a big task, and it probably won't be done in one pull request, but rather several smaller ones converting individual bits of the tests.
I'm marking this 'good first issue', though it's a bit borderline. It requires a decent understanding of Javascript and Python, but you don't need to know much about Jupyter to translate the tests. It should get easier as more of the tests are translated, because there will be more examples to refer to.
The text was updated successfully, but these errors were encountered: