Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

First commit

  • Loading branch information...
commit 9b8b6c129fa7cef58b759a4ba06f4eced769d786 0 parents
John Ferguson Smart authored

Showing 13 changed files with 589 additions and 0 deletions. Show diff stats Hide diff stats

  1. 16  .gitignore
  2. 15  thucydides-showcase-simple-webtests/.gitignore
  3. 189  thucydides-showcase-simple-webtests/pom.xml
  4. 39  ...ydides-showcase-simple-webtests/src/main/java/net/thucydides/showcase/simple/pages/ArtifactDetailsPage.java
  5. 25  thucydides-showcase-simple-webtests/src/main/java/net/thucydides/showcase/simple/pages/ArtifactEntry.java
  6. 32  thucydides-showcase-simple-webtests/src/main/java/net/thucydides/showcase/simple/pages/SearchPage.java
  7. 40  thucydides-showcase-simple-webtests/src/main/java/net/thucydides/showcase/simple/pages/SearchResultsPage.java
  8. 39  ...ydides-showcase-simple-webtests/src/test/java/net/thucydides/showcase/simple/WhenSearchingForArtifacts.java
  9. 41  ...dides-showcase-simple-webtests/src/test/java/net/thucydides/showcase/simple/WhenViewingArtifactDetails.java
  10. 16  thucydides-showcase-simple-webtests/src/test/java/net/thucydides/showcase/simple/requirements/Application.java
  11. 62  thucydides-showcase-simple-webtests/src/test/java/net/thucydides/showcase/simple/steps/DeveloperSteps.java
  12. 37  ...des-showcase-simple-webtests/src/test/stories/net/thucydides/showcase/simple/SearchForArtifactsByName.story
  13. 38  thucydides-showcase-simple-webtests/src/test/stories/net/thucydides/showcase/simple/ViewArtifactDetails.story
16  .gitignore
... ...
@@ -0,0 +1,16 @@
  1
+.project
  2
+.settings
  3
+target
  4
+.idea
  5
+.classpath
  6
+.checkstyle
  7
+*.log
  8
+*.log.*
  9
+*.iml
  10
+*.versionsBackup
  11
+interpolated-*.xml
  12
+*.iws
  13
+*.ipr
  14
+out
  15
+.DS_Store
  16
+*.ignore
15  thucydides-showcase-simple-webtests/.gitignore
... ...
@@ -0,0 +1,15 @@
  1
+.project
  2
+.settings
  3
+target
  4
+.idea
  5
+.classpath
  6
+.checkstyle
  7
+*.log
  8
+*.log.*
  9
+*.iml
  10
+*.versionsBackup
  11
+interpolated-*.xml
  12
+*.iws
  13
+*.ipr
  14
+out
  15
+*.ignore
189  thucydides-showcase-simple-webtests/pom.xml
... ...
@@ -0,0 +1,189 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  4
+    <modelVersion>4.0.0</modelVersion>
  5
+
  6
+    <groupId>net.thucydides.showcase</groupId>
  7
+    <artifactId>thucydides-showcase-simple-webtests</artifactId>
  8
+    <version>0.0.1-SNAPSHOT</version>
  9
+    <packaging>jar</packaging>
  10
+
  11
+    <name>Sample Thucydides project</name>
  12
+
  13
+    <properties>
  14
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  15
+        <thucydides.version>0.4.30</thucydides.version>
  16
+        <thucydides.easyb.version>0.4.30</thucydides.easyb.version>
  17
+        <webdriver.driver>firefox</webdriver.driver>
  18
+    </properties>
  19
+
  20
+    <dependencies>
  21
+        <dependency>
  22
+            <groupId>net.thucydides</groupId>
  23
+            <artifactId>thucydides-core</artifactId>
  24
+            <version>${thucydides.version}</version>
  25
+        </dependency>
  26
+        <dependency>
  27
+            <groupId>org.slf4j</groupId>
  28
+            <artifactId>slf4j-simple</artifactId>
  29
+            <version>1.6.1</version>
  30
+        </dependency>
  31
+        <dependency>
  32
+            <groupId>net.thucydides</groupId>
  33
+            <artifactId>thucydides-junit</artifactId>
  34
+            <version>${thucydides.version}</version>
  35
+            <scope>test</scope>
  36
+        </dependency>
  37
+        <dependency>
  38
+            <groupId>net.thucydides.easyb</groupId>
  39
+            <artifactId>thucydides-easyb-plugin</artifactId>
  40
+            <version>${thucydides.easyb.version}</version>
  41
+            <scope>test</scope>
  42
+        </dependency>
  43
+        <dependency>
  44
+            <groupId>org.codehaus.groovy</groupId>
  45
+            <artifactId>groovy-all</artifactId>
  46
+            <version>1.8.2</version>
  47
+        </dependency>
  48
+        <dependency>
  49
+            <groupId>junit</groupId>
  50
+            <artifactId>junit</artifactId>
  51
+            <version>4.8.2</version>
  52
+            <scope>test</scope>
  53
+        </dependency>
  54
+        <dependency>
  55
+            <groupId>com.googlecode.lambdaj</groupId>
  56
+            <artifactId>lambdaj</artifactId>
  57
+            <version>2.3.1</version>
  58
+        </dependency>
  59
+        <dependency>
  60
+            <groupId>org.hamcrest</groupId>
  61
+            <artifactId>hamcrest-all</artifactId>
  62
+            <version>1.1</version>
  63
+            <scope>test</scope>
  64
+        </dependency>
  65
+    </dependencies>
  66
+    <build>
  67
+        <plugins>
  68
+            <plugin>
  69
+                <groupId>org.apache.maven.plugins</groupId>
  70
+                <artifactId>maven-surefire-plugin</artifactId>
  71
+                <version>2.9</version>
  72
+                <configuration>
  73
+                    <skip>true</skip>
  74
+                </configuration>
  75
+            </plugin>
  76
+            <plugin>
  77
+                <artifactId>maven-failsafe-plugin</artifactId>
  78
+                <version>2.10</version>
  79
+                <configuration>
  80
+                    <includes>
  81
+                        <include>**/*Test.java</include>
  82
+                        <include>**/Test*.java</include>
  83
+                        <include>**/When*.java</include>
  84
+                    </includes>
  85
+                    <argLine>-Xmx512m</argLine>
  86
+                    <systemPropertyVariables>
  87
+                        <webdriver.driver>${webdriver.driver}</webdriver.driver>
  88
+                        <thucydides.browser.width>1000</thucydides.browser.width>
  89
+                    </systemPropertyVariables>
  90
+                </configuration>
  91
+                <executions>
  92
+                    <execution>
  93
+                        <goals>
  94
+                            <goal>integration-test</goal>
  95
+                            <goal>verify</goal>
  96
+                        </goals>
  97
+                    </execution>
  98
+                </executions>
  99
+            </plugin>
  100
+            <plugin>
  101
+                <groupId>org.apache.maven.plugins</groupId>
  102
+                <artifactId>maven-compiler-plugin</artifactId>
  103
+                <version>2.3.2</version>
  104
+                <configuration>
  105
+                    <source>1.5</source>
  106
+                    <target>1.5</target>
  107
+                </configuration>
  108
+            </plugin>
  109
+            <plugin>
  110
+                <groupId>org.easyb</groupId>
  111
+                <artifactId>maven-easyb-plugin</artifactId>
  112
+                <version>1.3</version>
  113
+                <executions>
  114
+                    <execution>
  115
+                        <goals>
  116
+                            <goal>test</goal>
  117
+                        </goals>
  118
+                    </execution>
  119
+                </executions>
  120
+                <configuration>
  121
+                    <storyType>html</storyType>
  122
+                    <storyReport>target/easyb/easyb.html</storyReport>
  123
+                    <easybTestDirectory>src/test/stories</easybTestDirectory>
  124
+                    <jvmArguments>-Xmx512m -Dwebdriver.driver=${webdriver.driver}</jvmArguments>
  125
+                </configuration>
  126
+            </plugin>
  127
+            <plugin>
  128
+                <groupId>net.thucydides.maven.plugins</groupId>
  129
+                <artifactId>maven-thucydides-plugin</artifactId>
  130
+                <version>${thucydides.version}</version>
  131
+                <executions>
  132
+                    <execution>
  133
+                        <id>thucydides-reports</id>
  134
+                        <phase>post-integration-test</phase>
  135
+                        <goals>
  136
+                            <goal>aggregate</goal>
  137
+                        </goals>
  138
+                    </execution>
  139
+                </executions>
  140
+            </plugin>
  141
+        </plugins>
  142
+    </build>
  143
+
  144
+    <profiles>
  145
+        <profile>
  146
+            <id>maven2</id>
  147
+            <activation>
  148
+                <file>
  149
+                    <missing>${basedir}</missing>
  150
+                </file>
  151
+            </activation>
  152
+            <reporting>
  153
+                <plugins>
  154
+                    <plugin>
  155
+                        <groupId>net.thucydides.maven.plugins</groupId>
  156
+                        <artifactId>maven-thucydides-plugin</artifactId>
  157
+                        <version>${thucydides.version}</version>
  158
+                    </plugin>
  159
+                </plugins>
  160
+            </reporting>
  161
+        </profile>
  162
+        <profile>
  163
+            <id>maven3</id>
  164
+            <activation>
  165
+                <file>
  166
+                    <exists>${basedir}</exists>
  167
+                </file>
  168
+            </activation>
  169
+            <build>
  170
+                <plugins>
  171
+                    <plugin>
  172
+                        <groupId>org.apache.maven.plugins</groupId>
  173
+                        <artifactId>maven-site-plugin</artifactId>
  174
+                        <version>3.0-beta-3</version>
  175
+                        <configuration>
  176
+                            <reportPlugins>
  177
+                                <plugin>
  178
+                                    <groupId>net.thucydides.maven.plugins</groupId>
  179
+                                    <artifactId>maven-thucydides-plugin</artifactId>
  180
+                                    <version>${thucydides.version}</version>
  181
+                                </plugin>
  182
+                            </reportPlugins>
  183
+                        </configuration>
  184
+                    </plugin>
  185
+                </plugins>
  186
+            </build>
  187
+        </profile>
  188
+    </profiles>
  189
+</project>
39  ...des-showcase-simple-webtests/src/main/java/net/thucydides/showcase/simple/pages/ArtifactDetailsPage.java
... ...
@@ -0,0 +1,39 @@
  1
+package net.thucydides.showcase.simple.pages;
  2
+
  3
+import net.thucydides.core.matchers.PropertyMatcher;
  4
+import net.thucydides.core.pages.PageObject;
  5
+import net.thucydides.core.pages.WebElementFacade;
  6
+import org.openqa.selenium.By;
  7
+import org.openqa.selenium.WebDriver;
  8
+import org.openqa.selenium.WebElement;
  9
+
  10
+import java.util.List;
  11
+import java.util.Map;
  12
+
  13
+import static net.thucydides.core.pages.components.HtmlTable.filterRows;
  14
+import static net.thucydides.core.pages.components.HtmlTable.rowsFrom;
  15
+
  16
+public class ArtifactDetailsPage extends PageObject {
  17
+
  18
+    WebElement groupid;
  19
+    WebElement artifactid;
  20
+    WebElement versionid;
  21
+
  22
+	public ArtifactDetailsPage(WebDriver driver) {
  23
+		super(driver);
  24
+	}
  25
+
  26
+    public String getGroupId() {
  27
+        return element(groupid).getTextValue();
  28
+    }
  29
+
  30
+    public String getArtifactId() {
  31
+        return element(artifactid).getTextValue();
  32
+    }
  33
+
  34
+    public String getVersionId() {
  35
+        return element(versionid).getTextValue();
  36
+    }
  37
+}
  38
+
  39
+
25  thucydides-showcase-simple-webtests/src/main/java/net/thucydides/showcase/simple/pages/ArtifactEntry.java
... ...
@@ -0,0 +1,25 @@
  1
+package net.thucydides.showcase.simple.pages;
  2
+
  3
+public class ArtifactEntry {
  4
+    private final String groupId;
  5
+    private final String artifactId;
  6
+    private final String latestVersion;
  7
+
  8
+    public ArtifactEntry(String groupId, String artifactId, String latestVersion) {
  9
+        this.groupId = groupId;
  10
+        this.artifactId = artifactId;
  11
+        this.latestVersion = latestVersion;
  12
+    }
  13
+
  14
+    public String getGroupId() {
  15
+        return groupId;
  16
+    }
  17
+
  18
+    public String getArtifactId() {
  19
+        return artifactId;
  20
+    }
  21
+
  22
+    public String getLatestVersion() {
  23
+        return latestVersion;
  24
+    }
  25
+}
32  thucydides-showcase-simple-webtests/src/main/java/net/thucydides/showcase/simple/pages/SearchPage.java
... ...
@@ -0,0 +1,32 @@
  1
+package net.thucydides.showcase.simple.pages;
  2
+
  3
+import net.thucydides.core.annotations.DefaultUrl;
  4
+import net.thucydides.core.pages.PageObject;
  5
+import org.openqa.selenium.WebDriver;
  6
+import org.openqa.selenium.WebElement;
  7
+import org.openqa.selenium.support.FindBy;
  8
+
  9
+@DefaultUrl("http://search.maven.org/")
  10
+public class SearchPage extends PageObject {
  11
+
  12
+
  13
+    @FindBy(id="query")
  14
+    private WebElement search;
  15
+
  16
+    @FindBy(id="queryButton")
  17
+    private WebElement searchButton;
  18
+    
  19
+    public SearchPage(WebDriver driver) {
  20
+        super(driver);
  21
+    }
  22
+
  23
+    public void enter_search_terms(String searchTerms) {
  24
+        search.sendKeys(searchTerms);
  25
+    }
  26
+
  27
+    public void starts_search() {
  28
+        searchButton.click();
  29
+    }
  30
+}
  31
+
  32
+
40  ...dides-showcase-simple-webtests/src/main/java/net/thucydides/showcase/simple/pages/SearchResultsPage.java
... ...
@@ -0,0 +1,40 @@
  1
+package net.thucydides.showcase.simple.pages;
  2
+
  3
+import net.thucydides.core.matchers.PropertyMatcher;
  4
+import net.thucydides.core.pages.PageObject;
  5
+import net.thucydides.core.pages.WebElementFacade;
  6
+import org.openqa.selenium.By;
  7
+import org.openqa.selenium.WebDriver;
  8
+import org.openqa.selenium.WebElement;
  9
+
  10
+import java.util.List;
  11
+import java.util.Map;
  12
+
  13
+import static net.thucydides.core.pages.components.HtmlTable.filterRows;
  14
+import static net.thucydides.core.pages.components.HtmlTable.rowsFrom;
  15
+
  16
+public class SearchResultsPage extends PageObject {
  17
+
  18
+    WebElement resultTable;
  19
+
  20
+	public SearchResultsPage(WebDriver driver) {
  21
+		super(driver);
  22
+	}
  23
+
  24
+    public List<Map<String, String>> getSearchResults() {
  25
+        return rowsFrom(resultTable);
  26
+    }
  27
+
  28
+    public WebElementFacade resultTable() {
  29
+        return element(resultTable);
  30
+    }
  31
+
  32
+    public void clickOnFirstRowMatching(PropertyMatcher... matchers) {
  33
+        List<WebElement> matchingRows = filterRows(resultTable, matchers);
  34
+        WebElement targetRow = matchingRows.get(0);
  35
+        WebElement detailsLink = targetRow.findElement(By.xpath(".//a[contains(@href,'artifactdetails')]"));
  36
+        detailsLink.click();
  37
+    }
  38
+}
  39
+
  40
+
39  ...des-showcase-simple-webtests/src/test/java/net/thucydides/showcase/simple/WhenSearchingForArtifacts.java
... ...
@@ -0,0 +1,39 @@
  1
+package net.thucydides.showcase.simple;
  2
+
  3
+import net.thucydides.core.annotations.Managed;
  4
+import net.thucydides.core.annotations.ManagedPages;
  5
+import net.thucydides.core.annotations.Steps;
  6
+import net.thucydides.core.annotations.Story;
  7
+import net.thucydides.core.pages.Pages;
  8
+import net.thucydides.junit.runners.ThucydidesRunner;
  9
+import net.thucydides.showcase.simple.requirements.Application;
  10
+import net.thucydides.showcase.simple.steps.DeveloperSteps;
  11
+import org.junit.Test;
  12
+import org.junit.runner.RunWith;
  13
+import org.openqa.selenium.WebDriver;
  14
+
  15
+import static net.thucydides.core.matchers.PropertyMatcher.the;
  16
+import static org.hamcrest.Matchers.is;
  17
+
  18
+@RunWith(ThucydidesRunner.class)
  19
+@Story(Application.Search.SearchForArtifactsByName.class)
  20
+public class WhenSearchingForArtifacts {
  21
+
  22
+    @Managed
  23
+    WebDriver driver;
  24
+
  25
+    @ManagedPages(defaultUrl = "http://search.maven.org")
  26
+    public Pages pages;
  27
+
  28
+    @Steps
  29
+    public DeveloperSteps developer;
  30
+
  31
+    @Test
  32
+    public void should_search_for_artifacts_by_name() {
  33
+        developer.opens_the_search_page();
  34
+        developer.searches_for("Thucydides");
  35
+        developer.should_see_artifacts_where(the("ArtifactId", is("thucydides")),
  36
+                                             the("GroupId", is("net.thucydides")));
  37
+
  38
+    }
  39
+}
41  ...es-showcase-simple-webtests/src/test/java/net/thucydides/showcase/simple/WhenViewingArtifactDetails.java
... ...
@@ -0,0 +1,41 @@
  1
+package net.thucydides.showcase.simple;
  2
+
  3
+import net.thucydides.core.annotations.Managed;
  4
+import net.thucydides.core.annotations.ManagedPages;
  5
+import net.thucydides.core.annotations.Steps;
  6
+import net.thucydides.core.annotations.Story;
  7
+import net.thucydides.core.pages.Pages;
  8
+import net.thucydides.junit.runners.ThucydidesRunner;
  9
+import net.thucydides.showcase.simple.requirements.Application;
  10
+import net.thucydides.showcase.simple.steps.DeveloperSteps;
  11
+import org.junit.Test;
  12
+import org.junit.runner.RunWith;
  13
+import org.openqa.selenium.WebDriver;
  14
+
  15
+import static net.thucydides.core.matchers.PropertyMatcher.the;
  16
+import static org.hamcrest.Matchers.is;
  17
+
  18
+@RunWith(ThucydidesRunner.class)
  19
+@Story(Application.DisplayArtifacts.ViewArtifactDetails.class)
  20
+public class WhenViewingArtifactDetails {
  21
+
  22
+    @Managed
  23
+    WebDriver driver;
  24
+
  25
+    @ManagedPages(defaultUrl = "http://search.maven.org")
  26
+    public Pages pages;
  27
+
  28
+    @Steps
  29
+    public DeveloperSteps developer;
  30
+
  31
+    @Test
  32
+    public void clicking_on_artifact_should_display_details_page() {
  33
+        developer.opens_the_search_page();
  34
+        developer.searches_for("Thucydides");
  35
+        developer.open_artifact_where(the("ArtifactId", is("thucydides")),
  36
+                                      the("GroupId", is("net.thucydides")));
  37
+
  38
+        developer.should_see_artifact_details_where(the("artifactId", is("thucydides")),
  39
+                                                    the("groupId", is("net.thucydides")));
  40
+    }
  41
+}
16  ...ides-showcase-simple-webtests/src/test/java/net/thucydides/showcase/simple/requirements/Application.java
... ...
@@ -0,0 +1,16 @@
  1
+package net.thucydides.showcase.simple.requirements;
  2
+
  3
+import net.thucydides.core.annotations.Feature;
  4
+
  5
+public class Application {
  6
+    @Feature
  7
+    public class Search {
  8
+        public class SearchForArtifactsByName {}
  9
+        public class AdvancedSearch {}
  10
+    }
  11
+
  12
+    @Feature
  13
+    public class DisplayArtifacts {
  14
+        public class ViewArtifactDetails {}
  15
+    }
  16
+}
62  thucydides-showcase-simple-webtests/src/test/java/net/thucydides/showcase/simple/steps/DeveloperSteps.java
... ...
@@ -0,0 +1,62 @@
  1
+package net.thucydides.showcase.simple.steps;
  2
+
  3
+import net.thucydides.core.annotations.Step;
  4
+import net.thucydides.core.matchers.PropertyMatcher;
  5
+import net.thucydides.core.pages.Pages;
  6
+import net.thucydides.core.steps.ScenarioSteps;
  7
+import net.thucydides.showcase.simple.pages.ArtifactDetailsPage;
  8
+import net.thucydides.showcase.simple.pages.SearchPage;
  9
+import net.thucydides.showcase.simple.pages.SearchResultsPage;
  10
+
  11
+import static net.thucydides.core.matchers.PropertyMatcher.shouldMatch;
  12
+
  13
+public class DeveloperSteps extends ScenarioSteps {
  14
+
  15
+    public DeveloperSteps(Pages pages) {
  16
+        super(pages);
  17
+    }
  18
+
  19
+    @Step
  20
+    public void opens_the_search_page() {
  21
+        onSearchPage().open();
  22
+    }
  23
+
  24
+    @Step
  25
+    public DeveloperSteps searches_for(String search_terms) {
  26
+        onSearchPage().enter_search_terms(search_terms);
  27
+        onSearchPage().starts_search();
  28
+        return this;
  29
+    }
  30
+
  31
+    @Step
  32
+    public void should_see_artifacts_where(PropertyMatcher... matchers) {
  33
+        shouldMatch(onSearchResultsPage().getSearchResults(), matchers);
  34
+    }
  35
+
  36
+    @Step
  37
+    public void should_see_error_message(String expectedMessage) {
  38
+        onSearchResultsPage().resultTable().shouldContainText(expectedMessage);
  39
+    }
  40
+
  41
+    @Step
  42
+    public void open_artifact_where(PropertyMatcher... matchers) {
  43
+        onSearchResultsPage().clickOnFirstRowMatching(matchers);
  44
+    }
  45
+
  46
+    @Step
  47
+    public void should_see_artifact_details_where(PropertyMatcher... matchers) {
  48
+        shouldMatch(onArtifactDetailsPage(), matchers);
  49
+    }
  50
+
  51
+    private SearchPage onSearchPage() {
  52
+        return getPages().get(SearchPage.class);
  53
+    }
  54
+
  55
+    private SearchResultsPage onSearchResultsPage() {
  56
+        return getPages().get(SearchResultsPage.class);
  57
+    }
  58
+
  59
+    private ArtifactDetailsPage onArtifactDetailsPage() {
  60
+        return getPages().get(ArtifactDetailsPage.class);
  61
+    }
  62
+}
37  ...-showcase-simple-webtests/src/test/stories/net/thucydides/showcase/simple/SearchForArtifactsByName.story
... ...
@@ -0,0 +1,37 @@
  1
+package net.thucydides.showcase.simple
  2
+
  3
+import net.thucydides.showcase.simple.requirements.Application.Search.SearchForArtifactsByName
  4
+import net.thucydides.showcase.simple.steps.DeveloperSteps
  5
+import static net.thucydides.core.matchers.PropertyMatcher.the
  6
+import static org.hamcrest.Matchers.is
  7
+
  8
+using "thucydides"
  9
+
  10
+thucydides.uses_default_base_url "http://search.maven.org"
  11
+thucydides.tests_story SearchForArtifactsByName
  12
+thucydides.uses_steps_from DeveloperSteps
  13
+
  14
+scenario "A developer looks for an existing Maven artifact by name and group id", {
  15
+    given "the developer is on the Maven Central search page", {
  16
+        developer.opens_the_search_page()
  17
+    }
  18
+    when "the user searches for artifacts with the name 'thucydides'", {
  19
+        developer.searches_for 'Thucydides'
  20
+    }
  21
+    then "the thucyidides core artifact should appear in the results list", {
  22
+        developer.should_see_artifacts_where( the("ArtifactId", is("thucydides")),
  23
+                                              the("GroupId", is("net.thucydides")))
  24
+    }
  25
+}
  26
+
  27
+scenario "A developer looks for an inexistant Maven artifact by name", {
  28
+    given "the developer is on the Maven Central search page", {
  29
+        developer.opens_the_search_page()
  30
+    }
  31
+    when "the user searches for artifacts with the name 'thucydides'", {
  32
+        developer.searches_for 'does-not-exist'
  33
+    }
  34
+    then "the thucyidides core artifact should appear in the results list", {
  35
+        developer.should_see_error_message "No records found"
  36
+    }
  37
+}
38  ...dides-showcase-simple-webtests/src/test/stories/net/thucydides/showcase/simple/ViewArtifactDetails.story
... ...
@@ -0,0 +1,38 @@
  1
+package net.thucydides.showcase.simple
  2
+
  3
+import net.thucydides.showcase.simple.requirements.Application.DisplayArtifacts
  4
+import net.thucydides.showcase.simple.steps.DeveloperSteps
  5
+import static net.thucydides.core.matchers.PropertyMatcher.the
  6
+import static org.hamcrest.Matchers.is
  7
+
  8
+using "thucydides"
  9
+
  10
+//thucydides.uses_default_base_url "http://search.maven.org"
  11
+thucydides.tests_story DisplayArtifacts.ViewArtifactDetails
  12
+thucydides.uses_steps_from DeveloperSteps
  13
+
  14
+scenario "A developer views the details of for an existing Maven artifact", {
  15
+    given "the developer is on the Maven Central search page", {
  16
+        developer.opens_the_search_page()
  17
+    }
  18
+    and "the user searches for artifacts with the name 'thucydides'", {
  19
+        developer.searches_for 'Thucydides'
  20
+
  21
+    }
  22
+    and "the user clicks on the first Thucydides artifact", {
  23
+        developer.open_artifact_where(the("ArtifactId", is("thucydides")),
  24
+                                      the("GroupId", is("net.thucydides")));
  25
+    }
  26
+    then "the site should display details about the Thucydides artifact", {
  27
+        developer.should_see_artifact_details_where(the("artifactId", is("thucydides")),
  28
+                                                    the("groupId", is("net.thucydides")));
  29
+
  30
+    }
  31
+}
  32
+
  33
+scenario "The developer views a sample pom.xml dependency for the artifact", {
  34
+    given "the developer is on the Maven Central search page"
  35
+    and "the user searches for artifacts with the name 'thucydides'"
  36
+    and "the user clicks on the first Thucydides artifact"
  37
+    then "the site should display a sample XML dependency for this artifact"
  38
+}

0 notes on commit 9b8b6c1

Please sign in to comment.
Something went wrong with that request. Please try again.