Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ic: add func test for autocomplete and abe data
- Loading branch information
nicolaslabbe
committed
Dec 20, 2016
1 parent
aa1b432
commit 9ee44ec
Showing
7 changed files
with
203 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"address_components": [ | ||
{ | ||
"long_name": "State of Pará", | ||
"short_name": "PA", | ||
"types": [ | ||
"administrative_area_level_1", | ||
"political" | ||
] | ||
}, | ||
{ | ||
"long_name": "Brazil", | ||
"short_name": "BR", | ||
"types": [ | ||
"country", | ||
"political" | ||
] | ||
} | ||
], | ||
"formatted_address": "State of Pará, Brazil", | ||
"geometry": { | ||
"bounds": { | ||
"northeast": { | ||
"lat": 2.5910246, | ||
"lng": -46.0643195 | ||
}, | ||
"southwest": { | ||
"lat": -9.8411565, | ||
"lng": -58.89827700000001 | ||
} | ||
}, | ||
"location": { | ||
"lat": -1.9981271, | ||
"lng": -54.9306152 | ||
}, | ||
"location_type": "APPROXIMATE", | ||
"viewport": { | ||
"northeast": { | ||
"lat": 2.5910246, | ||
"lng": -46.0643195 | ||
}, | ||
"southwest": { | ||
"lat": -9.8411565, | ||
"lng": -58.89827700000001 | ||
} | ||
} | ||
}, | ||
"place_id": "ChIJlwksrJn5iJIRCvNV5z7IXjE", | ||
"types": [ | ||
"administrative_area_level_1", | ||
"political" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[ | ||
{ | ||
"id": 1, | ||
"name": "test 1", | ||
"lang": "de" | ||
}, | ||
{ | ||
"id": 2, | ||
"name": "test 2", | ||
"lang": "fr" | ||
}, | ||
{ | ||
"id": 3, | ||
"name": "test 3", | ||
"lang": "es" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[ | ||
{ | ||
"name": "r1", | ||
"recipe": "Recipe 1", | ||
"products": [ | ||
{ | ||
"title": "product 1", | ||
"cover_300x200": "/image/turkey_300x200.jpg", | ||
}, | ||
{ | ||
"title": "product 2", | ||
"cover_300x200": "/image/chicken_300x200.jpg", | ||
}, | ||
{ | ||
"title": "product 3", | ||
"cover_300x200": "/image/chicken_300x200.jpg", | ||
}, | ||
{ | ||
"title": "product 4", | ||
"cover_300x200": "/image/chicken_300x200.jpg", | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{{abe type='data' key='colors.single' desc='Color single' source='["rouge", "vert", "bleu"]' max-length="1" tab="colors" reload="true"}} | ||
{{abe type='data' key='colors.multiple' desc='Color multiple' source='["rouge", "vert", "bleu"]' tab="colors" reload="true"}} | ||
{{abe type='data' key='colors.colors_autocomplete' desc='Color autocomplete (enter "rouge")' source='["rouge", "vert", "bleu"]' autocomplete="true" tab="colors" reload="true"}} | ||
|
||
{{abe type='data' key='reference.single' source="reference/data.json" max-length="1" display="{{name}}" desc='data ref single' tab="reference" reload="true"}} | ||
{{abe type='data' key='reference.multiple' source="reference/data.json" display="{{name}}" desc='data ref multiple' tab="reference" reload="true"}} | ||
{{abe type='data' key='reference.autocomplete' source="reference/data.json" display="{{name}}" autocomplete="true" desc='Data ref autocomplete (enter "test")' tab="reference" reload="true"}} | ||
|
||
<!DOCTYPE HTML> | ||
<!-- | ||
Twenty by HTML5 UP | ||
html5up.net | @ajlkn | ||
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) | ||
--> | ||
<html> | ||
<head> | ||
<style> | ||
code { background: hsl(220, 80%, 90%); } | ||
pre { white-space: pre-wrap; background: hsl(30,80%,90%); word-break: break-all;} | ||
</style> | ||
</head> | ||
<body class="index"> | ||
<div> | ||
<b>colors:</b> | ||
<pre><code>{{printJson colors}}</code></pre> | ||
</div> | ||
<hr> | ||
<div> | ||
<b>reference:</b> | ||
<pre><code>{{printJson reference}}</code></pre> | ||
</div> | ||
<hr> | ||
|
||
{{abe type='text' key='title1' desc='title' tab='default'}} | ||
<img src="{{abe type='image' key='image1' desc='image' tab='default'}}" alt=""> | ||
|
||
{{abe type='text' key='level1.title' desc='level 1 title' tab='default'}} | ||
<img src="{{abe type='image' key='level1.image' desc='level 1 image' tab='default'}}" alt=""> | ||
|
||
{{abe type='text' key='level2.sublevel2.title' desc='level 2 title' tab='default'}} | ||
|
||
{{#each eachlevel}} | ||
{{abe type='text' key='eachlevel.title' desc='title' tab='default'}} | ||
<img src="{{abe type='image' key='eachlevel.image' desc='image' tab='default'}}" alt=""> | ||
{{abe type='text' key='eachlevel.level.value' desc='value' tab='default'}} | ||
{{/each}} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
describe('Abe', function() { | ||
|
||
describe('data', function() { | ||
|
||
before(function(client, done) { | ||
done(); | ||
}); | ||
|
||
after(function(client, done) { | ||
client.end(function() { | ||
done(); | ||
}); | ||
}); | ||
|
||
afterEach(function(client, done) { | ||
done(); | ||
}); | ||
|
||
beforeEach(function(client, done) { | ||
done(); | ||
}); | ||
|
||
it('Create a autocomplete template post', function(client) { | ||
client | ||
.url('http://localhost:3003/abe/editor') | ||
.click('select[name="selectTemplate"] option[value="autocomplete"]') | ||
.waitForElementVisible('div[data-precontrib-templates="autocomplete"] input[id="name"]', 1000) | ||
.setValue('div[data-precontrib-templates="autocomplete"] input[id="name"]', 'autocomplete') | ||
.click('button[type="submit"]') | ||
.waitForElementVisible('form[id="abeForm"]', 2000) | ||
.assert.urlEquals("http://localhost:3003/abe/editor/autocomplete.html", "Clicked URL Matches with URL of the New Window"); | ||
}); | ||
|
||
|
||
it('Abe type data reference json', function(client) { | ||
client | ||
.useXpath() | ||
.url('http://localhost:3003/abe/editor/autocomplete.html') | ||
.waitForElementVisible('//body') | ||
.pause(1000) | ||
.click('//*[@id="abeForm"]/ul/li[2]/a') | ||
.waitForElementVisible('//*[@id="reference"]/div') | ||
.click('//*[@id="reference.single"]/option[2]') | ||
.click('//*[@id="reference.multiple"]/option[3]') | ||
.setValue('//*[@id="reference.autocomplete"]', 'test') | ||
.waitForElementVisible('//*[@id="reference"]/div/div/div/div[3]/div[2]', 2000) | ||
.click('//*[@id="reference"]/div/div/div/div[3]/div[2]/div[1]') | ||
.waitForElementVisible('//*[@id="reference"]/div/div/div/div[3]/div/div', 2000); | ||
}); | ||
}); | ||
}); |