postcat/e2e/api.t

57 lines
1.1 KiB
Perl
Raw Normal View History

2022-08-26 20:57:46 +08:00
=== API
2022-08-28 20:08:22 +08:00
--- API test
2022-08-26 20:57:46 +08:00
2022-09-13 15:54:41 +08:00
goto 'http://localhost:4200'
2022-08-26 20:57:46 +08:00
find:
2022-08-28 20:08:22 +08:00
[select 'POST'] = method [input] = input [button 'Send'] = sendBtn
2022-08-27 16:53:02 +08:00
[label 'Headers'] = header
2022-08-26 20:57:46 +08:00
2022-08-28 20:08:22 +08:00
method -> 'GET'
2022-08-26 20:57:46 +08:00
input -> 'https://weibo.com/ajax/side/cards/sideInterested?count=60'
sendBtn -> click
2022-08-28 20:08:22 +08:00
wait 5000
find:
[label 'Response']=res
res -> click
# TODO 查看测试历史
capture
--- add New
2022-09-13 15:54:41 +08:00
goto 'http://localhost:4200'
2022-08-28 20:08:22 +08:00
find:
2022-08-30 09:44:51 +08:00
[input 'Search'] [button 'xpath:body > eo-root > eo-pages > div > div > div > eo-api > nz-layout > nz-sider > div > nz-content > nz-tabset > div > div > div.ant-tabs-tabpane.ant-tabs-tabpane-active.ng-star-inserted > div > eo-api-group-tree > header > div']=addBtn
2022-08-28 20:08:22 +08:00
addBtn -> hover
2022-08-28 22:05:21 +08:00
find:
[label 'New API']=newApi
[label 'New Group']
newApi -> click
find:
[button 'Save']=save
[select 'POST']=method [input '/']=path
2022-08-30 14:28:28 +08:00
[select 'Root directory'] [input]=name
# [input]=paramName [input]=desc [input]=example
2022-08-28 22:05:21 +08:00
method -> 'GET'
# TODO path => '/api/data'
path -> 'api/data'
name -> 'yoo'
2022-08-30 14:28:28 +08:00
# paramName -> 'a'
# desc -> 'adesc'
# example -> 'a Example'
# save -> click
2022-08-28 22:05:21 +08:00
capture