66import com .serenitydojo .playwright .todomvc .pageobjects .TodoMvcAppPage ;
77import io .qameta .allure .Feature ;
88import io .qameta .allure .Story ;
9- import org .assertj .core .api .Assertions ;
109import org .junit .jupiter .api .BeforeEach ;
1110import org .junit .jupiter .api .DisplayName ;
1211import org .junit .jupiter .api .Nested ;
1312import org .junit .jupiter .api .Test ;
14- import org .junit .jupiter .params .ParameterizedTest ;
15- import org .junit .jupiter .params .provider .CsvSource ;
16-
17- import static com .microsoft .playwright .assertions .PlaywrightAssertions .assertThat ;
1813
1914@ DisplayName ("Adding and deleting todo items to the list" )
2015@ Feature ("Adding and deleting todo items to the list" )
@@ -26,7 +21,6 @@ class AddingAndDeletingTodoItemsTest {
2621 @ BeforeEach
2722 void openApp (Page page ) {
2823 todoMvcApp = new TodoMvcAppPage (page );
29-
3024 todoMvcApp .open ();
3125 }
3226
@@ -37,16 +31,17 @@ class WhenTheApplicationStarts {
3731 @ DisplayName ("The list should be empty" )
3832 @ Test
3933 void the_list_should_initially_be_empty () {
40- Assertions .assertThat (todoMvcApp .todoItemsDisplayed ()).isEmpty ();
34+ // TODO: Implement me
35+ // 1) Verify that no items are displayed in the todo list
4136 }
4237
4338 @ DisplayName ("The user should be prompted to enter a todo item" )
4439 @ Test
4540 void the_user_should_be_prompted_to_enter_a_value () {
46- assertThat (todoMvcApp .todoField ()).isVisible ();
47- assertThat (todoMvcApp .todoField ()).hasAttribute ("placeholder" , "What needs to be done?" );
41+ // TODO: Implement me
42+ // 1) Verify that the input field is visible
43+ // 2) Verify that the placeholder text is "What needs to be done?"
4844 }
49-
5045 }
5146
5247 @ Story ("When we want to add item to the list" )
@@ -57,57 +52,42 @@ class WhenAddingItems {
5752 @ DisplayName ("We can add a single item" )
5853 @ Test
5954 void addingASingleItem () {
60- todoMvcApp .addTodoItem ("Feed the cat" );
61-
62- Assertions .assertThat (todoMvcApp .todoItemsDisplayed ()).containsExactly ("Feed the cat" );
63-
55+ // TODO: Implement me
56+ // 1) Add a single todo item "Feed the cat"
57+ // 2) Verify that the list contains exactly "Feed the cat"
6458 }
6559
6660 @ DisplayName ("We can add multiple items" )
6761 @ Test
6862 void addingSeveralItem () {
69- todoMvcApp .addTodoItem ("Feed the cat" );
70- todoMvcApp .addTodoItem ("Walk the dog" );
71-
72- Assertions .assertThat (todoMvcApp .todoItemsDisplayed ()).containsExactly ("Feed the cat" , "Walk the dog" );
63+ // TODO: Implement me
64+ // 1) Add multiple items "Feed the cat" and "Walk the dog"
65+ // 2) Verify that the list contains exactly "Feed the cat" and "Walk the dog"
7366 }
7467
75- @ DisplayName ("We can't add add an empty item" )
68+ @ DisplayName ("We can't add an empty item" )
7669 @ Test
7770 void addingAnEmptyItem () {
78- todoMvcApp .addTodoItem ("Feed the cat" );
79- todoMvcApp .addTodoItem ("" );
80-
81- Assertions .assertThat (todoMvcApp .todoItemsDisplayed ()).containsExactly ("Feed the cat" );
82-
71+ // TODO: Implement me
72+ // 1) Add a valid item "Feed the cat"
73+ // 2) Attempt to add an empty item
74+ // 3) Verify that the list contains only "Feed the cat"
8375 }
8476
8577 @ DisplayName ("We can add duplicate items" )
8678 @ Test
8779 void addingDuplicateItem () {
88- todoMvcApp .addTodoItem ("Feed the cat" );
89- todoMvcApp .addTodoItem ("Walk the dog" );
90- todoMvcApp .addTodoItem ("Feed the cat" );
91-
92- Assertions .assertThat (todoMvcApp .todoItemsDisplayed ()).containsExactly ("Feed the cat" , "Walk the dog" ,"Feed the cat" );
80+ // TODO: Implement me
81+ // 1) Add items "Feed the cat", "Walk the dog", and "Feed the cat" again
82+ // 2) Verify that the list contains duplicates in the order they were added
9383 }
9484
9585 @ DisplayName ("We can add items with non-English characters" )
96- @ ParameterizedTest
97- @ CsvSource ({
98- "Feed the cat" , // English
99- "Alimentar al gato" , // Spanish
100- "להאכיל את החתול" , // Hebrew
101- "ให้อาหารแมว" , // Thai
102- "喂猫" , // Chinese
103- "إطعام القط" , // Arabic
104- "кормить кошку" , // Russian
105- "猫に餌をやる" , // Japanese
106- "고양이 먹이기" // Korean
107- })
108- void addingNonEnglishItems (String item ) {
109- todoMvcApp .addTodoItem (item );
110- Assertions .assertThat (todoMvcApp .todoItemsDisplayed ()).containsExactly (item );
86+ @ Test
87+ void addingNonEnglishItems () {
88+ // TODO: Implement me
89+ // 1) Add items in various languages (e.g., "Feed the cat", "喂猫", "إطعام القط")
90+ // 2) Verify that each item appears in the list as added
11191 }
11292 }
11393
@@ -119,39 +99,28 @@ class WhenDeletingItems {
11999 @ DisplayName ("We can delete an item in the middle of the list" )
120100 @ Test
121101 void deletingAnItemInTheMiddleOfTheList () {
122- todoMvcApp .addTodoItems ("Feed the cat" , "Walk the dog" , "Buy some milk" );
123-
124- todoMvcApp .deleteItem ("Walk the dog" );
125-
126- Assertions .assertThat (todoMvcApp .todoItemsDisplayed ()).containsExactly ("Feed the cat" , "Buy some milk" );
127-
102+ // TODO: Implement me
103+ // 1) Add items "Feed the cat", "Walk the dog", "Buy some milk"
104+ // 2) Delete "Walk the dog"
105+ // 3) Verify that the list contains "Feed the cat" and "Buy some milk"
128106 }
129107
130-
131108 @ DisplayName ("We can delete an item at the end of the list" )
132109 @ Test
133110 void deletingAnItemAtTheEndOfTheList () {
134- todoMvcApp .addTodoItems ("Feed the cat" , "Walk the dog" , "Buy some milk" );
135-
136- todoMvcApp .deleteItem ("Buy some milk" );
137-
138- Assertions .assertThat (todoMvcApp .todoItemsDisplayed ()).containsExactly ("Feed the cat" , "Walk the dog" );
139-
111+ // TODO: Implement me
112+ // 1) Add items "Feed the cat", "Walk the dog", "Buy some milk"
113+ // 2) Delete "Buy some milk"
114+ // 3) Verify that the list contains "Feed the cat" and "Walk the dog"
140115 }
141116
142-
143-
144117 @ DisplayName ("We can delete an item at the start of the list" )
145118 @ Test
146119 void deletingAnItemAtTheStartOfTheList () {
147- todoMvcApp .addTodoItems ("Feed the cat" , "Walk the dog" , "Buy some milk" );
148-
149- todoMvcApp .deleteItem ("Feed the cat" );
150-
151- Assertions .assertThat (todoMvcApp .todoItemsDisplayed ()).containsExactly ("Walk the dog" , "Buy some milk" );
152-
120+ // TODO: Implement me
121+ // 1) Add items "Feed the cat", "Walk the dog", "Buy some milk"
122+ // 2) Delete "Feed the cat"
123+ // 3) Verify that the list contains "Walk the dog" and "Buy some milk"
153124 }
154-
155125 }
156-
157126}
0 commit comments