Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lugensa/gocept.jasmine
Jasmine integration for selenium.
https://github.com/lugensa/gocept.jasmine
jasmine python selenium
Last synced: about 1 month ago
JSON representation
Jasmine integration for selenium.
- Host: GitHub
- URL: https://github.com/lugensa/gocept.jasmine
- Owner: lugensa
- License: other
- Created: 2019-08-27T07:21:03.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-11-28T14:31:32.000Z (about 2 years ago)
- Last Synced: 2024-10-14T13:36:34.641Z (2 months ago)
- Topics: jasmine, python, selenium
- Language: JavaScript
- Homepage:
- Size: 82 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
===============================
The gocept.jasmine distribution
===============================Jasmine integration for selenium.
Usage
=====You need two things to run jasmine tests with selenium:
* A test app which requires your resources and jasmine test files::
class MyTestApp(gocept.jasmine.jasmine.TestApp):
def need_resources(self):
# Require your resources here
my.package.resource.need()
my.package.tests.jasmine_tests.need()@property
'
def body(self):
# HTML setup for your tests goes here
return '* A TestCase with the jasmine layer::
class MyJasmineTestCase(gocept.jasmine.jasmine.TestCase):
layer = gocept.jasmine.jasmine.get_layer(MyTestApp())
def test_integration(self):
self.run_jasmine()The important things here are, that the `get_layer` function is given
your jasmine app and that the returned Layer is used on your TestCase.In your Test, simple run `run_jasmine`, which will open the TestApp in your
Browser. The TestApp renders your `body` and includes all needed resources and
then runs the jasmine tests. `run_jasmine` will wait for these tests to finish
and the report success or failure. Jasmine tracebacks and error details are
visible through the selenium error handling.Debugging
---------You can set the `debug` flag on your test case to get a pdb debugger right
after the start of the jasmine tests. This lets you debug your jasmine tests
within your browser::class MyJasmineTestCase(gocept.jasmine.jasmine.TestCase):
layer = gocept.jasmine.jasmine.get_layer(MyTestApp())
debug = Truedef test_integration(self):
self.run_jasmine()