test framework for web apps that use JavaScript #1001
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#1001
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If we add dependencies on JavaScript to Tahoe, such as the 'Tahoe Explorer' frontend as proposed in #1000, we will need a test framework for the JS code. Ideally, it should be able to test interactions between JavaScript and Python, and automatically run tests in multiple web browsers.
I looked into what node.js uses since I consider node.js to be inspired by Twisted (at least by Twisted's event-based concurrency) and Twisted has an excellent tradition of testing. Here's what I found: http://debuggable.com/posts/unit-testing-with-node-js:4b647d40-34e4-435a-a880-3b04cbdd56cb
I've been investigating Windmill, which seems to have similar functionality to Selenium in terms of web browser testing, but which uses Python as its scripting language (in addition to JavaScript). It looks like a very good fit, because we need to be able to script interactions between Python code and a web app (for example, setting up a temporary grid + directory structure in Python and then testing the web app against it, or hooking Python objects to make sure they are receiving the intended requests from the app).
I was initially concerned that Windmill might be overkill. However, if we need to be able to test Tahoe Explorer (#1000) as well as Josip Lisec's Music player and Hasini Gunasinghe's Blog for GSoC (if those projects are accepted), then I think we may end up needing a fair amount of the functionality that it provides over and above simpler JS test frameworks like JSUnit or node.js.
Windmill is Apache 2.0-licensed.
test framework for JavaScriptto test framework for web apps that use JavaScriptAttachment test_explorer.py (948 bytes) added
Dummy test that opens Firefox, IE, Safari and Chrome using Windmill
Attachment tilting.py (2193 bytes) added
Simple hack to run Windmill tests from a trial test suite
Attachment tilting.2.py (9 bytes) added
ignore me (file deleted)
I agree with David-Sarah that Windmill, in the long run, is better option.
It probably is a bit overkill for simpler tests, but assertion module from node.js just can't cover all of the functionality - with node.js one can't test the actual UI part since there is no DOM API provided by default. Module which provides DOM API exists but is far from complete and it has dependencies on other modules/tools, and thus I'm not sure if introducing all these dependencies is worth the trouble.
On the other hand, Windmill runs the tests directly in the browser and thus allows testing every aspect of app's functionality. Also, Windmill's IDE seems like an rather excellent tool.
Replying to josipl:
Also, that would only be testing against that particular implementation of the DOM, rather than the implementations used by Firefox, IE, Safari, and Chrome.
I'm going to attach a patch that adds a dependency on Windmill to source:_auto_deps.py . Please test that this doesn't break anything on any platform (it doesn't on win32), but don't commit to trunk yet.
Oh, please test that after applying this patch and installing Tahoe using
python setup.py install
, thatpython -c "import windmill; help(windmill)"
works. It should print a package description.Attachment add-windmill-dependency-darcspatch.txt (1794 bytes) added
Add dependency on Windmill (fixed patch)
The patch has been applied, and hasn't caused any build failures so far (but not all of the buildslaves are on-line at the moment).
Now that more builders are working, we can see that this patch breaks the "Desert Island" test:
http://tahoe-lafs.org/buildbot/builders/clean/builds/2262/steps/test-desert-island/logs/stdio
This build step ends with:
To make it pass this test, add a copy of windmill into the file that it fetches at the beginning of the test:
Since we don't actually use Windmill yet, and it's 3.2 MiB, I think we should just comment out the dependency for 1.7. We've already tested that it installs on all supported platforms, which was the intention of applying the patch.
Replying to davidsarah:
Done in changeset:43b092ffeb7cae9e.
I'm attaching a modified version of tilting.py which was discussed the other day in IRC along with another dummy test.
TiltingMixin
'ssetUp
method now starts an introducer and storage nodes. Results of !JavaScript tests are being reported in a manner which test suite can easier pickup.test_dummy.py
file contains a dummy test which copies code of an imaginary application topublic_html
directory of a started storage node and then starts !JavaScript tests.There are some unresolved issues with code: I couldn't find a way to disable Windmill from printing to stdout (someone on Windmill's IRC channel suggested that it should be simply used as a Nose plugin).
The other problem, is the way waiting for introducer.furl file is implemented - using a loop and sleep(), this will be fixed once Python API for creating/starting/stopping nodes gets implemented.
Attachment tilting3.py (6421 bytes) added
Attachment test_dummy.py (515 bytes) added
Dummy test which should run JS tests and open Firefox.
Note that such a dependency should probably be added to {{tests_require}}} in source:setup.py and not to
install_requires
in source:_auto_deps.py.