@@ -96,7 +96,7 @@ These annotations can be used within a `Page`.
9696- [ @IdentifyUsing ] ( annotation-identify-using.md )
9797- [ @Named ] ( annotation-named.md )
9898- [ @PostConstruct ] ( annotation-post-construct.md )
99- - [ @PostConstructMustBe ] ( chapters/ annotation-post-construct-must-be.md)
99+ - [ @PostConstructMustBe ] ( annotation-post-construct-must-be.md )
100100- [ @WaitUntil ] ( annotation-wait-until.md )
101101
102102# Anatomy of a Page
@@ -118,12 +118,12 @@ Rules:
118118- Method does not change multiple states.
119119
120120``` java
121- public LoginPage setFirstName(String name){
121+ default LoginPage setFirstName(String name){
122122 firstName. setText(name);
123123 return this ;
124124}
125125
126- public LoginPage selectBirthMonth(String month){
126+ default LoginPage selectBirthMonth(String month){
127127 birthMonth. selectByText(month);
128128 return this ;
129129}
@@ -142,12 +142,12 @@ Rules:
142142- Method does not change multiple states.
143143
144144``` java
145- public MainPage clickLogin(){
145+ default MainPage clickLogin(){
146146 login. click();
147147 return create(MainPage . class);
148148}
149149
150- public LoginPage clickLoginExpectingError(){
150+ default LoginPage clickLoginExpectingError(){
151151 login. click();
152152 return create(LoginPage . class);
153153}
@@ -164,13 +164,13 @@ Rules:
164164- Method does change multiple states.
165165
166166``` java
167- public MainPage login(User user){
167+ default MainPage login(User user){
168168 return setUsername(user. getUsername())
169169 .setPassword(user. getPassword())
170170 .clickLogin();
171171}
172172
173- public LoginPage loginExpectingError(User user){
173+ default LoginPage loginExpectingError(User user){
174174 return setUsername(user. getUsername())
175175 .setPassword(user. getPassword())
176176 .clickLoginExpectingError();
@@ -188,11 +188,11 @@ Rules:
188188- Method does not change any states.
189189
190190``` java
191- public String getErrorMessage () {
191+ default String getErrorMessage () {
192192 return errorMessage. getText();
193193}
194194
195- public int getNumberOfSearchResults () {
195+ default int getNumberOfSearchResults () {
196196 int counter = 0 ;
197197 // some logic
198198 return counter;
0 commit comments