Permalink
Browse files

initial commit

  • Loading branch information...
1 parent 3193184 commit 48b515e136015058d78acc88c7c1e5f1ef6379cd @krukow committed Sep 2, 2012
View
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java">
+ <attributes>
+ <attribute name="optional" value="true"/>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java">
+ <attributes>
+ <attribute name="optional" value="true"/>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
View
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>calabash-java-example</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,5 @@
+#Thu Aug 30 22:06:33 CEST 2012
+eclipse.preferences.version=1
+encoding//src/main/java=UTF-8
+encoding//src/test/java=UTF-8
+encoding/<project>=UTF-8
@@ -0,0 +1,6 @@
+#Thu Aug 30 22:06:33 CEST 2012
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.5
@@ -0,0 +1,5 @@
+#Thu Aug 30 22:06:32 CEST 2012
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
View
58 pom.xml
@@ -0,0 +1,58 @@
+<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>calabash-jvm</groupId>
+ <artifactId>calabash-java-example</artifactId>
+ <version>0.1</version>
+ <packaging>jar</packaging>
+
+ <name>calabash-java-example</name>
+ <url>http://maven.apache.org</url>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <repositories>
+ <repository>
+ <id>clojars.org</id>
+ <url>http://clojars.org/repo</url>
+ </repository>
+ </repositories>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>calabash-jvm</groupId>
+ <artifactId>calabash-jvm</artifactId>
+ <scope>test</scope>
+ <version>0.0.3</version>
+ </dependency>
+ <dependency>
+ <groupId>info.cukes</groupId>
+ <artifactId>cucumber-jvm-deps</artifactId>
+ <scope>test</scope>
+ <version>1.0.3</version>
+ </dependency>
+ <dependency>
+ <groupId>info.cukes</groupId>
+ <artifactId>cucumber-java</artifactId>
+ <scope>test</scope>
+ <version>1.0.14</version>
+ </dependency>
+ <dependency>
+ <groupId>info.cukes</groupId>
+ <artifactId>cucumber-junit</artifactId>
+ <scope>test</scope>
+ <version>1.0.14</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ <version>4.10</version>
+ </dependency>
+ </dependencies>
+</project>
@@ -0,0 +1,13 @@
+package calabash_jvm.example.java;
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ public static void main( String[] args )
+ {
+
+ }
+}
@@ -0,0 +1,12 @@
+package calabash_jvm.example.java;
+
+import org.junit.runner.RunWith;
+
+import cucumber.junit.Cucumber;
+
+@RunWith(Cucumber.class)
+
+public class AppTest
+
+{
+}
@@ -0,0 +1,28 @@
+package calabash_jvm.example.java;
+
+import static calabash_jvm.API.*;
+import static calabash_jvm.example.java.QueryBuilder.view;
+import cucumber.annotation.en.Given;
+import cucumber.annotation.en.Then;
+
+
+public class ExampleStepDefinitions {
+
+ @Given("^I go to the table$")
+ public void I_go_to_the_table()
+ {
+ touch(view("UITabBarButton").marked("Third"), null);
+
+ waitForExists(view("UITableViewCell").with("text", "Cell '2"), null);
+
+ }
+
+ @Then("^I should see \"([^\"]*)\"$")
+ public void I_should_see(String text) throws Throwable {
+
+ query(view("UIView").marked(text), null);
+
+ screenshot(null);
+
+ }
+}
@@ -0,0 +1,85 @@
+package calabash_jvm.example.java;
+
+import java.util.AbstractList;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+@SuppressWarnings({ "rawtypes", "unchecked" })
+public class QueryBuilder extends AbstractList {
+
+ private List list;
+
+ public QueryBuilder() {
+ this.list = new ArrayList(10);
+ }
+
+ public QueryBuilder(List l) {
+ this.list = new ArrayList(l);
+ }
+
+ public Object get(int i) {
+ return this.list.get(i);
+ }
+
+ public int size() {
+ return this.list.size();
+ }
+
+ public QueryBuilder dup() {
+ return new QueryBuilder(this.list);
+ }
+
+ public static QueryBuilder view(String s) {
+ return new QueryBuilder().type(s);
+ }
+
+ public QueryBuilder type(String t) {
+ this.list.add(t);
+ return this;
+ }
+
+ public QueryBuilder parent() {
+ this.list.add("parent");
+ return this;
+ }
+
+ public QueryBuilder descendant() {
+ this.list.add("descendant");
+ return this;
+ }
+
+ public QueryBuilder child() {
+ this.list.add("child");
+ return this;
+ }
+
+ public QueryBuilder with(String key, Object val) {
+ this.list.add(Collections.singletonMap(key, val));
+ return this;
+ }
+
+ public QueryBuilder marked(String mark) {
+ return with("marked", mark);
+ }
+
+ public QueryBuilder index(int i) {
+ this.list.add(calabash_jvm.API.index(i));
+ return this;
+ }
+
+ public QueryBuilder css(String s) {
+ this.list.add(calabash_jvm.API.css(s));
+ return this;
+ }
+
+ public QueryBuilder xpath(String xp) {
+ this.list.add(calabash_jvm.API.xpath(xp));
+ return this;
+ }
+
+ public List toQuery() {
+ return Collections.unmodifiableList(this.list);
+ }
+
+}
@@ -0,0 +1,5 @@
+Feature: Example
+
+Scenario: I go to the table
+ When I go to the table
+ Then I should see "Cell 2"

0 comments on commit 48b515e

Please sign in to comment.