Skip to content
This repository was archived by the owner on Aug 4, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
31ed01c
Initial setup.py file
kidk Feb 10, 2017
f38da54
Added more python versions for testing, including python 3
kidk Feb 10, 2017
0599a26
Removed deprecated --use-mirrors
kidk Feb 10, 2017
eacaa04
Removed support for 2.6
kidk Feb 10, 2017
97e3742
Replaced http with https in tests
kidk Feb 10, 2017
351a364
Converted print statements for python3 support
kidk Feb 10, 2017
628102a
Fixed compatibility issues with python3
kidk Feb 10, 2017
9145f74
Fixed flake too long line issue in ActionTest
kidk Feb 10, 2017
3fae4b7
Fixed trailing whitespace in ActionTest
kidk Feb 10, 2017
7245b37
Merge pull request #25 from kidk/feature/python3
kidk Feb 10, 2017
e20f247
Initial setup.py file
kidk Feb 10, 2017
f429c67
Merge branch 'feature/pip-preparation' of github.com:kidk/felt into f…
kidk Feb 19, 2017
1a207a7
Made main.py executable
kidk Feb 19, 2017
ff400d1
Initial implementation for auto download feature
kidk Feb 19, 2017
cae771d
Removed downloading of phantomjs from TravisCI
kidk Feb 19, 2017
0cc533a
Fixed flake8 errors
kidk Feb 19, 2017
6ab1391
Fixed missing init in tests
kidk Feb 19, 2017
d2a262a
Fixed invalid syntax for python3
kidk Feb 19, 2017
81b3379
Added phantomjs linux download
kidk Feb 19, 2017
6cafaa5
Fixed issue on linux with PhantomJS download
kidk Feb 19, 2017
1a89fed
Fixed incorrect file location
kidk Feb 19, 2017
73e9cb7
Fixed import of urlretrieve for python3
kidk Feb 19, 2017
f45845b
Fixed incorrect module for urlretrieve
kidk Feb 19, 2017
e2a88ba
Fixed os.remove on Linux
kidk Feb 19, 2017
49f33ec
Made test.py executable
kidk Feb 19, 2017
02a6993
Merge pull request #28 from kidk/feature/auto-download
kidk Feb 19, 2017
79bcc86
Merged branch develop into develop
kidk Feb 19, 2017
c8421e8
Scenario param now takes a directory (fix for #10)
kidk Feb 19, 2017
535dbd6
Added DockerFile and support for image creation
kidk Feb 21, 2017
5a54430
Updated README to match latest version
kidk Feb 21, 2017
77009b0
Converted all worker.js output to Json for improved parsing
kidk Feb 21, 2017
0bf4681
Fixed failing test because of data format change
kidk Feb 21, 2017
112cf0e
Fixed invalid python3 print command
kidk Feb 21, 2017
6436dfa
Merge pull request #29 from kidk/feature/docker
kidk Feb 21, 2017
0c79617
Converted json to yml for testing
kidk Feb 22, 2017
75f5015
Ignore the bin/ directory
kidk Feb 22, 2017
7c8145d
Made main.py executable
kidk Feb 19, 2017
8cb767e
Initial implementation for auto download feature
kidk Feb 19, 2017
199b743
Removed downloading of phantomjs from TravisCI
kidk Feb 19, 2017
bf57df2
Fixed flake8 errors
kidk Feb 19, 2017
4accbdd
Fixed missing init in tests
kidk Feb 19, 2017
543786a
Fixed invalid syntax for python3
kidk Feb 19, 2017
7478478
Added phantomjs linux download
kidk Feb 19, 2017
55abe8a
Fixed issue on linux with PhantomJS download
kidk Feb 19, 2017
f49dd55
Fixed incorrect file location
kidk Feb 19, 2017
b3f0cd8
Fixed import of urlretrieve for python3
kidk Feb 19, 2017
3db83c3
Fixed incorrect module for urlretrieve
kidk Feb 19, 2017
adcc9a5
Fixed os.remove on Linux
kidk Feb 19, 2017
70f33a4
Made test.py executable
kidk Feb 19, 2017
fa47523
Scenario param now takes a directory (fix for #10)
kidk Feb 19, 2017
70b9c83
Added DockerFile and support for image creation
kidk Feb 21, 2017
b54d987
Updated README to match latest version
kidk Feb 21, 2017
4cbb0ca
Converted all worker.js output to Json for improved parsing
kidk Feb 21, 2017
cd6af37
Fixed failing test because of data format change
kidk Feb 21, 2017
bcb7008
Fixed invalid python3 print command
kidk Feb 21, 2017
ff5bfc7
Ignore the bin/ directory
kidk Feb 22, 2017
25729e3
Exclude bin/ dir from flake8 tests
kidk Mar 2, 2017
b69a53d
Basic pip building and installation
kidk Jun 5, 2017
27d2a5b
Merge branch 'feature/pip-preparation' into feature/action-redesign
kidk Jun 5, 2017
f512c89
Added basic yaml support
kidk Jun 21, 2017
efceaae
First 'working' example of the new steps system
kidk Jun 21, 2017
1365516
Fixed incorrect scenario loading
kidk Jun 21, 2017
18574e9
Refactored worker step and fixed bug with click
kidk Jun 21, 2017
367f827
Fixed issue with result processing
kidk Jun 21, 2017
8c4c0a6
Improved sleep step and converted it to new action system
kidk Jun 21, 2017
55d137f
Improved handeling of output encoding
kidk Jul 21, 2017
04e660c
Fixed issue with loadpage
kidk Jul 21, 2017
a0b4d25
Added tests to setup.py (currently failing)
kidk Jul 21, 2017
df0e654
Moved test to setup.py and fixed failing test
kidk Jul 23, 2017
54c06b5
Replaced value with url in load steps
kidk Jul 23, 2017
166d898
Immediat exit after a failed step
kidk Jul 23, 2017
9b64887
Added data output in debug mode
kidk Jul 23, 2017
d5c0ac4
Added eslint for javascript linting
kidk Jul 23, 2017
593e343
Use older version of node for travis
kidk Jul 23, 2017
35cde36
Set fixed version for npm
kidk Jul 23, 2017
d59ca92
Added build step to travisCI
kidk Jul 23, 2017
863d0a9
Removed commentjson dependency
kidk Aug 13, 2017
4967f14
Added pyyaml dependency
kidk Aug 13, 2017
bba163f
ADded missing break in action switch
kidk Aug 13, 2017
649a0f4
Changed default timeout from 0 (off) to 30 seconds.
kidk Aug 13, 2017
c278b2d
Added check on load step to see if url key is available
kidk Aug 13, 2017
fb61792
Added more output to steps in worker.js
kidk Aug 13, 2017
f56f910
Fixed failing login test
kidk Aug 13, 2017
0da4f32
Merge pull request #31 from kidk/feature/action-redesign
kidk Aug 13, 2017
6aaf5cf
Moved simple example from seperate repo into main
kidk Aug 13, 2017
fc5ed75
Added local webserver to handle test requests
kidk Aug 14, 2017
34be236
Fixed incorrect timeout exit
kidk Aug 24, 2017
318f2ca
Improved local webserver handeling
kidk Aug 24, 2017
cd73180
Moved flake8 configuration to setup.cfg
kidk Aug 24, 2017
5fd34c2
Fixed low level flake8 tests
kidk Aug 24, 2017
d89c7bb
Added multi stage build to Dockerfile
kidk Sep 16, 2017
f728f93
Added travis multi stage build and push to Docker hub
kidk Sep 16, 2017
f22cc35
Fixed some flake8 errors
kidk Sep 16, 2017
8bf85f8
Moved some install instructions into travis stages
kidk Sep 16, 2017
f46695d
Fixed incorrect travis configuration
kidk Sep 16, 2017
c45acf5
Fixed incorrect usage of travis stages
kidk Sep 16, 2017
e365fbe
Fixed incorrect print in ActionTest
kidk Sep 16, 2017
fa4aceb
Fixed missing python3 dependencies
kidk Sep 16, 2017
d216c63
Fixed flake8 failing test
kidk Sep 16, 2017
f0b5d9b
Removed Python 3.4 support and added 3.6
kidk Sep 16, 2017
8a724ae
Added library/python to Dockerfile
kidk Sep 16, 2017
29e4912
Enabled docker service for build
kidk Sep 16, 2017
022c85f
Use latest version of Docker in travis
kidk Sep 16, 2017
15132f9
Second try to use the latest version of Docker on travis
kidk Sep 16, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
dist/
14 changes: 14 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"env": {
"phantomjs": true
},
"parserOptions": {
"ecmaVersion": 6
},
"rules": {
"semi": 2,
"eqeqeq": "off",
"curly": "error",
"quotes": ["error", "single"]
}
}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ target/
.idea/

# PhantomJS
phantomjs
bin/

# Vagrant
.vagrant

# npm
node_modules/
51 changes: 38 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,48 @@
language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"

env:
global:
- secure: "bVmx1X1ngsMaR3FvVcjkYp0TZQHlahpP3IZ5UV7F8XEi93KoGMR7kRKeG5hBJcUmEnpmZ1RX/4tvqGVesTlcUY1cWufacBFsb5ZkmfFqJOoztNR2Fio1X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ygtg8hdurlT18e8a5SOAWSIqHInrxA7rChplK+vd9D6TSsqEdshOaHBt+arg/A55NpOSlD230tcP0e+anaJ/xL1BOC5JFT6ZAvkL2oSAJ6I+JUsI320DoRV0UZjo7udbJw5UIPm9nOj2KhgyNVKwRjwCcCWqPQoe19fsY="
- COMMIT=${TRAVIS_COMMIT::8}

cache:
directories:
- "travis_phantomjs"
before_install:
- "export PHANTOMJS_VERSION=2.1.1"
- "phantomjs --version"
- "export PATH=$PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin:$PATH"
- "phantomjs --version"
- "if [[ $(phantomjs --version) != '$PHANTOMJS_VERSION' ]]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi"
- "if [[ $(phantomjs --version) != '$PHANTOMJS_VERSION' ]]; then wget https://github.com/Medium/phantomjs/releases/download/v$PHANTOMJS_VERSION/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -O $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2; fi"
- "if [[ $(phantomjs --version) != '$PHANTOMJS_VERSION' ]]; then tar -xvf $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi"
- "phantomjs --version"
- "bin"

install:
- "pip install flake8 --use-mirrors"
- "pip install flake8"
- "nvm install 8.1.4"
- "nvm use 8.1.4"
- "npm i -g eslint"

before_script:
- "flake8 ."
- "eslint src/felt/js/**"

before_script: "flake8 --ignore=D203 ."
script:
- "python setup.py build"
- "python setup.py test"

script: "python test.py"
jobs:
include:
- stage: docker
python: 3.6
services:
- docker
before_install:
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
script:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- export REPO=kidk/felt
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
- docker build -f Dockerfile -t $REPO:$COMMIT .
- docker tag $REPO:$COMMIT $REPO:$TAG
- docker push $REPO

19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM library/python:3 as python-base

COPY . /felt/
WORKDIR "/felt/"
RUN python setup.py bdist_egg

FROM python:3

COPY --from=python-base /felt/dist/felt-1.0.0-py3.6.egg /

RUN easy_install /felt-1.0.0-py3.6.egg

RUN felt --init /srv

ENV PYTHONUNBUFFERED 0

ENTRYPOINT ["felt"]

CMD ["--verbose", "/srv"]
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,23 @@ Felt is a front-end load tester. It generates load by running a lot of browser i

## Requirements

* Tested on Python 2.7.10
* Tested on Python 2.7, 3.3, 3.4 and 3.5
* Unix based operating system
* Local install of [PhantomJS](http://phantomjs.org/download.html) or [SlimerJS](https://slimerjs.org/download.html) available in PATH
* Install commentjson (`pip install commentjson`)
* Install pip requirements (`pip install -r requirements.txt`)

## Quick start

1. `git clone https://github.com/kidk/felt.git`
1. `cd felt`
1. Download PhantomJS from http://phantomjs.org/download.html
1. Unzip and move PhantomJS executable into felt directory

The felt directory should look something like this:
$ ls
LICENSE README.md js main.py phantomjs
1. pip install commentjson
1. `pip install -r requirements.txt`
1. `python main.py --verbose examples/basic.json`
1. `ctrl + c` to stop

## Usage
```
usage: main.py [-h] [--debug] [--verbose] [--threads THREADS] [--test] [--screenshot]
usage: main.py [-h] [--debug] [--verbose] [--threads THREADS] [--test]
[--slimerjs] [--screenshot] [--user-agent USERAGENT]
[--max-time MAXTIME] [--init]
scenario

Start workload.
Expand All @@ -55,12 +50,17 @@ positional arguments:
scenario

optional arguments:
-h, --help show this help message and exit
--debug enable debug information
--verbose makes generator more verbose
--threads THREADS number of threads to run simultaneously
--test run a scenario only once
--screenshot save screenshot per step
-h, --help show this help message and exit
--debug enable debug information
--verbose makes generator more verbose
--threads THREADS number of threads to run simultaneously
--test run a scenario only once
--slimerjs use slimerjs instead of phantomjs
--screenshot provide screenshots after each step
--user-agent USERAGENT
provide a custom User-Agent
--max-time MAXTIME provide a maximum runtime
--init only download browsers
```

## Actions list
Expand Down Expand Up @@ -107,7 +107,7 @@ optional arguments:
* `selector` - Value for `querySelector`

## Development
Included in this repository is a [Vagrant](https://www.vagrantup.com/) file which you can use to develop Felt locally. Please don't hesitate to submit bugs, feature requests or pull requests.
Please don't hesitate to submit bugs, feature requests or pull requests. We welcome feedback and would love to hear how you're using Felt in your own environment.

## Sponsored by CoScale
<img src="http://docs.coscale.com/gfx/logo.png" alt="CoScale logo" />
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
alpha
1.0.0
4 changes: 0 additions & 4 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ Vagrant.configure("2") do |config|
s.inline = "apt-get -y install xvfb firefox unzip python-pip"
end

config.vm.provision "install_dependencies_pip", type: "shell" do |s|
s.inline = "pip install commentjson"
end

config.vm.provision "install_phantomjs", type: "shell" do |s|
s.inline = "wget -nv https://bitbucket.org/ariya/phantomjs/downloads/" + phantomjs + ".tar.bz2 && tar jvxf " + phantomjs + ".tar.bz2 && rm " + phantomjs + ".tar.bz2 && chown -R vagrant:vagrant " + phantomjs
end
Expand Down
11 changes: 6 additions & 5 deletions examples/basic.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
"variables":[],
"steps": [
{
"action": "open_url",
"value": "http://felt.sava.be/"
"action": "load",
"url": "http://felt.sava.be/"
},
{
"action": "click",
"action": "event",
"type": "click",
"selector": "#navbar > ul > li:nth-child(2) > a"
},
{
"action": "open_url",
"value": "http://felt.sava.be/login.php"
"action": "load",
"url": "http://felt.sava.be/login.php"
}
]
}
12 changes: 12 additions & 0 deletions examples/basic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---

steps:
- action: load
url: http://felt.sava.be/

- action: event
type: click
element: "#navbar > ul > li:nth-child(2) > a"

- action: load
url: http://felt.sava.be/login.php
24 changes: 17 additions & 7 deletions examples/chaos.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,37 @@
"variables":[],
"steps": [
{
"action": "open_url",
"value": "http://felt.sava.be/"
"action": "load",
"url": "http://felt.sava.be/"
},
{
"action": "click_one",
"action": "event",
"type": "click",
"on_multiple": "random",
"selector": "a"
},
{
"action": "click_one",
"action": "event",
"type": "click",
"on_multiple": "random",
"selector": "a"
},
{
"action": "click_one",
"action": "event",
"type": "click",
"on_multiple": "random",
"selector": "a"
},
{
"action": "click_one",
"action": "event",
"type": "click",
"on_multiple": "random",
"selector": "a"
},
{
"action": "click_one",
"action": "event",
"type": "click",
"on_multiple": "random",
"selector": "a"
}
]
Expand Down
30 changes: 30 additions & 0 deletions examples/chaos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---

steps:
- action: load
url: http://felt.sava.be/

- action: event
type: click
on_multiple: random
selector: a

- action: event
type: click
on_multiple: random
selector: a

- action: event
type: click
on_multiple: random
selector: a

- action: event
type: click
on_multiple: random
selector: a

- action: event
type: click
on_multiple: random
selector: a
21 changes: 12 additions & 9 deletions examples/login.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,35 @@
"variables":[],
"steps": [
{
"action": "open_url",
"value": "http://felt.sava.be/"
"action": "load",
"url": "http://felt.sava.be/"
},
{
"action": "open_url",
"value": "http://felt.sava.be/login.php"
"action": "load",
"url": "http://felt.sava.be/login.php"
},
{
"action": "set_value",
"action": "set",
"attribute": "value",
"selector": "input[name=username]",
"value": "felt"
},
{
"action": "set_value",
"action": "set",
"attribute": "value",
"selector": "input[name=password]",
"value": "isAWESOME"
},
{
"action" : "sleep",
"value" : {
"action" : "wait",
"time" : {
"min": 1000,
"max": 5000
}
},
{
"action": "submit",
"action": "event",
"type": "submit",
"selector": "#loginForm"
}
]
Expand Down
28 changes: 28 additions & 0 deletions examples/login.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---

steps:
- action: load
url: http://felt.sava.be/

- action: load
url: http://felt.sava.be/login.php

- action: set
attribute: value
selector: input[name=username]
value: felt

- action: set
attribute: value
selector: input[name=password]
value: isAWESOME

- action: sleep
time:
min: 1000
max: 5000

- action: event
type: submit
selector: "#loginForm"

Loading