Skip to content

Commit

Permalink
Merged branch master into bug_json_variable
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaslabbe committed Dec 20, 2016
2 parents 3ae86e3 + f56d735 commit aa1b432
Show file tree
Hide file tree
Showing 6 changed files with 243 additions and 4 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
@@ -1,4 +1,25 @@

## [2.12.0] - 2016-12-19
* [[`6eb371f11c`](https://github.com/AdFabConnect/abejs/commit/6eb371f11c)] - **ic**: adding Mac OSX (gregorybesson)
* [[`542d6148d2`](https://github.com/AdFabConnect/abejs/commit/542d6148d2)] - **ic**: adding Mac OSX (gregorybesson)
* [[`ab35c47fa6`](https://github.com/AdFabConnect/abejs/commit/ab35c47fa6)] - **ic**: adding Mac OSX (gregorybesson)
* [[`139b50cc36`](https://github.com/AdFabConnect/abejs/commit/139b50cc36)] - **ic**: adding Mac OSX (gregorybesson)
* [[`6ecec6a05d`](https://github.com/AdFabConnect/abejs/commit/6ecec6a05d)] - **ic**: adding Mac OSX (gregorybesson)
* [[`b8e002f472`](https://github.com/AdFabConnect/abejs/commit/b8e002f472)] - **fix**: typo in require module (gregorybesson)
* [[`48e0e6690e`](https://github.com/AdFabConnect/abejs/commit/48e0e6690e)] - **feature**: 150 handlebars helpers added to Abe (gregorybesson)
* [[`4167c416bd`](https://github.com/AdFabConnect/abejs/commit/4167c416bd)] - **ic**: adding Mac OsX to the ic (gregorybesson)
* [[`e2b0e54a0e`](https://github.com/AdFabConnect/abejs/commit/e2b0e54a0e)] - **ic**: lint (gregorybesson)
* [[`c0c74f9866`](https://github.com/AdFabConnect/abejs/commit/c0c74f9866)] - **enhancement**: The way we detect Abe as tags (not inside a html attribute) has been widely improved. Adding Unit tests to cover existing and new cases (gregorybesson)
* [[`4d0225282a`](https://github.com/AdFabConnect/abejs/commit/4d0225282a)] - **fix**: The Abe tags not included in html attributes part of a {{#each statement where not modifiable on the frontend anymore (gregorybesson)
* [[`e264029c98`](https://github.com/AdFabConnect/abejs/commit/e264029c98)] - Merge pull request #92 from AdFabConnect/bug_jsoninline (Greg Besson)
* [[`b80883d7df`](https://github.com/AdFabConnect/abejs/commit/b80883d7df)] - **fix**: wrong return (nicolaslabbe)
* [[`31781a6ab8`](https://github.com/AdFabConnect/abejs/commit/31781a6ab8)] - **fix**: bug json inline into abe data (nicolaslabbe)

## [2.11.6] - 2016-12-16
* [[`d9a26ed671`](https://github.com/AdFabConnect/abejs/commit/d9a26ed671)] - Merge pull request #91 from AdFabConnect/bug_duplicate (Greg Besson)
* [[`bcccc6a209`](https://github.com/AdFabConnect/abejs/commit/bcccc6a209)] - **fix**: on duplicate with same name (nicolaslabbe)
* [[`2444bdaaba`](https://github.com/AdFabConnect/abejs/commit/2444bdaaba)] - **doc**: CHANGELOG (gregorybesson)

## [2.11.5] - 2016-12-16
* [[`cb592582be`](https://github.com/AdFabConnect/abejs/commit/cb592582be)] - Merge branch 'master' of https://github.com/AdFabConnect/abejs (gregorybesson)
* [[`3b238c851c`](https://github.com/AdFabConnect/abejs/commit/3b238c851c)] - **fix**: Add options to iFrame (gregorybesson)
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "abe-cli",
"version": "2.11.6",
"version": "2.12.0",
"description": "Abe command line tool",
"main": "src/server/app.js",
"repository": {
Expand Down
125 changes: 122 additions & 3 deletions tests/functional/index.js
Expand Up @@ -31,17 +31,136 @@ describe('Abe', function() {
.setValue('div[data-precontrib-templates=single] > div > input', 'ftest')
.click('button[type="submit"]')
.waitForElementVisible('form[id="abeForm"]', 2000)
.assert.urlEquals("http://localhost:3003/abe/editor/articles/ftest.html", "Clicked URL Matches with URL of the New Window")
.end();
.assert.urlEquals("http://localhost:3003/abe/editor/articles/ftest.html", "Clicked URL Matches with URL of the New Window");
});

it('The created single article is found in the manager', function(client) {
client
.useXpath()
.url('http://localhost:3003/abe/editor')
.waitForElementVisible('//body')
.pause(1000)
.assert.containsText("//table[@id='navigation-list']/tbody/tr[1]/td[2]/a", "/articles/ftest.html");
});

it('The created single article is edited and updated with no change', function(client) {
client
.useXpath()
.url('http://localhost:3003/abe/editor/articles/ftest.html#slug')
.waitForElementVisible('//body')
.assert.title('Abe')
.click("//button[@class='btn btn-primary'][2]")
.pause(2000)
.assert.urlEquals("http://localhost:3003/abe/editor/articles/ftest.html", "Clicked URL Matches with URL of the New Window");
});

it('The updated single article is found in the manager', function(client) {
client
.useXpath()
.url('http://localhost:3003/abe/editor')
.waitForElementVisible('//body')
.pause(1000)
.assert.containsText("//table[@id='navigation-list']/tbody/tr[1]/td[2]/a", "/articles/ftest.html");
});

it('The updated single article is edited once more with a new name', function(client) {
client
.useXpath()
.url('http://localhost:3003/abe/editor/articles/ftest.html#slug')
.waitForElementVisible('//body')
.assert.title('Abe')
.setValue("//div[@data-precontrib-templates='single']//input[@id='name']", 'updated')
.click("//button[@class='btn btn-primary'][2]")
.pause(2000)
.assert.urlEquals("http://localhost:3003/abe/editor/articles/ftestupdated.html", "Clicked URL Matches with URL of the New Window");
});

it('The updated single article is found in the manager', function(client) {
client
.useXpath()
.url('http://localhost:3003/abe/editor')
.waitForElementVisible('//body')
.pause(1000)
.assert.containsText("//table[@id='navigation-list']/tbody/tr[1]/td[2]/a", "/articles/ftestupdated.html");
});

it('The updated single article is duplicated', function(client) {
client
.useXpath()
.url('http://localhost:3003/abe/editor/articles/ftestupdated.html#slug')
.waitForElementVisible('//body')
.assert.title('Abe')
.clearValue("//div[@data-precontrib-templates='single']//input[@id='name']")
.setValue("//div[@data-precontrib-templates='single']//input[@id='name']", 'ftest')
.click("//button[@class='btn btn-primary'][1]")
.pause(2000)
.assert.urlEquals("http://localhost:3003/abe/editor/articles/ftest.html", "Clicked URL Matches with URL of the New Window");
});

it('The updated single article + duplicated are found in the manager', function(client) {
client
.useXpath()
.url('http://localhost:3003/abe/editor')
.waitForElementVisible('//body')
.pause(1000)
.assert.containsText("//table[@id='navigation-list']/tbody/tr[1]/td[2]/a", "/articles/ftest.html")
.end();
.assert.containsText("//table[@id='navigation-list']/tbody/tr[2]/td[2]/a", "/articles/ftestupdated.html");
});

it('The updated article is deleted in the manager', function(client) {
client
.useXpath()
.url('http://localhost:3003/abe/editor')
.waitForElementVisible('//body')
.pause(1000)
.click("//table[@id='navigation-list']/tbody/tr[2]/td[7]/div/a[last()]")
.pause(1000)
.acceptAlert()
.url('http://localhost:3003/abe/editor')
.pause(2000)
.expect.element("//table[@id='navigation-list']/tbody/tr[2]/td[2]/a").text.to.not.contain('/articles/ftestupdated.html');
});

it('The updated single article is published', function(client) {
client
.useXpath()
.url('http://localhost:3003/abe/editor/articles/ftest.html#slug')
.waitForElementVisible('//body')
.assert.title('Abe')
.click("//div[@class='btns']/button[3]")
.pause(2000)
//.assert.containsText("//div[@class='display-status']/span", "publish")
.url('http://localhost:3003/abe/editor')
.waitForElementVisible('//body')
.assert.cssClassPresent("//table[@id='navigation-list']/tbody/tr[1]/td[6]/a", "label-published");
});

it('The updated article is unpublished in the manager', function(client) {
client
.useXpath()
.url('http://localhost:3003/abe/editor')
.waitForElementVisible('//body')
.pause(1000)
.click("//table[@id='navigation-list']/tbody/tr[1]/td[7]/div/a")
.pause(1000)
.acceptAlert()
.url('http://localhost:3003/abe/editor')
.pause(2000)
.assert.cssClassPresent("//table[@id='navigation-list']/tbody/tr[1]/td[5]/a", "label-draft");
});

it('The updated article is deleted in the manager', function(client) {
client
.useXpath()
.url('http://localhost:3003/abe/editor')
.waitForElementVisible('//body')
.pause(1000)
.click("//table[@id='navigation-list']/tbody/tr[1]/td[7]/div/a")
.pause(1000)
.acceptAlert()
.url('http://localhost:3003/abe/editor')
.pause(2000)
.expect.element("//table[@id='navigation-list']/tbody/tr[1]/td[2]/a").text.to.not.contain('/articles/ftest.html');
});
});
});
69 changes: 69 additions & 0 deletions tests/loadtests/README.md
@@ -0,0 +1,69 @@
# Load testing Abe

In order to loadtest [Abe](https://github.com/AdFabConnect/abejs) we choose to use [Locust](http://locust.io/).
Why? Because it's simple and it's doing the job!

## Pre-req

Locust requires Python 2.6+. Python 3.x support is [coming](https://twitter.com/locustio/status/801736746727784448)

## Installation

See [locust.io installation](http://docs.locust.io/en/latest/installation.html)

# Start load testing Abe

We wrote 2 locust files called [manager.py](./manager.py) and [create.py](./create.py)
For both scenarios below you have to setup the number of users you want and the number of users spawned per second.
Start with 10 users and 1 user spawned/second to test and click `Start swarming`.

## Manager

We start with Abe's manager loadtest.

- Run `locust -f manager.py --host=http://your.abe.com` from root of your locust install.
- Go to `http://localhost:8089` on your favorite browser.
- You're all set \o/.

## Create

Then we continue with testing content creation time response.
For this test you'll have to set a abe.json file with secure cookie to false

```javascript
{
"cookie": {
"secure": false
},
"security" : false,
}
```

- Run `locust -f create.py --host=http://your.abe.com` from root of your locust install.
- Go to `http://localhost:8089` on your favorite browser.

# Abe Benchmark

Below you find a benchmark (to be completed) of response time to display a content in Abe.

## Test characteristics

- 1.000 contents in Abe
- locust parameters : 10 users | 1 user spawned/second
- Duration : 5 mins
- Each user call 1 content in abe

## Result

| Abe Version | Average Response Time (s)|
|:-------------:|:------------------------:|
| 1.8.0 |17,564 |
| 2.1.0 |6,036 |
| 2.2.1 |6,047 |
| 2.2.2 |3,082 |
| 2.3.1 |2,215 |
| 2.6.8 |0,622 |

Between 1.8.0 and 2.6.8 the Abe content load time was divided by **27**! The refactoring was on his way. Never ceased then...

To be continued...
18 changes: 18 additions & 0 deletions tests/loadtests/create.py
@@ -0,0 +1,18 @@
import random, string
from locust import HttpLocust, TaskSet

def create(l):
rand_str = lambda n: ''.join([random.choice(string.lowercase) for i in xrange(n)])
s = rand_str(10)
l.client.post("/abe/create/" + s, {
"selectTemplate": "index",
"name": s
})

class UserBehavior(TaskSet):
tasks = {create:1}

class WebsiteUser(HttpLocust):
task_set = UserBehavior
min_wait=5000
max_wait=9000
12 changes: 12 additions & 0 deletions tests/loadtests/manager.py
@@ -0,0 +1,12 @@
from locust import HttpLocust, TaskSet

def manager(l):
l.client.get("/abe/editor")

class UserBehavior(TaskSet):
tasks = {manager:1}

class WebsiteUser(HttpLocust):
task_set = UserBehavior
min_wait=5000
max_wait=9000

0 comments on commit aa1b432

Please sign in to comment.