我有一个黄瓜和maven的项目,我也在使用JUnit.
我能够从Eclipse成功运行和构建我的项目.
现在我想在另一个系统中从命令行运行测试,该系统确实(应该)没有安装eclipse或者黄瓜.我有一个想法,我们可以从jar创建一个JAR,我们可以通过java cli命令运行测试.
下面是我尝试运行测试的组合,我也粘贴了pom.xml和RunCukesTest.java文件.
的pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>pmc</groupId>
<artifactId>se</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>storeEnabler</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-testng</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.2.4</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.52.0</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.11-beta3</version>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.8.0</version>
</dependency>
</dependencies>
<build>
<testResources> …Run Code Online (Sandbox Code Playgroud) 我无法找到一个帖子,我可以用C#中的appium自动进行移动测试.
我在specflow中编写了我的网站自动化代码.我可以重复使用吗?
我对此做了很多研发,但无法找到解决方案。
我需要在单个功能文件中维护不同场景之间的登录会话。我已经做了一个函数I am logged in并且我已经在后台编写了。所以在每个场景开始时都会发生登录。但我想要的是跨场景维护单个登录会话。有人可以建议吗?
示例代码是:
Feature: To test the output
Background:
Given I am logged in
@javascript
Scenario: To test the positive input
When I fill in "test" with "aab"
And I press "add"
Then I should see "welcome"
@javascript
Scenario:To test the negative inputs
When I fill in "test" with "@#$@!!111"
And I press "add"
Then I should see "Sorry,invalid input please try again"
Run Code Online (Sandbox Code Playgroud)
现在,如果另一个人查看我的代码,他就会了解积极和消极的测试用例。但每次重新加载场景时,如果一个功能中有 50 个场景怎么办?对于更大的项目。我登录的每个场景看起来都不太好,我总共浪费了额外的 15 分钟。我想要的是在单个功能文件中的每个场景之后,测试以相同的登录会话继续。
如何只想在文本框中输入值,使用"Ctrl + a"从文本框中选择完整的文本,然后使用"Ctrl + c"复制它,然后使用"Ctrl + v"将其粘贴到同一个框中"使用Selenium + C#.