Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ecommerce-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
ecommerce-ui
Commits
8a93e12c
Commit
8a93e12c
authored
Mar 31, 2014
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: started updating to latest UI tests
parent
11267e37
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
734 deletions
+82
-734
data/test_page_module.json
data/test_page_module.json
+0
-97
test/index.html
test/index.html
+82
-637
No files found.
data/test_page_module.json
View file @
8a93e12c
...
...
@@ -37,107 +37,10 @@
},
"view_dict"
:
{
"default"
:
[{
"generate"
:
"widget"
,
"type"
:
"collapsibleset"
,
"property_dict"
:
{
"direction"
:
"horizontal"
,
"inset"
:
true
},
"children"
:
[{
"generate"
:
"widget"
,
"type"
:
"collapsible"
,
"property_dict"
:
{
"collapsed"
:
false
,
"text"
:
"View"
,
"text_i18n"
:
"page_dict.test_page_dict.text_dict.view"
},
"children"
:
[{
"generate"
:
"gadget"
,
"type"
:
"fieldlist"
,
"href"
:
"test_page_view"
}]
},{
"generate"
:
"widget"
,
"type"
:
"collapsible"
,
"property_dict"
:
{
"text"
:
"Edit"
,
"text_i18n"
:
"page_dict.test_page_dict.text_dict.edit"
},
"children"
:
[]
},{
"generate"
:
"widget"
,
"type"
:
"collapsible"
,
"property_dict"
:
{
"text"
:
"Test Report"
,
"text_i18n"
:
"page_dict.test_page_dict.text_dict.test_report"
},
"children"
:
[]
},{
"generate"
:
"widget"
,
"type"
:
"collapsible"
,
"property_dict"
:
{
"text"
:
"Edit Slideshow"
,
"text_i18n"
:
"page_dict.test_page_dict.text_dict.edit_slideshow"
},
"children"
:
[]
},
{
"generate"
:
"widget"
,
"type"
:
"collapsible"
,
"property_dict"
:
{
"text"
:
"Edit Test"
,
"text_i18n"
:
"page_dict.test_page_dict.text_dict.edit_test"
},
"children"
:
[]
},
{
"generate"
:
"widget"
,
"type"
:
"collapsible"
,
"property_dict"
:
{
"text"
:
"Related Documents"
,
"text_i18n"
:
"page_dict.test_page_dict.text_dict.related"
},
"children"
:
[]
},
{
"generate"
:
"widget"
,
"type"
:
"collapsible"
,
"property_dict"
:
{
"text"
:
"Contents"
,
"text_i18n"
:
"page_dict.test_page_dict.text_dict.contents"
},
"children"
:
[]
},
{
"generate"
:
"widget"
,
"type"
:
"collapsible"
,
"property_dict"
:
{
"text"
:
"Local Roles"
,
"text_i18n"
:
"page_dict.test_page_dict.text_dict.roles"
},
"children"
:
[]
},
{
"generate"
:
"widget"
,
"type"
:
"collapsible"
,
"property_dict"
:
{
"text"
:
"Consistency"
,
"text_i18n"
:
"page_dict.test_page_dict.text_dict.consistency"
},
"children"
:
[]
},
{
"generate"
:
"widget"
,
"type"
:
"collapsible"
,
"property_dict"
:
{
"text"
:
"History"
,
"text_i18n"
:
"page_dict.test_page_dict.text_dict.history"
},
"children"
:
[]
},
{
"generate"
:
"widget"
,
"type"
:
"collapsible"
,
"property_dict"
:
{
"text"
:
"Metadata"
,
"text_i18n"
:
"page_dict.test_page_dict.text_dict.metadata"
},
"children"
:
[]
}]
}]
}
}
]
...
...
test/index.html
View file @
8a93e12c
...
...
@@ -220,633 +220,18 @@
'
<td>//a[.="Login"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>verifyAttribute</td>
'
+
'
<td>//div[@id="global-popup-popup"]@class</td>
'
+
'
<td>ui-popup-active</td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[.="Facebook"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForElementPresent</td>
'
+
'
<td>//a[.="Menu"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>verifyAttribute</td>
'
+
'
<td>//div[@id="global-panel"]@class</td>
'
+
'
<td>ui-panel-open</td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[.="Menu"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForElementPresent</td>
'
+
'
<td>//a[.="My Account"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[.="My Account"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForElementPresent</td>
'
+
'
<td>//th[.="Email Address"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[@class="table_link"][0]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//input[@type="submit"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>10000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[@href="#networks"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[.="Bazbam"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[.="Delete"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>verifyText</td>
'
+
'
<td>//div[@class="info"]</td>
'
+
'
<td>1-3/3 Records</td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>openAndWait</td>
'
+
'
<td>${base_url}</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForPageToLoad</td>
'
+
'
<td><br></td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForElementPresent</td>
'
+
'
<td>//div[@id="global-panel"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[.="Menu"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//h1[.="Person"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForElementPresent</td>
'
+
'
<td>//input[@id="user_sample_password"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>type</td>
'
+
'
<td>id=user_sample_password</td>
'
+
'
<td>topsecret</td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>type</td>
'
+
'
<td>id=user_sample_default_fax_text</td>
'
+
'
<td>Foo</td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//input[@type="submit"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[.="Home"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>2000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[.="Menu"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//h1[.="Person"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForElementPresent</td>
'
+
'
<td>//input[@id="user_sample_password"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>verifyAttribute</td>
'
+
'
<td>//input[@id="user_sample_default_fax_text"]@value</td>
'
+
'
<td>Foo</td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>openAndWait</td>
'
+
'
<td>${base_url}</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForPageToLoad</td>
'
+
'
<td><br></td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForElementPresent</td>
'
+
'
<td>//div[@id="global-panel"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[.="Menu"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//h1[.="Invoices"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForElementPresent</td>
'
+
'
<td>//a[.="Download"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>openAndWait</td>
'
+
'
<td>${base_url}</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForPageToLoad</td>
'
+
'
<td><br></td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForElementPresent</td>
'
+
'
<td>//div[@id="global-panel"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[.="Menu"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//h1[.="Services"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForElementPresent</td>
'
+
'
<td>//a[.="Zabbix Agent"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[.="Zabbix Agent"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForElementPresent</td>
'
+
'
<td>//textarea[@id="service_instance_overview_xml_recipe"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>type</td>
'
+
'
<td>id=service_instance_overview_xml_recipe</td>
'
+
'
<td>Bar</td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//input[@type="submit"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[.="Destroy"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForElementPresent</td>
'
+
'
<td>//a[.="Install new service"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>verifyText</td>
'
+
'
<td>//div[@class="info"]</td>
'
+
'
<td>1-3/3 Records</td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>openAndWait</td>
'
+
'
<td>${base_url}</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForPageToLoad</td>
'
+
'
<td><br></td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForElementPresent</td>
'
+
'
<td>//div[@id="global-panel"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[.="Menu"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//h1[.="Services"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[.="Install new service"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>type</td>
'
+
'
<td>id=search_software_list</td>
'
+
'
<td>Zabbix</td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>link=[EXPERIMENTAL] Zabbix Agent</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>link=slapos-0.5</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>select</td>
'
+
'
<td>id=install_release_reference_computer</td>
'
+
'
<td>label=Cortana</td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//input[@value="Request"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[.="Menu"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//h1[.="Services"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>verifyText</td>
'
+
'
<td>//div[@class="info"]</td>
'
+
'
<td>1-5/5 Records</td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>openAndWait</td>
'
+
'
<td>${base_url}</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForPageToLoad</td>
'
+
'
<td><br></td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForElementPresent</td>
'
+
'
<td>//div[@id="global-panel"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[.="Menu"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//h1[.="Servers"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>10000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>type</td>
'
+
'
<td>id=search_server_list</td>
'
+
'
<td>Cortana</td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>2000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>link=Cortana</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForElementPresent</td>
'
+
'
<td>//a[.="Set Configuration"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[.="Set Configuration"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>2000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>type</td>
'
+
'
<td>id=computer_sample_reference</td>
'
+
'
<td>Foo-123</td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>type</td>
'
+
'
<td>id=computer_sample_translated_validation_state_title</td>
'
+
'
<td>Dead</td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//input[@type="submit"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>goBack</td>
'
+
'
<td></td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td>//div[@id="global-popup-popup"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>verifyAttribute</td>
'
+
'
<td>//input[@id="computer_status_reference"]@value</td>
'
+
'
<td>Foo-123</td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>link=servers</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>type</td>
'
+
'
<td>id=search_server_list</td>
'
+
'
<td>Cortana</td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>2000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>link=Dead</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[.="Delete"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>verifyText</td>
'
+
'
<td>//div[@class="info"]</td>
'
+
'
<td>1-8/73 Records</td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>openAndWait</td>
'
+
'
<td>${base_url}</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForPageToLoad</td>
'
+
'
<td><br></td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>waitForElementPresent</td>
'
+
'
<td>//div[@id="global-panel"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[.="Menu"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//h1[.="Servers"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>10000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[.="Add Server"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>type</td>
'
+
'
<td>id=computer_new_title</td>
'
+
'
<td>Quantum</td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>type</td>
'
+
'
<td>id=computer_new_description</td>
'
+
'
<td>Im the fastest</td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//input[@type="submit"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>click</td>
'
+
'
<td>//a[.="Delete"]</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>pause</td>
'
+
'
<td>5000</td>
'
+
'
<td></td>
'
+
'
</tr>
'
+
'
<tr>
'
+
'
<td>verifyText</td>
'
+
'
<td>//div[@class="info"]</td>
'
+
'
<td>1-8/74 Records</td>
'
+
'
<td>//div[@id="global-popup-popup"]@class</td>
'
+
'
<td>ui-popup-active</td>
'
+
'
</tr>
'
+
'
</tbody>
'
+
'
</table>
'
;
'
</tbody>
'
+
'
</table>
'
;
// normally:
// (1) load a testpage
...
...
@@ -869,19 +254,28 @@
getParam
=
function
(
str
)
{
return
str
.
split
(
"
@
"
).
pop
();
};
has_selector
=
function
(
str
)
{
return
str
.
split
(
"
[
"
);
};
// extract selector tag
tag
=
function
(
str
)
{
return
str
.
split
(
"
[
"
)[
0
].
replace
(
"
//
"
,
""
);
return
str
.
split
(
"
[
"
)[
0
].
replace
(
"
//
"
,
""
);
};
// extract selector identifier (class, id, :contains...)
selector
=
function
(
str
)
{
var
base
=
str
.
split
(
"
[
"
)[
1
].
split
(
"
=
"
)[
0
].
replace
(
"
@
"
,
""
);
switch
(
base
)
{
case
"
class
"
:
return
[
"
.
"
,
""
];
case
"
id
"
:
return
[
"
#
"
,
""
];
case
"
.
"
:
return
[
"
:contains('
"
,
"
')
"
];
if
(
has_selector
(
str
).
length
>
1
)
{
var
base
=
str
.
split
(
"
[
"
)[
1
].
split
(
"
=
"
)[
0
].
replace
(
"
@
"
,
""
);
var
mock
=
base
.
slice
(
0
,
5
)
===
"
data-
"
?
"
data-
"
:
base
;
switch
(
mock
)
{
case
"
class
"
:
return
[
"
.
"
,
""
];
case
"
id
"
:
return
[
"
#
"
,
""
];
case
"
.
"
:
return
[
"
:contains('
"
,
"
')
"
];
case
"
title
"
:
case
"
href
"
:
case
"
data-
"
:
return
[(
"
[
"
+
base
+
"
='
"
),
"
']
"
];
}
}
return
[
""
,
""
];
};
// which element
...
...
@@ -891,15 +285,18 @@
str
.
split
(
"
]
"
).
slice
(
-
2
).
shift
().
replace
(
"
[
"
,
""
)
+
"
)
"
;
}
return
""
return
""
;
};
// extract selector value
val
=
function
(
str
)
{
return
str
.
split
(
"
=
"
)[
1
]
.
replace
(
"
]
"
,
""
)
.
replace
(
'
"
'
,
''
,
"
g
"
)
.
replace
(
"
'
"
,
""
,
"
g
"
);
if
(
has_selector
(
str
).
length
>
1
)
{
return
str
.
split
(
"
=
"
)[
1
]
.
replace
(
"
]
"
,
""
)
.
replace
(
'
"
'
,
''
,
"
g
"
)
.
replace
(
"
'
"
,
""
,
"
g
"
);
}
return
""
;
};
// lets go
...
...
@@ -927,10 +324,24 @@
'
$.testHelper.countDown = function (arr, command) {
'
+
'
var condition, is_done;
'
+
'
var ticker = 0;
'
+
'
var el;
'
+
'
var i = w.setInterval(function() {
'
+
'
switch (command) {
'
+
'
case "verifyAttribute":
'
+
'
condition = $i.find(arr[0]).eq(0).attr(arr[1]).indexOf(arr[2]) > -1;
'
+
'
el = $.find(arr[0]);
'
+
'
if (el.length > 0) {
'
+
'
console.log("OI");console.log(arr);condition = $i.find(arr[0]).eq(0).attr(arr[1]).indexOf(arr[2]) > -1;
'
+
'
} else {
'
+
'
condition = false;
'
+
'
}
'
+
'
break;
'
+
'
case "verifyText":
'
+
'
el = $.find(arr[0]);
'
+
'
if (el.length > 0) {
'
+
'
condition = $.find(arr[0]).eq(0).text(arr[2]).length > 0;
'
+
'
} else {
'
+
'
condition = false;
'
+
'
}
'
+
'
break;
'
+
'
case "waitForElementPresent":
'
+
'
condition = $i.find(arr[0]).length > 0;
'
+
...
...
@@ -952,12 +363,18 @@
len
=
tableToParse
.
length
;
// loop table rows
for
(
i
=
0
;
i
<
17
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
instruction
=
tableToParse
[
i
];
// parse instructions
switch
(
instruction
.
command
)
{
case
"
openAndWait
"
:
if
(
close_async
)
{
madeJS
+=
'
} ]) });
'
;
madeJS
=
madeJS
.
replace
(
/__number__/g
,
count
.
toString
());
close_asyn
=
undefined
;
count
=
undefined
;
}
// start a new block
close_async
=
true
;
count
=
0
;
...
...
@@ -972,6 +389,22 @@
'
}, function () {
'
;
break
;
case
"
select
"
:
ins
=
instruction
.
selector
;
wrap
=
selector
(
ins
);
find
=
tag
(
ins
)
+
wrap
[
0
]
+
val
(
ins
)
+
nth
(
ins
)
+
wrap
[
1
];
test_value
=
instruction
.
value
;
madeJS
+=
'
$i.find("
'
+
find
+
'
option[
'
+
test_value
+
'
]").attr("selected", "selected");
'
;
break
;
case
"
type
"
:
ins
=
instruction
.
selector
;
wrap
=
selector
(
ins
);
find
=
tag
(
ins
)
+
wrap
[
0
]
+
val
(
ins
)
+
nth
(
ins
)
+
wrap
[
1
];
test_value
=
instruction
.
value
;
madeJS
+=
'
$i.find("
'
+
find
+
'
").text("
'
+
test_value
+
'
");
'
;
break
;
case
"
click
"
:
ins
=
instruction
.
selector
;
wrap
=
selector
(
ins
);
...
...
@@ -979,6 +412,20 @@
madeJS
+=
'
$i.find("
'
+
find
+
'
").trigger("click");
'
;
break
;
case
"
verifyText
"
:
ins
=
instruction
.
selector
;
wrap
=
selector
(
ins
);
count
+=
1
;
find
=
(
tag
(
ins
)
+
wrap
[
0
]
+
val
(
ins
)
+
nth
(
ins
)
+
wrap
[
1
]).
split
(
"
@
"
)[
0
];
test_attr
=
"
text
"
;
test_value
=
instruction
.
value
;
madeJS
+=
'
$.testHelper.countDown(
'
+
'
["
'
+
find
+
'
", "
'
+
test_attr
+
'
", "
'
+
test_value
+
'
"],
'
+
'
"verifyText"
'
+
'
);}, function () {
'
;
break
;
case
"
verifyAttribute
"
:
ins
=
instruction
.
selector
;
wrap
=
selector
(
ins
);
...
...
@@ -986,7 +433,6 @@
find
=
(
tag
(
ins
)
+
wrap
[
0
]
+
val
(
ins
)
+
nth
(
ins
)
+
wrap
[
1
]).
split
(
"
@
"
)[
0
];
test_attr
=
getParam
(
ins
);
test_value
=
instruction
.
value
;
madeJS
+=
'
$.testHelper.countDown(
'
+
'
["
'
+
find
+
'
", "
'
+
test_attr
+
'
", "
'
+
test_value
+
'
"],
'
+
'
"verifyAttribute"
'
+
...
...
@@ -996,7 +442,7 @@
case
"
waitForElementPresent
"
:
ins
=
instruction
.
selector
;
wrap
=
selector
(
ins
);
find
=
tag
(
ins
)
+
wrap
[
0
]
+
val
(
ins
)
+
nth
(
ins
)
+
wrap
[
1
];
find
=
tag
(
ins
)
+
wrap
[
0
]
+
val
(
ins
)
.
split
(
"
/
"
)[
0
]
+
nth
(
ins
)
+
wrap
[
1
];
count
+=
1
;
madeJS
+=
'
$.testHelper.countDown(
'
+
'
["
'
+
find
+
'
", undefined, undefined],
'
+
...
...
@@ -1007,7 +453,6 @@
}
if
(
close_async
)
{
console
.
log
(
"
CLOSED
"
)
madeJS
+=
'
} ]) });
'
;
madeJS
=
madeJS
.
replace
(
/__number__/g
,
count
.
toString
());
close_asyn
=
undefined
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment