Skip to content

Commit aa1b432

Browse files
author
nicolaslabbe
committed
Merged branch master into bug_json_variable
2 parents 3ae86e3 + f56d735 commit aa1b432

File tree

6 files changed

+243
-4
lines changed

6 files changed

+243
-4
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
11

2+
## [2.12.0] - 2016-12-19
3+
* [[`6eb371f11c`](https://github.com/AdFabConnect/abejs/commit/6eb371f11c)] - **ic**: adding Mac OSX (gregorybesson)
4+
* [[`542d6148d2`](https://github.com/AdFabConnect/abejs/commit/542d6148d2)] - **ic**: adding Mac OSX (gregorybesson)
5+
* [[`ab35c47fa6`](https://github.com/AdFabConnect/abejs/commit/ab35c47fa6)] - **ic**: adding Mac OSX (gregorybesson)
6+
* [[`139b50cc36`](https://github.com/AdFabConnect/abejs/commit/139b50cc36)] - **ic**: adding Mac OSX (gregorybesson)
7+
* [[`6ecec6a05d`](https://github.com/AdFabConnect/abejs/commit/6ecec6a05d)] - **ic**: adding Mac OSX (gregorybesson)
8+
* [[`b8e002f472`](https://github.com/AdFabConnect/abejs/commit/b8e002f472)] - **fix**: typo in require module (gregorybesson)
9+
* [[`48e0e6690e`](https://github.com/AdFabConnect/abejs/commit/48e0e6690e)] - **feature**: 150 handlebars helpers added to Abe (gregorybesson)
10+
* [[`4167c416bd`](https://github.com/AdFabConnect/abejs/commit/4167c416bd)] - **ic**: adding Mac OsX to the ic (gregorybesson)
11+
* [[`e2b0e54a0e`](https://github.com/AdFabConnect/abejs/commit/e2b0e54a0e)] - **ic**: lint (gregorybesson)
12+
* [[`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)
13+
* [[`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)
14+
* [[`e264029c98`](https://github.com/AdFabConnect/abejs/commit/e264029c98)] - Merge pull request #92 from AdFabConnect/bug_jsoninline (Greg Besson)
15+
* [[`b80883d7df`](https://github.com/AdFabConnect/abejs/commit/b80883d7df)] - **fix**: wrong return (nicolaslabbe)
16+
* [[`31781a6ab8`](https://github.com/AdFabConnect/abejs/commit/31781a6ab8)] - **fix**: bug json inline into abe data (nicolaslabbe)
17+
18+
## [2.11.6] - 2016-12-16
19+
* [[`d9a26ed671`](https://github.com/AdFabConnect/abejs/commit/d9a26ed671)] - Merge pull request #91 from AdFabConnect/bug_duplicate (Greg Besson)
20+
* [[`bcccc6a209`](https://github.com/AdFabConnect/abejs/commit/bcccc6a209)] - **fix**: on duplicate with same name (nicolaslabbe)
21+
* [[`2444bdaaba`](https://github.com/AdFabConnect/abejs/commit/2444bdaaba)] - **doc**: CHANGELOG (gregorybesson)
22+
223
## [2.11.5] - 2016-12-16
324
* [[`cb592582be`](https://github.com/AdFabConnect/abejs/commit/cb592582be)] - Merge branch 'master' of https://github.com/AdFabConnect/abejs (gregorybesson)
425
* [[`3b238c851c`](https://github.com/AdFabConnect/abejs/commit/3b238c851c)] - **fix**: Add options to iFrame (gregorybesson)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "abe-cli",
3-
"version": "2.11.6",
3+
"version": "2.12.0",
44
"description": "Abe command line tool",
55
"main": "src/server/app.js",
66
"repository": {

tests/functional/index.js

Lines changed: 122 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,136 @@ describe('Abe', function() {
3131
.setValue('div[data-precontrib-templates=single] > div > input', 'ftest')
3232
.click('button[type="submit"]')
3333
.waitForElementVisible('form[id="abeForm"]', 2000)
34-
.assert.urlEquals("http://localhost:3003/abe/editor/articles/ftest.html", "Clicked URL Matches with URL of the New Window")
35-
.end();
34+
.assert.urlEquals("http://localhost:3003/abe/editor/articles/ftest.html", "Clicked URL Matches with URL of the New Window");
3635
});
3736

3837
it('The created single article is found in the manager', function(client) {
3938
client
4039
.useXpath()
4140
.url('http://localhost:3003/abe/editor')
4241
.waitForElementVisible('//body')
42+
.pause(1000)
43+
.assert.containsText("//table[@id='navigation-list']/tbody/tr[1]/td[2]/a", "/articles/ftest.html");
44+
});
45+
46+
it('The created single article is edited and updated with no change', function(client) {
47+
client
48+
.useXpath()
49+
.url('http://localhost:3003/abe/editor/articles/ftest.html#slug')
50+
.waitForElementVisible('//body')
51+
.assert.title('Abe')
52+
.click("//button[@class='btn btn-primary'][2]")
53+
.pause(2000)
54+
.assert.urlEquals("http://localhost:3003/abe/editor/articles/ftest.html", "Clicked URL Matches with URL of the New Window");
55+
});
56+
57+
it('The updated single article is found in the manager', function(client) {
58+
client
59+
.useXpath()
60+
.url('http://localhost:3003/abe/editor')
61+
.waitForElementVisible('//body')
62+
.pause(1000)
63+
.assert.containsText("//table[@id='navigation-list']/tbody/tr[1]/td[2]/a", "/articles/ftest.html");
64+
});
65+
66+
it('The updated single article is edited once more with a new name', function(client) {
67+
client
68+
.useXpath()
69+
.url('http://localhost:3003/abe/editor/articles/ftest.html#slug')
70+
.waitForElementVisible('//body')
71+
.assert.title('Abe')
72+
.setValue("//div[@data-precontrib-templates='single']//input[@id='name']", 'updated')
73+
.click("//button[@class='btn btn-primary'][2]")
74+
.pause(2000)
75+
.assert.urlEquals("http://localhost:3003/abe/editor/articles/ftestupdated.html", "Clicked URL Matches with URL of the New Window");
76+
});
77+
78+
it('The updated single article is found in the manager', function(client) {
79+
client
80+
.useXpath()
81+
.url('http://localhost:3003/abe/editor')
82+
.waitForElementVisible('//body')
83+
.pause(1000)
84+
.assert.containsText("//table[@id='navigation-list']/tbody/tr[1]/td[2]/a", "/articles/ftestupdated.html");
85+
});
86+
87+
it('The updated single article is duplicated', function(client) {
88+
client
89+
.useXpath()
90+
.url('http://localhost:3003/abe/editor/articles/ftestupdated.html#slug')
91+
.waitForElementVisible('//body')
92+
.assert.title('Abe')
93+
.clearValue("//div[@data-precontrib-templates='single']//input[@id='name']")
94+
.setValue("//div[@data-precontrib-templates='single']//input[@id='name']", 'ftest')
95+
.click("//button[@class='btn btn-primary'][1]")
96+
.pause(2000)
97+
.assert.urlEquals("http://localhost:3003/abe/editor/articles/ftest.html", "Clicked URL Matches with URL of the New Window");
98+
});
99+
100+
it('The updated single article + duplicated are found in the manager', function(client) {
101+
client
102+
.useXpath()
103+
.url('http://localhost:3003/abe/editor')
104+
.waitForElementVisible('//body')
105+
.pause(1000)
43106
.assert.containsText("//table[@id='navigation-list']/tbody/tr[1]/td[2]/a", "/articles/ftest.html")
44-
.end();
107+
.assert.containsText("//table[@id='navigation-list']/tbody/tr[2]/td[2]/a", "/articles/ftestupdated.html");
108+
});
109+
110+
it('The updated article is deleted in the manager', function(client) {
111+
client
112+
.useXpath()
113+
.url('http://localhost:3003/abe/editor')
114+
.waitForElementVisible('//body')
115+
.pause(1000)
116+
.click("//table[@id='navigation-list']/tbody/tr[2]/td[7]/div/a[last()]")
117+
.pause(1000)
118+
.acceptAlert()
119+
.url('http://localhost:3003/abe/editor')
120+
.pause(2000)
121+
.expect.element("//table[@id='navigation-list']/tbody/tr[2]/td[2]/a").text.to.not.contain('/articles/ftestupdated.html');
122+
});
123+
124+
it('The updated single article is published', function(client) {
125+
client
126+
.useXpath()
127+
.url('http://localhost:3003/abe/editor/articles/ftest.html#slug')
128+
.waitForElementVisible('//body')
129+
.assert.title('Abe')
130+
.click("//div[@class='btns']/button[3]")
131+
.pause(2000)
132+
//.assert.containsText("//div[@class='display-status']/span", "publish")
133+
.url('http://localhost:3003/abe/editor')
134+
.waitForElementVisible('//body')
135+
.assert.cssClassPresent("//table[@id='navigation-list']/tbody/tr[1]/td[6]/a", "label-published");
136+
});
137+
138+
it('The updated article is unpublished in the manager', function(client) {
139+
client
140+
.useXpath()
141+
.url('http://localhost:3003/abe/editor')
142+
.waitForElementVisible('//body')
143+
.pause(1000)
144+
.click("//table[@id='navigation-list']/tbody/tr[1]/td[7]/div/a")
145+
.pause(1000)
146+
.acceptAlert()
147+
.url('http://localhost:3003/abe/editor')
148+
.pause(2000)
149+
.assert.cssClassPresent("//table[@id='navigation-list']/tbody/tr[1]/td[5]/a", "label-draft");
150+
});
151+
152+
it('The updated article is deleted in the manager', function(client) {
153+
client
154+
.useXpath()
155+
.url('http://localhost:3003/abe/editor')
156+
.waitForElementVisible('//body')
157+
.pause(1000)
158+
.click("//table[@id='navigation-list']/tbody/tr[1]/td[7]/div/a")
159+
.pause(1000)
160+
.acceptAlert()
161+
.url('http://localhost:3003/abe/editor')
162+
.pause(2000)
163+
.expect.element("//table[@id='navigation-list']/tbody/tr[1]/td[2]/a").text.to.not.contain('/articles/ftest.html');
45164
});
46165
});
47166
});

tests/loadtests/README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Load testing Abe
2+
3+
In order to loadtest [Abe](https://github.com/AdFabConnect/abejs) we choose to use [Locust](http://locust.io/).
4+
Why? Because it's simple and it's doing the job!
5+
6+
## Pre-req
7+
8+
Locust requires Python 2.6+. Python 3.x support is [coming](https://twitter.com/locustio/status/801736746727784448)
9+
10+
## Installation
11+
12+
See [locust.io installation](http://docs.locust.io/en/latest/installation.html)
13+
14+
# Start load testing Abe
15+
16+
We wrote 2 locust files called [manager.py](./manager.py) and [create.py](./create.py)
17+
For both scenarios below you have to setup the number of users you want and the number of users spawned per second.
18+
Start with 10 users and 1 user spawned/second to test and click `Start swarming`.
19+
20+
## Manager
21+
22+
We start with Abe's manager loadtest.
23+
24+
- Run `locust -f manager.py --host=http://your.abe.com` from root of your locust install.
25+
- Go to `http://localhost:8089` on your favorite browser.
26+
- You're all set \o/.
27+
28+
## Create
29+
30+
Then we continue with testing content creation time response.
31+
For this test you'll have to set a abe.json file with secure cookie to false
32+
33+
```javascript
34+
{
35+
"cookie": {
36+
"secure": false
37+
},
38+
"security" : false,
39+
}
40+
```
41+
42+
- Run `locust -f create.py --host=http://your.abe.com` from root of your locust install.
43+
- Go to `http://localhost:8089` on your favorite browser.
44+
45+
# Abe Benchmark
46+
47+
Below you find a benchmark (to be completed) of response time to display a content in Abe.
48+
49+
## Test characteristics
50+
51+
- 1.000 contents in Abe
52+
- locust parameters : 10 users | 1 user spawned/second
53+
- Duration : 5 mins
54+
- Each user call 1 content in abe
55+
56+
## Result
57+
58+
| Abe Version | Average Response Time (s)|
59+
|:-------------:|:------------------------:|
60+
| 1.8.0 |17,564 |
61+
| 2.1.0 |6,036 |
62+
| 2.2.1 |6,047 |
63+
| 2.2.2 |3,082 |
64+
| 2.3.1 |2,215 |
65+
| 2.6.8 |0,622 |
66+
67+
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...
68+
69+
To be continued...

tests/loadtests/create.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import random, string
2+
from locust import HttpLocust, TaskSet
3+
4+
def create(l):
5+
rand_str = lambda n: ''.join([random.choice(string.lowercase) for i in xrange(n)])
6+
s = rand_str(10)
7+
l.client.post("/abe/create/" + s, {
8+
"selectTemplate": "index",
9+
"name": s
10+
})
11+
12+
class UserBehavior(TaskSet):
13+
tasks = {create:1}
14+
15+
class WebsiteUser(HttpLocust):
16+
task_set = UserBehavior
17+
min_wait=5000
18+
max_wait=9000

tests/loadtests/manager.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from locust import HttpLocust, TaskSet
2+
3+
def manager(l):
4+
l.client.get("/abe/editor")
5+
6+
class UserBehavior(TaskSet):
7+
tasks = {manager:1}
8+
9+
class WebsiteUser(HttpLocust):
10+
task_set = UserBehavior
11+
min_wait=5000
12+
max_wait=9000

0 commit comments

Comments
 (0)