Skip to content

Commit

Permalink
Updated smoke tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wakaleo committed Dec 6, 2018
1 parent ef2ada9 commit 63750cc
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions serenity-smoketests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<serenity.version>1.2.3-</serenity.version>
<serenity.maven.version>1.2.2</serenity.maven.version>
<serenity.version>2.0.21-SNAPSHOT</serenity.version>
<serenity.maven.version>2.0.20</serenity.maven.version>
<parallel.tests>4</parallel.tests>
<browserstack.url></browserstack.url>
<browserstack.os></browserstack.os>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@DefaultUrl("http://todomvc.com/examples/angularjs/#/")
public class ApplicationHomePage extends PageObject {
public void waitForTheApplicationToLoad() {
withTimeoutOf(60, TimeUnit.SECONDS).waitFor("#new-todo");
withTimeoutOf(60, TimeUnit.SECONDS).waitFor(".new-todo");
}

public void openApplication() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class TodoPage extends PageObject {
public static final String COMPLETE_TICKBOX = ".//input[@ng-model='todo.completed']";

public void addAnActionCalled(String actionName) {
$("#new-todo").type(actionName)
$(".new-todo").type(actionName)
.then().sendKeys(Keys.ENTER);
}

Expand Down Expand Up @@ -68,6 +68,6 @@ public void updateAction(String currentActionName, String newActionName) {
}

public void clearCompletedActions() {
$("#clear-completed").click();
$(".clear-completed").click();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import net.serenitybdd.screenplay.targets.Target;

public class FilterBar {
public static final Target CLEAR_COMPLETED = Target.the("Clear completed button").locatedBy("#clear-completed");
public static final Target CLEAR_COMPLETED = Target.the("Clear completed button").locatedBy(".clear-completed");

public static Target filterCalled(String name) {
String FILTER_BUTTON = "//a[.='%s']";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import net.serenitybdd.screenplay.targets.Target;

public class ToDoList {
public static Target NEW_TODO_FIELD = Target.the("New Todo Field").locatedBy("#new-todo");
public static Target NEW_TODO_FIELD = Target.the("New Todo Field").locatedBy(".new-todo");
public static String TODO_ITEMS = ".view label";

public static Target deleteButtonForItem(String itemName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.serenitybdd.screenplay.Performable;
import net.serenitybdd.screenplay.actions.Open;
import net.thucydides.core.annotations.Step;
import static java.util.Arrays.asList;

import java.util.List;

Expand All @@ -26,7 +27,7 @@ public AddItems called(List<String> thingsToDo) {
}

public AddItems called(String... thingsToDo) {
return called(new ArrayList<>(thingsToDo));
return called(asList(thingsToDo));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ public void should_be_able_to_clear_completed_actions_from_the_todo_list() {
@Ignore
public void shouldBeAbleToIgnoreStuff() {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import net.serenitybdd.demos.todos.pages.ApplicationHomePage;
import net.serenitybdd.demos.todos.pages.TodoPage;
import net.thucydides.core.annotations.Step;
import static java.util.Arrays.asList;


import static org.assertj.core.api.Assertions.assertThat;

Expand All @@ -24,7 +26,7 @@ public void adds_an_action_called(String actionName) {

@Step("Joe completed **many** tasks")
public void has_added_actions_called(String... actionNames) {
newArrayList(actionNames).forEach(
asList(actionNames).forEach(
action -> adds_an_action_called(action)
);
}
Expand Down

0 comments on commit 63750cc

Please sign in to comment.