From 569d1b247bb4560fb172c9b8462034e9b854892b Mon Sep 17 00:00:00 2001 From: xiaoweiguoyuan <1019713654@qq.com> Date: Fri, 5 May 2023 16:49:56 +0800 Subject: [PATCH] =?UTF-8?q?find.byType=20=E9=87=8C=E9=9D=A2=E6=96=B0?= =?UTF-8?q?=E5=A2=9EAppbar=EF=BC=9Bdrawer=E6=B7=BB=E5=8A=A0=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E6=89=93=E5=BC=80=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/integration_test/common_test.dart | 4 ++-- example/integration_test/fair_integration_test.dart | 2 +- example/integration_test/integration_test_util.dart | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/example/integration_test/common_test.dart b/example/integration_test/common_test.dart index f2356f92..372de04d 100644 --- a/example/integration_test/common_test.dart +++ b/example/integration_test/common_test.dart @@ -59,11 +59,11 @@ void main() { //FAB tests // var jsonArray = '[{"action":"delayed"},{"action":"pumpAndSettle"},{"action":"delayed"},{"action":"find.text", "text": "fair 模板代码","expect":1},{"action":"expect","expect":1},{"action":"tap"},{"action":"delayed"},{"action":"pump"},{"action":"find.text", "text": "FAB >>>"},{"action":"expect", "expect":1},{"action":"tap"},{"action":"delayed"},{"action":"pump"},{"action":"takeScreenshot"},{"action":"find.text","text":"click show message!"},{"action":"expect","expect":0}]'; //Drawer tests - var jsonArray = '[{"action":"delayed"},{"action":"pumpAndSettle"},{"action":"delayed"},{"action":"find.text", "text": "fair 模板代码","expect":1},{"action":"expect","expect":1},{"action":"tap"},{"action":"delayed"},{"action":"pump"},{"action":"find.text", "text": "Drawer >>>"},{"action":"expect", "expect":1},{"action":"tap"},{"action":"delayed"},{"action":"pump"},{"action":"takeScreenshot"},{"action":"find.text","text":"click show message!"},{"action":"expect","expect":0}]'; + var jsonArray = '[{"action":"delayed"},{"action":"pumpAndSettle"},{"action":"delayed"},{"action":"find.text", "text": "fair 模板代码","expect":1},{"action":"expect","expect":1},{"action":"tap"},{"action":"delayed"},{"action":"pump"},{"action":"takeScreenshot"},{"action":"find.text","text":"click show message!"},{"action":"expect","expect":0},{"action":"find.text","text":"Drawer >>>"},{"action":"expect", "expect":1},{"action":"find.byType", "type": "AppBar"},{"action":"expect", "expect":1},{"action":"tap"},{"action":"delayed"},{"action":"pump"},{"action":"find.text","text":"电话"},{"action":"expect","expect":0},{"action":"find.text","text":"邮箱"},{"action":"expect","expect":0},{"action":"find.text","text":"位置"},{"action":"expect","expect":0},{"action":"find.text","text":"设置"},{"action":"expect","expect":0}]'; await integrationTestByJson( tester, binding,jsonArray); - List dataList= [ConfigData.delayed(),ConfigData.delayed(),ConfigData.pumpAndSettle(),ConfigData.pump(),ConfigData.findText('fair使用和介绍'),ConfigData.expect(1),ConfigData.findText('fair 模板代码'),ConfigData.expect(1),ConfigData.tap(),ConfigData.pumpAndSettle(),ConfigData.pump(),ConfigData.delayed(),ConfigData.findText('StaggeredView >>>'),ConfigData.expect(1),ConfigData.tap(),ConfigData.pumpAndSettle(),ConfigData.pump(),ConfigData.delayed(),ConfigData.delayed(),ConfigData.pumpAndSettle(),ConfigData.pump(),ConfigData.takeScreenshot(),ConfigData.findText('click show message!'),ConfigData.expect(0)]; + // List dataList= [ConfigData.delayed(),ConfigData.delayed(),ConfigData.pumpAndSettle(),ConfigData.pump(),ConfigData.findText('fair使用和介绍'),ConfigData.expect(1),ConfigData.findText('fair 模板代码'),ConfigData.expect(1),ConfigData.tap(),ConfigData.pumpAndSettle(),ConfigData.pump(),ConfigData.delayed(),ConfigData.findText('StaggeredView >>>'),ConfigData.expect(1),ConfigData.tap(),ConfigData.pumpAndSettle(),ConfigData.pump(),ConfigData.delayed(),ConfigData.delayed(),ConfigData.pumpAndSettle(),ConfigData.pump(),ConfigData.takeScreenshot(),ConfigData.findText('click show message!'),ConfigData.expect(0)]; // await integrationTestByDataList(tester, binding, dataList); }); diff --git a/example/integration_test/fair_integration_test.dart b/example/integration_test/fair_integration_test.dart index 6d626a5d..1bef7078 100644 --- a/example/integration_test/fair_integration_test.dart +++ b/example/integration_test/fair_integration_test.dart @@ -22,7 +22,7 @@ void main() { ,TestData('appbar_template','[{"action":"delayed"},{"action":"pumpAndSettle"},{"action":"delayed"},{"action":"find.text", "text": "fair 模板代码","expect":1},{"action":"expect","expect":1},{"action":"tap"},{"action":"delayed"},{"action":"pump"},{"action":"find.text", "text": "AppBar >>>"},{"action":"expect", "expect":1},{"action":"tap"},{"action":"delayed"},{"action":"pump"},{"action":"takeScreenshot"},{"action":"find.text","text":"click show message!"},{"action":"expect","expect":0}]') ,TestData('detail_page', '[{"action":"delayed"},{"action":"pumpAndSettle"},{"action":"find.text", "text": "fair 模板代码","expect":1},{"action":"expect","expect":1},{"action":"tap"},{"action":"delayed"},{"action":"pump"},{"action":"find.byType","type":"ListView"},{"action":"expect","expect":1},{"action":"drag","offsetY":-1000.0},{"action":"delayed"},{"action":"pump"},{"action":"find.text", "text": "Detail >>>"},{"action":"expect", "expect":1},{"action":"tap"},{"action":"delayed"},{"action":"pump"},{"action":"takeScreenshot"},{"action":"find.text","text":"click show message!"},{"action":"expect","expect":0}]') ,TestData('drawer_template入口', '[{"action":"delayed"},{"action":"pumpAndSettle"},{"action":"delayed"},{"action":"find.text", "text": "fair 模板代码","expect":1},{"action":"expect","expect":1},{"action":"tap"},{"action":"delayed"},{"action":"pump"},{"action":"find.text", "text": "Drawer >>>"},{"action":"expect", "expect":1},{"action":"tap"},{"action":"delayed"},{"action":"pump"},{"action":"takeScreenshot"},{"action":"find.text","text":"click show message!"},{"action":"expect","expect":0}]') - ,TestData('fab_template入口', '[{"action":"delayed"},{"action":"pumpAndSettle"},{"action":"delayed"},{"action":"find.text", "text": "fair 模板代码","expect":1},{"action":"expect","expect":1},{"action":"tap"},{"action":"delayed"},{"action":"pump"},{"action":"find.text", "text": "FAB >>>"},{"action":"expect", "expect":1},{"action":"tap"},{"action":"delayed"},{"action":"pump"},{"action":"takeScreenshot"},{"action":"find.text","text":"click show message!"},{"action":"expect","expect":0}]') + ,TestData('fab_template入口', '[{"action":"delayed"},{"action":"pumpAndSettle"},{"action":"delayed"},{"action":"find.text", "text": "fair 模板代码","expect":1},{"action":"expect","expect":1},{"action":"tap"},{"action":"delayed"},{"action":"pump"},{"action":"takeScreenshot"},{"action":"find.text","text":"click show message!"},{"action":"expect","expect":0},{"action":"find.text","text":"Drawer >>>"},{"action":"expect", "expect":1},{"action":"find.byType", "type": "AppBar"},{"action":"expect", "expect":1},{"action":"tap"},{"action":"delayed"},{"action":"pump"},{"action":"find.text","text":"电话"},{"action":"expect","expect":0},{"action":"find.text","text":"邮箱"},{"action":"expect","expect":0},{"action":"find.text","text":"位置"},{"action":"expect","expect":0},{"action":"find.text","text":"设置"},{"action":"expect","expect":0}]') ]; diff --git a/example/integration_test/integration_test_util.dart b/example/integration_test/integration_test_util.dart index 13808e51..c41db1b5 100644 --- a/example/integration_test/integration_test_util.dart +++ b/example/integration_test/integration_test_util.dart @@ -68,6 +68,9 @@ Future commonTestByConfigData( case 'Drawer': finder = find.byType(Drawer); break; + case 'AppBar': + finder = find.byType(AppBar); + break; default: print("暂不支持 type " + configData.type); break;