- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我最近切换到 Appium + webdriverIO 进行 E2E 测试。除了一个与文本输入相关的测试用异常(exception),一切都运行良好。
基本上,被测组件是一个使用 redux-form 进行表单管理的登录屏幕。我不断收到错误 "'"login-field" Other' is not ready for a text input. Neither the accessibility element itself nor its accessible descendants have the input focus"
.组件如下:SignInScreen.tsx
export class SignInScreen extends React.Component<any> {
render() {
const { handleSubmit, submitting, style } = this.props;
return (
<View style={style}>
<View>
<View>
<Field
name="login"
component={Input}
accessibilityLabel="login-field"
testID="login-field"
/>
<Field
secureTextEntry
name="password"
component={Input}
accessibilityLabel="password-field"
testID="password-field"
/>
</View>
</View>
</View>
);
}
}
Input.tsx
export class Input extends React.Component {
render() {
const {
input,
meta: { error, active, focused },
accessibilityLabel,
testID
} = this.props;
const showError = !active && !!error && !focused;
const errorText = "ERROR!"
return (
<View style={[style, styles.container]}>
<TextInput
autoCapitalize="none"
value={input.value}
onChangeText={input.onChange}
onFocus={input.onFocus}
onBlur={input.onBlur}
accessibilityLabel={accessibilityLabel},
testID={testID}
/>
<View style={{height: 30}}>
{showError && (
<Text>{errorText}</Text>
)}
</View>
</View>
);
}
}
SignInScreen.test.ts
describe('Sign In Screen Test', () => {
let client;
beforeAll(async () => {
// set up code
});
afterAll(async () => {
// tear down code
});
it('Can login', async () => {
const loginField = await client.$('~login-field');
await loginField.setValue('test@gmail.com'); // error here
const passwordField = await client.$('~password-field');
await passwordField.set('password' + '\n');
});
});
当我添加一个额外的
<TextInput />
时,我确实意识到测试用例可以工作。在现有
<TextInput />
之上
Input.tsx
中的组件组件如下:
Input.tsx
export class Input extends React.Component {
render() {
const {
input,
meta: { error, active, focused },
accessibilityLabel,
testID
} = this.props;
const showError = !active && !!error && !focused;
const errorText = "ERROR!"
return (
<View style={[style, styles.container]}>
<TextInput />
<TextInput
autoCapitalize="none"
value={input.value}
onChangeText={input.onChange}
onFocus={input.onFocus}
onBlur={input.onBlur}
accessibilityLabel={accessibilityLabel},
testID={testID}
/>
<View style={{height: 30}}>
{showError && (
<Text>{errorText}</Text>
)}
</View>
</View>
);
}
}
或者我删除
View
中的固定高度嵌套错误消息的组件如下:
Input.tsx
export class Input extends React.Component {
render() {
const {
input,
meta: { error, active, focused },
accessibilityLabel,
testID
} = this.props;
const showError = !active && !!error && !focused;
const errorText = "ERROR!"
return (
<View style={[style, styles.container]}>
<TextInput
autoCapitalize="none"
value={input.value}
onChangeText={input.onChange}
onFocus={input.onFocus}
onBlur={input.onBlur}
accessibilityLabel={accessibilityLabel},
testID={testID}
/>
<View>
{showError && (
<Text>{errorText}</Text>
)}
</View>
</View>
);
}
}
那么什么给呢?我真的不知道是什么导致 Appium 在没有进行上述调整的情况下无法获取输入焦点。
最佳答案
我相信这是 Appium 最近的一个错误 - https://github.com/appium/java-client/issues/1386
关于react-native - Appium React Native 尚未准备好进行文本输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63683916/
我在识别“Appium”中突出显示的元素时收到以下消息。 Appium: 1.7.1设备:iPhone X(12.0 和模拟器)Java 客户端: 1.6.1Xcode:V 10 交互不适用于此元素。
我在 IOS 和 Android 的移动自动化中使用了 Appium。我想知道提供 Calabash 的优势,以及这两种工具生成的脚本是否有共同点? 我已经点击了这个链接:Appium VS Cala
由于 swipe() 已弃用,我无法从左向右滑动屏幕。我的应用程序中有 4 个横幅,我想滑动以查看所有横幅。 最佳答案 这适用于所有方向: 枚举: public enum DIRECTION {
在进行 Appium 测试时,我单击退出应用程序的按钮,如何检查应用程序是否正在运行或我们返回主屏幕。是否有任何方法可以仅通过包名称查找元素列表。 最佳答案 import io.appium.java
我试过命令: npm -install -g appium@1.6 但是当我重新启动 Appium 时,它仍然是 1.5.3 版本。 最佳答案 有两种不同类型的 appium 工具可用 Appium
Mac书空气 Java 1.8 Appium桌面版1.8.1 大家好, 我正在构建一个 TestNG 框架,并且我想以编程方式启动我的 appium 桌面服务器以进行测试。所以我决定做的是创建一个 j
打开终端 (cmd) 并运行 appium-doctor 后,我收到以下警告: WARN AppiumDoctor ✖ opencv4nodejs cannot be found. WARN Appi
这里是移动自动化的新手。我正在尝试使用 Touch Action 执行以下代码来执行滑动操作以导航到第 2 页,但滑动不起作用。 AndroidDriver driver=new AndroidDri
我有一个 iOS 应用程序,它在单个页面上有很多输入字段。我想自动执行这些输入,我知道如何滚动到这些元素和所有内容,但我对部分显示的元素有疑问。 有两种情况下部分显示的元素会导致问题: 第一种情况是当
我正在使用 eclipse 学习 appium,但在启动我的模拟器时卡住了。我尝试了不同的方法,例如在文件夹结构中四处移动文件,但我一直收到 文件不存在或不可访问 我尝试搜索答案,但没有任何帮助。 p
我的应用程序需要多个应用程序权限。我需要通过允许或拒绝不同的权限来检查我的应用程序的行为。如何从 appium 启用/禁用应用程序权限以创建多个场景? 例如,假设我的应用程序需要权限:permissi
我正在使用 Appium 版本 V1.15.0 并且已经使用默认主机:0.0.0.0 和端口:4723 成功启动服务器 但是现在当我尝试启动服务器时,它显示了这个错误“Error Starting A
我在一家提供 wifi 的公司工作。我有一些接入点设置,我想编写一些模拟连接到这些接入点的自动化测试。 所以我的测试将是这样的: 发射装置 转到设备上的 wifi 设置 选择要连接的wifi 验证设备
我在用 : Xcode 10.1 Os Version : 12.1 iPhone 6 我确实按照所有必需的步骤来设置构建和所有内容,但是在尝试使用 xcode build 构建项目时仍然出现错误。
我正在使用 appium 工具测试我的应用程序。在测试过程中,android应用程序在启动器事件附近崩溃,仅在8以下版本的某些设备上显示以下错误。如何解决? An unknown server-sid
我试图运行测试ipa。但是 appium 在循环中重新启动应用程序并产生此错误。 [INST STDERR] Instruments Trace Error : Target failed to ru
我想知道是否有人知道在运行 Appium 测试时使用什么 Java/Groovy 库/工具来嗅探、记录和处理 native 应用程序的 HTTP 流量?有没有人在特定情况下使用 Browser Mob
我在测试中担任 SD。我是 Appium 自动化工具的新手,这个工具对我来说设置环境非常棘手。 我引用了以下链接:http://unmesh.me/category/appium/ 这个链接帮助我安装
正在测试 Android 和 iOS 应用程序。这是我的应用程序的配置屏幕,出现一个 OTP 用例,停止对应用程序的进一步测试。用例是。 当用户在应用程序的起始页面输入手机号码时,指令为 。点击发送按
我已经安装了 appium doctor 并且在 mac 上没有错误地安装了它。但是,当我使用命令“appium-doctor -h”进行检查时。它给出了以下异常。你能告诉我这里出了什么问题吗: ap
我是一名优秀的程序员,十分优秀!