nativescript-dev-cucumber
A NativeScript 插件,用于帮助集成和运行与 Appium 配合的 Cucumber 测试
npm i --save nativescript-dev-cucumber
- 版本:0.1.4
- GitHub:
- NPM: https://npmjs.net.cn/package/nativescript-dev-cucumber
- 下载量
- 昨日:0
- 上周:0
- 上个月:0
nativescript-dev-cucumber
一个辅助包,使在 NativeScript 应用中运行端到端(E2E)Appium 测试更容易。
用法
使用以下命令安装它
$ tns install cumcumber
它将在 features
目录下生成一个示例测试。现在,使用以下命令运行它
$ npm run cucumber-android
或
$ npm run cucumber-ios-simulator
测试是标准的 Cumcumber.js 测试。
入门
创建一个新的 NativeScript 应用程序(如有必要)
$ tns create cucumberSample --ng
更新模板以添加 "automationText" 属性(用于 Angular2 NS 应用程序)。
app.component.html
<StackLayout>
<Label text="Tap the button" class="title"></Label>
<Button text="TAP" (tap)="onTap()" automationText="tapButton"></Button>
<Label [text]="message" class="message" textWrap="true" automationText="messageLabel"></Label>
</StackLayout>
安装 cucumber
$ tns install cucumber
执行测试
$ npm run cucumber-android
或
$ npm run cucumber-ios-simulator