Skip to content

Commit

Permalink
Updated to Serenity 4.1.14 including Gradle updates
Browse files Browse the repository at this point in the history
  • Loading branch information
wakaleo committed May 23, 2024
1 parent 17254c1 commit a3238a4
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 74 deletions.
16 changes: 8 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
}
}
dependencies {
classpath "net.serenity-bdd:serenity-gradle-plugin:4.0.30"
classpath "net.serenity-bdd:serenity-gradle-plugin:4.1.14"
}
}

Expand All @@ -26,13 +26,13 @@ sourceCompatibility = 17
targetCompatibility = 17

ext {
SERENITY_VERSION = '4.0.30'
JUNIT_PLATFORM_VERSION = '1.10.1'
SERENITY_VERSION = '4.1.14'
JUNIT_PLATFORM_VERSION = '1.10.2'
CUCUMBER_JUNIT_PLATFORM_VERSION = '7.14.0'
JUNIT_JUPITER_VERSION = '5.10.1'
JUNIT_VINTAGE_VERSION = '5.10.1'
JUNIT_JUPITER_VERSION = '5.10.2'
JUNIT_VINTAGE_VERSION = '5.10.2'
LOGBACK_CLASSIC_VERSION = '1.2.10'
ASSERTJ_CORE_VERSION = '3.22.0'
ASSERTJ_CORE_VERSION = '3.25.3'
}

dependencies {
Expand All @@ -43,14 +43,14 @@ dependencies {
implementation "net.serenity-bdd:serenity-screenplay-webdriver:${SERENITY_VERSION}"
implementation "net.serenity-bdd:serenity-ensure:${SERENITY_VERSION}"
implementation "net.serenity-bdd:serenity-cucumber:${SERENITY_VERSION}"
implementation "ch.qos.logback:logback-classic:${LOGBACK_CLASSIC_VERSION}"
implementation "org.assertj:assertj-core:${ASSERTJ_CORE_VERSION}"
testImplementation "org.junit.platform:junit-platform-launcher:${JUNIT_PLATFORM_VERSION}"
testImplementation "io.cucumber:cucumber-junit-platform-engine:${CUCUMBER_JUNIT_PLATFORM_VERSION}"
testImplementation "org.junit.platform:junit-platform-suite:${JUNIT_PLATFORM_VERSION}"
testImplementation "org.junit.jupiter:junit-jupiter-engine:${JUNIT_JUPITER_VERSION}"
testImplementation "org.junit.vintage:junit-vintage-engine:${JUNIT_VINTAGE_VERSION}"
testImplementation "net.serenity-bdd:serenity-saucelabs:${SERENITY_VERSION}"
implementation "ch.qos.logback:logback-classic:${LOGBACK_CLASSIC_VERSION}"
testImplementation "org.assertj:assertj-core:${ASSERTJ_CORE_VERSION}"
}

test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,4 @@ public void sheFiltersTheListToShowOnlyFilterTasks(String status) {
public void herListShouldContain(List<String> items) {
james.should_see_that_displayed_items_contain(items.toArray(new String[]{}));
}

@Given("Pete wants to change his password")
public void peteWantsToChangeHisPassword() {
}

@When("he enters {string} as his new password")
public void heEntersAsHisNewPassword(String arg0) {
}

@Then("his password should be updated")
public void hisPasswordShouldBeUpdated() {
}

@Then("his password should be updated:{}")
public void hisPasswordShouldBeUpdatedUpdated(boolean yes) {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import net.serenitybdd.screenplay.waits.Wait;

import java.util.List;
import java.util.stream.Collectors;

import static java.util.Collections.EMPTY_LIST;
import static net.serenitybdd.demos.todos.screenplay.model.TodoStatus.Completed;
Expand Down Expand Up @@ -82,7 +83,9 @@ public void that_James_has_an_empty_todo_list(Actor actor) {

@Given("{actor} has a todo list containing {items}")
public void that_James_has_an_empty_todo_list(Actor actor, List<String> items) {
Serenity.setSessionVariable("todoItems").to(items);

actor.remember("todoItems", items);

actor.wasAbleTo(Start.withATodoListContaining(items));
}

Expand Down Expand Up @@ -129,8 +132,9 @@ public void item_should_be_recorded_in_the_list(String expectedItem) {

@Then("his/her todo list should contain {items}")
public void todo_list_should_contain(List<String> expectedItems) {
List<String> originalItems = Serenity.sessionVariableCalled("todoItems");
assertThat(originalItems).isNotEmpty();

List<String> todoItems = theActorInTheSpotlight().recall("todoItems");
assertThat(todoItems).isNotEmpty();

theActorInTheSpotlight().should(seeThat(TheItems.displayed(), equalTo(expectedItems))
.orComplainWith(MissingTodoItemsException.class, "Missing todos " + expectedItems));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,48 +13,29 @@ Feature: Completing todos
Then her todo list should contain Buy some milk, Walk the dog
But the "Walk the dog" task should be shown as Completed

Given Pete wants to change his password
When he enters "Password1!" as his new password
Then his password should be updated

@manual
Scenario Outline: Updating a password
Given Pete wants to change his password
When he enters "<password>" as his new password
Then his password should be updated:<updated?>
Examples:
| password | updated? |
| Password1! | true |
| Password1 | false |
| Password! | false |
| Passwor | false |


@ios
Scenario: Completed tasks should appear in the Completed list
Given Jane has a todo list containing Buy some milk, Walk the dog
When she completes the task called "Walk the dog"
And she filters her list to show only Completed tasks
Given James has a todo list containing Buy some milk, Walk the dog
When he completes the task called "Walk the dog"
And he filters her list to show only Completed tasks
Then her todo list should contain Walk the dog

Scenario Outline: Completed tasks should be shown as Completed
Given Jane has a todo list containing <Initial Tasks>
Given Sarah has a todo list containing <Initial Tasks>
When she completes the task called "Walk the dog"
Then the "<Task>" task should be shown as <Final Status>
Examples:
| Initial Tasks | Task | Final Status |
# | | Walk the dog | Completed |
| Buy some milk, Walk the dog | Walk the dog | Completed |
| Walk the dog | Walk the dog | Completed |
| Buy some milk, Walk the dog | Buy some milk | Active |

Scenario: The list of completed items should be empty if nothing has been completed
Given Jane has a todo list containing Buy some milk, Walk the dog
Given Jill has a todo list containing Buy some milk, Walk the dog
When she filters her list to show only Completed tasks
Then her todo list should be empty

Scenario: The todo count should keep track of how many todos remain
Given Jane has a todo list containing Buy some milk, Walk the dog
Given Sophie has a todo list containing Buy some milk, Walk the dog
Then her remaining todo count should be 2
When she completes the task called "Walk the dog"
Then her remaining todo count should be 1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Feature: Deleting todos
When she deletes the task called 'Walk the dog'
Then her todo list should contain Buy some milk

@manual
Scenario: Delete all the items
Given Jane has a todo list containing Buy some milk, Walk the dog
When she deletes the task called 'Walk the dog'
Expand Down

This file was deleted.

0 comments on commit a3238a4

Please sign in to comment.