Revision: 22bc4149a06a
Author: Janne Härkönen <[email protected]>
Date: Fri Jun 17 00:40:10 2011
Log: Added testdata for creating data.js
http://code.google.com/p/robotframework/source/detail?r=22bc4149a06a
Added:
/src/robot/webcontent/testdata/dir.suite/__init__.txt
/src/robot/webcontent/testdata/dir.suite/test.suite.1.txt
/src/robot/webcontent/testdata/dir.suite/test.suite.2.txt
/src/robot/webcontent/testdata/dir.suite/tests.txt
Modified:
/src/robot/webcontent/testdata/create_jsdata.py
/src/robot/webcontent/testdata/data.js
=======================================
--- /dev/null
+++ /src/robot/webcontent/testdata/dir.suite/__init__.txt Fri Jun 17
00:40:10 2011
@@ -0,0 +1,3 @@
+*** Settings ***
+Suite Setup Log higher level suite setup
+Force Tags i1 i2
=======================================
--- /dev/null
+++ /src/robot/webcontent/testdata/dir.suite/test.suite.1.txt Fri Jun 17
00:40:10 2011
@@ -0,0 +1,8 @@
+*** settings ***
+Library Collections
+
+*** test cases ***
+list test
+ ${list}= Create List foo bar quux
+ Log ${list}
+ [Tags] collections
=======================================
--- /dev/null
+++ /src/robot/webcontent/testdata/dir.suite/test.suite.2.txt Fri Jun 17
00:40:10 2011
@@ -0,0 +1,8 @@
+*** settings ***
+Library Collections
+
+*** test cases ***
+Dictionary test
+ ${dict}= Create Dictionary key value
+ Log ${dict}
+ [Tags] collections
=======================================
--- /dev/null
+++ /src/robot/webcontent/testdata/dir.suite/tests.txt Fri Jun 17 00:40:10
2011
@@ -0,0 +1,36 @@
+*** Settings ***
+Documentation Some suite docs with links: http://robotframework.org
+Suite Setup Log Suite setup
+Suite Teardown Fail
+Test Setup Log Test Setup
+Test Teardown Log Test Teardown
+Metadata home *page* http://robotframework.org
+Force Tags force test
+Default Tags default
+Library pölky/myLib.py
+
+
+*** Variables ***
+@{list} 1 2 3 4
+
+*** Test cases ***
+Simple
+ Log do nothing
+
+Unicode
+ Log hyvää joulua
+
+Complex
+ [Setup] Log in own setup
+ [Teardown] Log in own teardown
+ [Documentation] Test doc
+ [Tags] t1 owner-kekkonen
+ Log in test
+ User Kw
+ ::FOR ${i} IN @{list}
+ \ Log Got ${i}
+
+
+*** Keywords **
+User Kw
+ Log in User Kw
=======================================
--- /src/robot/webcontent/testdata/create_jsdata.py Thu Jun 16 23:54:55 2011
+++ /src/robot/webcontent/testdata/create_jsdata.py Fri Jun 17 00:40:10 2011
@@ -1,12 +1,21 @@
import os
+import robot
from robot.result.jsparser import create_datamodel_from
+BASEDIR = os.path.dirname(__file__)
+TESTDATA = os.path.join(BASEDIR, 'dir.suite')
+OUTPUT = os.path.join(BASEDIR, 'output.xml')
+TARGET = os.path.join(BASEDIR, 'data.js')
+
if __name__ == '__main__':
- base = os.path.dirname(__file__)
- model = create_datamodel_from(os.path.join(base, 'output.xml'))
+ robot.run(TESTDATA, tagstatlink=['force:http://google.com:kuukkeli'],
+ tagdoc=['test:this_is_my_test'],
tagstatcombine=['fooANDi*:zap'],
+ critical=['i?'], noncritical=['*kekkone*'],
outputdir=BASEDIR,
+ log='NONE', report='NONE')
+ model = create_datamodel_from(OUTPUT)
model.set_settings({'logURL': 'log.html',
'reportURL': 'report.html',
'background': {'fail': 'DeepPink'}})
- with open(os.path.join(base, 'data.js'), 'w') as output:
+ with open(TARGET, 'w') as output:
model.write_to(output)
=======================================
--- /src/robot/webcontent/testdata/data.js Thu Jun 16 23:54:55 2011
+++ /src/robot/webcontent/testdata/data.js Fri Jun 17 00:40:10 2011
@@ -1,2 +1,2 @@
-window.output =
{"errors":[[-58,"E",57],[-57,"E",58]],"stats":[[{"fail":2,"label":"Critical
Tests","pass":2},{"fail":3,"label":"All
Tests","pass":2}],[{"info":"critical","links":"","doc":"","label":"i1","combined":"","pass":2,"fail":3},{"info":"critical","links":"","doc":"","label":"i2","combined":"","pass":2,"fail":3},{"info":"non-critical","links":"","doc":"","label":"owner-kekkonen","combined":"","pass":0,"fail":1},{"info":"combined","links":"","doc":"","label":"zap","combined":"foo
&
i*","pass":2,"fail":0},{"info":"","links":"","doc":"","label":"default","combined":"","pass":0,"fail":2},{"info":"","links":"","doc":"","label":"foo","combined":"","pass":2,"fail":0},{"info":"","links":"kuukkeli:http://google.com","doc":"","label":"force","combined":"","pass":0,"fail":3},{"info":"","links":"","doc":"","label":"t1","combined":"","pass":0,"fail":1},{"info":"","links":"","doc":"this
is my
test","label":"test","combined":"","pass":0,"fail":3}],[{"fail":3,"label":"Quux.Bar","name":"Quux.Bar","pass":2},{"fail":0,"label":"Quux.Bar.Foo.Bar.1","name":"Foo.Bar.1","pass":1},{"fail":0,"label":"Quux.Bar.Foo.Bar","name":"Foo.Bar","pass":1},{"fail":3,"label":"Quux.Bar.Tests","name":"Tests","pass":0}]],"generatedMillis":180772,"generator":"Robot
trunk 20110613 (Python 2.6.6 on linux2)","generatedTimestamp":"20110617
09:46:42 GMT
+03:00","baseMillis":1308293021228,"suite":["suite","/home/jth/work/robotframework/tmp/quux.bar","Quux.Bar",0,{},["setup",1,0,2,3,[0,"I",3],["P",-1,1]],["suite","/home/jth/work/robotframework/tmp/quux.bar/foo.bar.1.txt","Foo.Bar.1",0,{},["test",4,0,"Y",0,["kw",5,0,6,7,[18,"I",8],["P",17,1]],["kw",9,0,6,10,[21,"I",11],["P",19,1]],["kw",12,0,13,14,[23,"I",15],["P",21,2]],["kw",16,0,17,18,["P",24,1]],["kw",16,0,17,19,["P",25,2]],["kw",1,0,2,20,[28,"I",21],["P",27,1]],[22,23,24],["P",16,13]],["P",1,29],[1,1,1,1]],["suite","/home/jth/work/robotframework/tmp/quux.bar/foo.bar.txt","Foo.Bar",0,{},["test",4,0,"Y",0,["kw",5,0,6,7,[39,"I",8],["P",37,2]],["kw",9,0,6,10,[42,"I",11],["P",40,1]],["kw",12,0,13,14,[44,"I",15],["P",43,1]],["kw",16,0,17,18,["P",45,1]],["kw",16,0,17,19,["P",47,1]],["kw",1,0,2,20,[49,"I",21],["P",48,2]],[22,23,24],["P",36,14]],["P",31,21],[1,1,1,1]],["suite","/home/jth/work/robotframework/tmp/quux.bar/tests.txt","Tests",25,{"home
*page*":26},["setup",1,0,2,27,[57,"I",27],["P",57,1]],["test",28,0,"Y",0,["setup",1,0,2,29,[60,"I",29],["P",60,1]],["kw",1,0,2,30,[62,"I",30],["P",61,2]],["teardown",1,0,2,31,[64,"I",31],["P",63,1]],[32,33,23,24,4],["P",58,7]],["test",34,0,"Y",0,["setup",1,0,2,29,[69,"I",29],["P",68,2]],["kw",1,0,2,30,[72,"I",30],["P",71,1]],["teardown",1,0,2,31,[74,"I",31],["P",73,1]],[32,33,23,24,4],["P",66,9]],["test",35,0,"N",36,["setup",1,0,2,29,[79,"I",29],["P",78,1]],["kw",1,0,2,37,[80,"I",37],["P",80,1]],["kw",38,0,0,0,["kw",1,0,2,39,[83,"I",39],["P",83,1]],["P",81,3]],["for",40,0,0,0,["foritem",41,0,0,0,["kw",1,0,2,42,[87,"I",43],["P",86,1]],["P",85,3]],["foritem",44,0,0,0,["kw",1,0,2,42,[90,"I",45],["P",89,1]],["P",88,2]],["foritem",46,0,0,0,["kw",1,0,2,42,[92,"I",47],["P",92,1]],["P",91,2]],["foritem",48,0,0,0,["kw",1,0,2,42,[95,"I",49],["P",94,1]],["P",94,2]],["P",85,11]],["teardown",1,0,2,31,[98,"I",31],["P",97,1]],[33,23,24,50,51,4],["P",76,23]],["teardown",52,0,53,0,[103,"F",54],[103,"D",55],["F",100,3]],["F",53,51,56],[3,0,2,0]],["F",-50,156],[5,2,4,2]],"strings":["*","*BuiltIn.Log","*Logs
the given message with the given level.","*higher level suite
setup","*test","*${l1} = BuiltIn.Create List","*Returns a list containing
given items.","*1, 2, 3","*${l1} = [u'1', u'2', u'3']","*${l2} =
BuiltIn.Create List","*foo, bar, ${l1}","*${l2} = [u'foo', u'bar', [u'1',
u'2', u'3']]","*${sub} = Collections.Get From List","*Returns the value
specified with an `index` from `list`.","*${l2}, 2","*${sub} = [u'1', u'2',
u'3']","*Collections.Set List Value","*Sets the value of `list` specified
by `index` to the given `value`.","*${sub}, 2, 400","*${l2}, 2,
${sub}","*${l2}","*[u'foo', u'bar', [u'1', u'2',
u'400']]","*foo","*i1","*i2","*Some suite docs with links:
http://robotframework.org","*http://robotframework.org","*Suite
setup","*Simple","*Test Setup","*do nothgin","*Test
Teardown","*default","*force","*Simple 2","*Complex","*Test doc","*in
test","*User Kw","*in User Kw","*${i} IN [ @{list} ]","*${i} = 1","*Got
${i}","*Got 1","*${i} = 2","*Got 2","*${i} = 3","*Got 3","*${i} = 4","*Got
4","*owner-kekkonen","*t1","*BuiltIn.Fail","*Fails the test immediately
with the given (optional)
message.","*AssertionError","eNpljDEKwkAQRXtP8UmVQHCFdHYKCvZeYLJMzJjZXZlZEW9v0NLq896DfzWKPFJc0KbiFcaRc0UkVSh57fYb4CzKaMJcEod7ncOr2BKsjKVORom/6BZ/KqiMRibs4fgUrZe8fbybHiqZMeyGHpIxkeh6DBiJMw7ubFVKPpkVa5PfOsiEdcH637sPrms/WA==","*Suite
teardown
failed:\nAssertionError","eNplTTsWAiEMvEo6KqG3tdrGygsEzbooECRB8fay67Oymjf/KT8xhgvIOyt2CBnmEAmMWziRu+niXlzvrrJnnSsm2qim4h6tdeuxOiVRsdrVrHVFv/ZPQ4QzConZw/R3oj8bzIFTidRH7Mh5Rz2IhnwFId3wuzRYK8Z+ALpSPtA=","eNplTbsWgjAM/ZVsnWx2VycWJ34gSJBq22AToP69gMfJ6Z77bvJCMfSg72xUIWQYQmRwOEpifNiIq5QnFunEhkKJD2ppwtc8V99RQWM19VbN7XWjbu+3mwg3UlZ3hubvxH42uIukKXLdYlfJJ65BLeQ7KNuB36WWqfSyZuc/ePg/4w=="]};
+window.output =
{"errors":[[36,"E",56]],"stats":[[{"fail":2,"label":"Critical
Tests","pass":2},{"fail":3,"label":"All
Tests","pass":2}],[{"info":"critical","links":"","doc":"","label":"i1","combined":"","pass":2,"fail":3},{"info":"critical","links":"","doc":"","label":"i2","combined":"","pass":2,"fail":3},{"info":"non-critical","links":"","doc":"","label":"owner-kekkonen","combined":"","pass":0,"fail":1},{"info":"combined","links":"","doc":"","label":"zap","combined":"foo
&
i*","pass":0,"fail":0},{"info":"","links":"","doc":"","label":"collections","combined":"","pass":2,"fail":0},{"info":"","links":"","doc":"","label":"default","combined":"","pass":0,"fail":2},{"info":"","links":"kuukkeli:http://google.com","doc":"","label":"force","combined":"","pass":0,"fail":3},{"info":"","links":"","doc":"","label":"t1","combined":"","pass":0,"fail":1},{"info":"","links":"","doc":"this
is my
test","label":"test","combined":"","pass":0,"fail":3}],[{"fail":3,"label":"Dir.Suite","name":"Dir.Suite","pass":2},{"fail":0,"label":"Dir.Suite.Test.Suite.1","name":"Test.Suite.1","pass":1},{"fail":0,"label":"Dir.Suite.Test.Suite.2","name":"Test.Suite.2","pass":1},{"fail":3,"label":"Dir.Suite.Tests","name":"Tests","pass":0}]],"generatedMillis":-526,"generator":"Robot
trunk 20110613 (Python 2.6.6 on linux2)","generatedTimestamp":"20110617
10:33:35 GMT
+03:00","baseMillis":1308296015526,"suite":["suite","/home/jth/work/robotframework/src/robot/webcontent/testdata/dir.suite","Dir.Suite",0,{},["setup",1,0,2,3,[0,"I",3],["P",-9,9]],["suite","/home/jth/work/robotframework/src/robot/webcontent/testdata/dir.suite/test.suite.1.txt","Test.Suite.1",0,{},["test",4,0,"Y",0,["kw",5,0,6,7,[18,"I",8],["P",16,1]],["kw",1,0,2,9,[19,"I",10],["P",18,1]],[11,12,13],["P",15,5]],["P",1,20],[1,1,1,1]],["suite","/home/jth/work/robotframework/src/robot/webcontent/testdata/dir.suite/test.suite.2.txt","Test.Suite.2",0,{},["test",14,0,"Y",0,["kw",15,0,16,17,[28,"I",18],["P",27,1]],["kw",1,0,2,19,[29,"I",20],["P",28,2]],[11,12,13],["P",26,4]],["P",22,9],[1,1,1,1]],["suite","/home/jth/work/robotframework/src/robot/webcontent/testdata/dir.suite/tests.txt","Tests",21,{"home
*page*":22},["setup",1,0,2,23,[38,"I",23],["P",37,1]],["test",24,0,"Y",0,["setup",1,0,2,25,[41,"I",25],["P",40,1]],["kw",1,0,2,26,[42,"I",26],["P",42,1]],["teardown",1,0,2,27,[44,"I",27],["P",43,1]],[28,29,12,13,30],["P",39,6]],["test",31,0,"Y",0,["setup",1,0,2,25,[47,"I",25],["P",47,1]],["kw",1,0,2,32,[49,"I",32],["P",48,1]],["teardown",1,0,2,27,[51,"I",27],["P",50,1]],[28,29,12,13,30],["P",46,5]],["test",33,0,"N",34,["setup",1,0,2,35,[54,"I",35],["P",54,1]],["kw",1,0,2,36,[56,"I",36],["P",55,1]],["kw",37,0,0,0,["kw",1,0,2,38,[59,"I",38],["P",58,1]],["P",57,2]],["for",39,0,0,0,["foritem",40,0,0,0,["kw",1,0,2,41,[62,"I",42],["P",61,1]],["P",60,2]],["foritem",43,0,0,0,["kw",1,0,2,41,[64,"I",44],["P",63,1]],["P",63,2]],["foritem",45,0,0,0,["kw",1,0,2,41,[66,"I",46],["P",66,1]],["P",65,2]],["foritem",47,0,0,0,["kw",1,0,2,41,[69,"I",48],["P",68,1]],["P",67,3]],["P",60,10]],["teardown",1,0,2,49,[71,"I",49],["P",71,1]],[29,12,13,50,51,30],["P",52,20]],["teardown",52,0,53,0,[76,"F",54],["F",73,3]],["F",32,45,55],[3,0,2,0]],["F",-58,136],[5,2,4,2]],"strings":["*","*BuiltIn.Log","*Logs
the given message with the given level.","*higher level suite setup","*list
test","*${list} = BuiltIn.Create List","*Returns a list containing given
items.","*foo, bar, quux","*${list} = [u'foo', u'bar',
u'quux']","*${list}","*[u'foo', u'bar',
u'quux']","*collections","*i1","*i2","*Dictionary test","*${dict} =
Collections.Create Dictionary","*Creates and returns a dictionary from the
given `key_value_pairs`.","*key, value","*${dict} = {u'key':
u'value'}","*${dict}","*{u'key': u'value'}","*Some suite docs with links:
http://robotframework.org","*http://robotframework.org","*Suite
setup","*Simple","*Test Setup","*do nothing","*Test
Teardown","*default","*force","*test","*Unicode","*hyv\u00e4\u00e4
joulua","*Complex","*Test doc","*in own setup","*in test","*User Kw","*in
User Kw","*${i} IN [ @{list} ]","*${i} = 1","*Got ${i}","*Got 1","*${i} =
2","*Got 2","*${i} = 3","*Got 3","*${i} = 4","*Got 4","*in own
teardown","*owner-kekkonen","*t1","*BuiltIn.Fail","*Fails the test
immediately with the given (optional) message.","*AssertionError","*Suite
teardown
failed:\nAssertionError","eNoljMERgjAQRVvZW27s3Q6c8aYNJGSRlZAw2a+QxmzAxhQ8vvdm3jm/fNJI1jL8Rppp0CTkeCyz8AMjr6VOXEsoGKqf5UCr/V/xKqEvGZLBEEP08By1dvZUyKGswwa3n+HDvr4KoPlu7kS3X6ekofrayC2fd5oaz+2ioVuao1jEKBeQbGrovsPRQBc="]};
window.settings =
{"reportURL":"report.html","background":{"fail":"DeepPink"},"logURL":"log.html"};