earlgrey

Python如何快速创建 GIF 动图?图片神器Pillow帮你解决

荒凉一梦 提交于 2020-08-05 06:31:15
前言 本文的文字及图片来源于网络,仅供学习、交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理。 作者:EarlGrey 什么是 GIF 图? GIF(“图形交换格式”)是一种位图图像格式,于1987年开发。 GIF基本上是一系列具有不同设置的图像,例如: 循环播放 每帧的持续时间(图片) 其他… GIF 也可以是静态图像。 Pillow Pillow 是 Python 图形处理库 PIL 的一个分支,引入了许多更改和增强功能,以使API易于使用或处理更多图像格式和要求。支持打开、处理和保存多种不同格式的图片文件。 利用 Python 生成 GIF 安装 Pillow 第一步,我们需要先安装 Pillow: pip install Pillow 生成 GIF 我们生成一张红球往下坠落的 GIF 动图,作为文章示例。 首先,编写一个函数,利用 Pillow 在一张图片上画一个红球。 from PIL import Image, ImageDraw def create_image_with_ball(width, height, ball_x, ball_y, ball_size): img = Image.new('RGB', (width, height), (255, 255, 255)) draw = ImageDraw.Draw(img) #

EarlGrey - How do I check if multiple objects are being shown on the screen

无人久伴 提交于 2020-02-03 10:42:47
问题 The EarlGrey documentation says that You must narrow down the selection until it can uniquely identify a single UI element I have three UIViews on my UI that I need to check the visibility of using the grey_sufficientlyVisible() assertion. However, unless if I literally pick each one up using their individual accessibility labels or so, I cannot match all of them. Is there a way to match a super-set of views or should I create individual test conditions for each of the views? 回答1: By saying

EarlGrey - How do I check if multiple objects are being shown on the screen

Deadly 提交于 2020-02-03 10:42:22
问题 The EarlGrey documentation says that You must narrow down the selection until it can uniquely identify a single UI element I have three UIViews on my UI that I need to check the visibility of using the grey_sufficientlyVisible() assertion. However, unless if I literally pick each one up using their individual accessibility labels or so, I cannot match all of them. Is there a way to match a super-set of views or should I create individual test conditions for each of the views? 回答1: By saying

EarlGrey launches the APP but the screen is blank

杀马特。学长 韩版系。学妹 提交于 2019-12-12 03:34:51
问题 Trying to launch EarlGrey tests on my APP but all that I get is empty screen after the splash screen is opened. We use 2 different windows for splash screen and main APP and it looks like EarlGrey stacks on the first one. Is there a way to switch the screens in EarlGrey? That what I have in test output: 2016-03-03 15:00:25.721 XING[23504:165847] Could not kickstart com.apple.AXInspector [268435460 - port: 31499] 2016-03-03 15:00:49.001 XING[23504:165847] Application window hierarchy (ordered

Earlgrey is slow when accessing NavBar/TabBar Items

别来无恙 提交于 2019-12-11 08:52:44
问题 As EarlGrey runs in the process and there is no install/uninstall process involved as in XCUI test framework, I expected tests to run faster but I noticed it is almost the same speed as XCUI test framework. Any reasons? It's very slow to get TabBar or NavBar items. How can I speed up the process? I'm using this for TabBar elements to match let tabButtonMatcher: GREYMatcher = grey_allOf([grey_accessibilityLabel("Something"), grey_accessibilityTrait(UIAccessibilityTraitButton), grey

Is it possible to dismiss System Alerts using EarlGrey (iOS UI Testing)?

时光总嘲笑我的痴心妄想 提交于 2019-12-10 15:26:00
问题 I'm beginning to experiment with EarlGrey a little bit, having done UI Testing using the XCUITest for some months now. I'm running into the classic problem of being unable to dismiss system alerts, which is strange as it looks as though Google implemented a matcher for system alerts called grey_systemAlertViewShown(). I'm trying to detect system alerts using GREYCondition. Here's what I've tried: - (void)waitForAndDismissSystemAlertForSeconds:(NSInteger)seconds { GREYCondition