Skip to content

Commit

Permalink
Merge pull request #7 from HDE/single-engine
Browse files Browse the repository at this point in the history
removed multi engine support, simplified APIs/tests
  • Loading branch information
ojii committed Jun 15, 2017
2 parents bbf9dfb + 3f1de9e commit 35711a6
Show file tree
Hide file tree
Showing 39 changed files with 608 additions and 980 deletions.
12 changes: 11 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,14 @@ jobs:
- setup_remote_docker
- checkout
- run: docker-compose build
- run: docker-compose run -e WEB_APP_BASE_URL=http://webapp:5000 -e REMOTE_WEBDRIVERS=http://firefox:4444/wd/hub?browser=firefox -e DOCS_DIR=/code/docs/ -e SPHINXBUILD=/code/test-env/bin/sphinx-build --rm test
- run:
name: Run tests
command: |
docker-compose \
run \
-e WEB_APP_BASE_URL=http://webapp:5000 \
-e REMOTE_WEBDRIVERS=http://firefox:4444/wd/hub?browser=firefox \
-e DOCS_DIR=/code/docs/ \
-e SPHINXBUILD=/code/test-env/bin/sphinx-build \
--rm \
test
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,30 @@
[![CircleCI](https://circleci.com/gh/HDE/arsenic/tree/master.svg?style=svg)](https://circleci.com/gh/HDE/arsenic/tree/master) [![Documentation Status](https://readthedocs.org/projects/arsenic/badge/?version=latest)](http://arsenic.readthedocs.io/en/latest/?badge=latest)


Asynchronous, framework-independent webdriver client for AsyncIO/Aiohttp and
Tornado.
Asynchronous webdriver client built on asyncio.


## Quickstart

Let's run Firefox via Geckodriver using Aiohttp.
Let's run a local Firefox instance.


```python

from arsenic.engines.aiohttp import Aiohttp
from arsenic import get_session
from arsenic.browsers import Firefox
from arsenic.services import Geckodriver


async def example():
# start geckodriver using aiohttp/asyncio
async with Geckodriver().run(Aiohttp) as driver:
# start a new browser session
async with driver.session(Firefox()) as session:
# go to example.com
await session.get('http://example.com')
# wait up to 5 seconds to get the h1 element from the page
h1 = await driver.wait_for_element(5, 'h1')
# print the text of the h1 element
print(await h1.get_text())
# Runs geckodriver and starts a firefox session
async with get_session(Geckodriver(), Firefox()) as session:
# go to example.com
await session.get('http://example.com')
# wait up to 5 seconds to get the h1 element from the page
h1 = await session.wait_for_element(5, 'h1')
# print the text of the h1 element
print(await h1.get_text())
```

For more information, check [the documentation](https://arsenic.readthedocs.io/)
6 changes: 4 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ services:
webapp:
build: tests/app
firefox:
image: selenium/standalone-firefox
image: selenium/standalone-firefox:latest
depends_on:
- "webapp"
test:
build: .
build:
context: .
dockerfile: tests/Dockerfile
depends_on:
- "webapp"
- "firefox"
115 changes: 0 additions & 115 deletions docs/contrib/extend.rst

This file was deleted.

18 changes: 0 additions & 18 deletions docs/contrib/testing.rst

This file was deleted.

23 changes: 0 additions & 23 deletions docs/examples/aiohttp/app.py

This file was deleted.

73 changes: 0 additions & 73 deletions docs/examples/aiohttp/test_app.py

This file was deleted.

23 changes: 0 additions & 23 deletions docs/examples/tornado/scripting.py

This file was deleted.

0 comments on commit 35711a6

Please sign in to comment.