草庐IT

test_score

全部标签

ios - 断言失败 : UI Testing Failure - Failure fetching attributes for element

在Xcode(7.2和7.3)中进行UI测试时,我的测试有时会失败并出现相当一般性的错误:AssertionFailure:UITestingFailure-Failurefetchingattributesforelement在元素上调用.hittable或.tap()时,我往往会遇到此错误,但我不知道为什么。我已经检查过我正在处理的所有元素都正确设置了它们的可访问性设置,并且它们所在的任何容器View都没有启用可访问性。唉,这似乎并不能解决问题。控制台日志显示:UITestingFailure-Failurefetchingattributesforelementpid:89032

iOS 游戏中心 : Scores not showing on leaderboard in sandbox

我正在开发一款支持GameCenter的游戏,但我在沙盒环境中遇到了问题。我可以顺利报分,没有报错。但是,当我显示排行榜时,看不到任何分数。为了验证分数确实到达那里,我使用以下代码查询本地用户的分数:-(void)retrieveLocalScoreForCategory:(NSString*)category{GKLeaderboard*leaderboardRequest=[[GKLeaderboardalloc]init];leaderboardRequest.category=category;[leaderboardRequestloadScoresWithCompletio

iOS 游戏中心 : Scores not showing on leaderboard in sandbox

我正在开发一款支持GameCenter的游戏,但我在沙盒环境中遇到了问题。我可以顺利报分,没有报错。但是,当我显示排行榜时,看不到任何分数。为了验证分数确实到达那里,我使用以下代码查询本地用户的分数:-(void)retrieveLocalScoreForCategory:(NSString*)category{GKLeaderboard*leaderboardRequest=[[GKLeaderboardalloc]init];leaderboardRequest.category=category;[leaderboardRequestloadScoresWithCompletio

Test ignored.

问题描述/***不创建对象的读*/@TestpublicvoidnoModelRead(){StringfileName=TestFileUtil.getPath()+"demo"+File.separator+"demo.xlsx";//这里只要,然后读取第一个sheet同步读取会自动finishEasyExcel.read(fileName,newNoModelDataListener()).sheet().doRead();log.info("不创建对象的读");}}@Test启动报了下面的错Testignored.问题解决:因为使用@Test的类上加了 @Ignore,加上@Ignor

testing - 如何测试容器的宽度/高度大小

我正在尝试测试容器的宽度和高度。我正在尝试做这样的事情:expect(find.byWidgetPredicate((Widgetwidget)=>widgetisContainer&&widget.width==48),findsOneWidget);但是。不幸的是,如果我输入widget.width,它会说没有为类Container定义getter宽度。 最佳答案 Container中没有这样的属性。相反,它包含一个BoxConstraints,其中包含Container的最小和最大宽度。假设minWidth和maxWidth在

testing - 如何测试容器的宽度/高度大小

我正在尝试测试容器的宽度和高度。我正在尝试做这样的事情:expect(find.byWidgetPredicate((Widgetwidget)=>widgetisContainer&&widget.width==48),findsOneWidget);但是。不幸的是,如果我输入widget.width,它会说没有为类Container定义getter宽度。 最佳答案 Container中没有这样的属性。相反,它包含一个BoxConstraints,其中包含Container的最小和最大宽度。假设minWidth和maxWidth在

testing - 测试应该找到一个特定的图标

我如何测试它是否应该找到像Icons.visibility这样的特定图标?这是我的测试:testWidgets('Shouldfindvisibility_officon',(WidgetTestertester)async{await_buildApp(tester);awaittester.pumpAndSettle();expect(find.byWidget(Icon(Icons.visibility)),findsOneWidget);}); 最佳答案 在Finder对象上有一个byIcon方法。https://api.f

testing - 测试应该找到一个特定的图标

我如何测试它是否应该找到像Icons.visibility这样的特定图标?这是我的测试:testWidgets('Shouldfindvisibility_officon',(WidgetTestertester)async{await_buildApp(tester);awaittester.pumpAndSettle();expect(find.byWidget(Icon(Icons.visibility)),findsOneWidget);}); 最佳答案 在Finder对象上有一个byIcon方法。https://api.f

testing - Flutter widget测试中如何使用List的find.byType匹配

我想对Stack进行小部件测试。这是示例代码finalListchildren=[];finalstack=Stack(children:children);awaittester.pumpWidget(Container(child:stack));...finalstackFinder=find.byWidget(stack);expect(stackFinder,findsOneWidget);//childrenshouldbeinStackfinalchildrenFinder=find.descendant(of:stackFinder,matching:find.byTy

testing - Flutter widget测试中如何使用List的find.byType匹配

我想对Stack进行小部件测试。这是示例代码finalListchildren=[];finalstack=Stack(children:children);awaittester.pumpWidget(Container(child:stack));...finalstackFinder=find.byWidget(stack);expect(stackFinder,findsOneWidget);//childrenshouldbeinStackfinalchildrenFinder=find.descendant(of:stackFinder,matching:find.byTy