Closed jacobvn84 closed 1 year ago
Tham khảo tại đây
Câu hỏi: Làm sao để đếm được có bao nhiêu options trong listbox
Cách 01:
List days = jacob.asksFor( SelectOptions.of(By.name("DateOfBirthDay")) .describedAs("the number of days in month") );
jacob.attemptsTo( Ensure.that(days).hasSize(32) );
Cách 02:
int daysOfMonth = SelectOptions.of(By.name("DateOfBirthDay")).answeredBy(jacob).size(); jacob.attemptsTo( Ensure.that(daysOfMonth).isGreaterThan(30) );
Cách 03:
Lưu giá trị vào một key thông actor.remember:
jacob.remember("Total Days", SelectOptions.of(By.name("DateOfBirthDay")).describedAs("the days in month"));
Gọi và sử dụng bằng actor.recall
int totalDays= jacob.recall("Total Days"); assertThat(totalDays).hasSize(32);
Tham khảo tại đây
Câu hỏi: Làm sao để đếm được có bao nhiêu options trong listbox
Cách 01:
List days = jacob.asksFor(
SelectOptions.of(By.name("DateOfBirthDay"))
.describedAs("the number of days in month")
);
Cách 02:
Cách 03:
Lưu giá trị vào một key thông actor.remember:
Gọi và sử dụng bằng actor.recall