Resolves checkstyle errors for remaining p (#1091)
* Reduces checkstyle errors in page-object * Reduces checkstyle errors in partial-response * Reduces checkstyle errors in pipeline * Reduces checkstyle errors in poison-pill * Reduces checkstyle errors in priority-queue * Reduces checkstyle errors in private-class-data * Reduces checkstyle errors in property * Reduces checkstyle errors in prototype * Reduces checkstyle errors in proxy
This commit is contained in:
committed by
Ilkka Seppälä
parent
1fdc650545
commit
271d7ae9bd
@ -26,10 +26,8 @@ package com.iluwatar.pageobject;
|
||||
import com.gargoylesoftware.htmlunit.WebClient;
|
||||
import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
|
||||
import com.gargoylesoftware.htmlunit.html.HtmlPage;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -46,7 +44,7 @@ public class AlbumListPage extends Page {
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Constructor.
|
||||
*/
|
||||
public AlbumListPage(WebClient webClient) {
|
||||
super(webClient);
|
||||
@ -54,7 +52,7 @@ public class AlbumListPage extends Page {
|
||||
|
||||
|
||||
/**
|
||||
* Navigates to the Album List Page
|
||||
* Navigates to the Album List Page.
|
||||
*
|
||||
* @return {@link AlbumListPage}
|
||||
*/
|
||||
@ -76,7 +74,7 @@ public class AlbumListPage extends Page {
|
||||
}
|
||||
|
||||
/**
|
||||
* Selects an album by the given album title
|
||||
* Selects an album by the given album title.
|
||||
*
|
||||
* @param albumTitle the title of the album to click
|
||||
* @return the album page
|
||||
|
@ -23,11 +23,6 @@
|
||||
|
||||
package com.iluwatar.pageobject;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.gargoylesoftware.htmlunit.WebClient;
|
||||
import com.gargoylesoftware.htmlunit.html.HtmlNumberInput;
|
||||
import com.gargoylesoftware.htmlunit.html.HtmlOption;
|
||||
@ -35,6 +30,9 @@ import com.gargoylesoftware.htmlunit.html.HtmlPage;
|
||||
import com.gargoylesoftware.htmlunit.html.HtmlSelect;
|
||||
import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
|
||||
import com.gargoylesoftware.htmlunit.html.HtmlTextInput;
|
||||
import java.io.IOException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Page Object encapsulating the Album Page (album-page.html)
|
||||
@ -49,7 +47,7 @@ public class AlbumPage extends Page {
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Constructor.
|
||||
*/
|
||||
public AlbumPage(WebClient webClient) {
|
||||
super(webClient);
|
||||
@ -57,7 +55,7 @@ public class AlbumPage extends Page {
|
||||
|
||||
|
||||
/**
|
||||
* Navigates to the album page
|
||||
* Navigates to the album page.
|
||||
*
|
||||
* @return {@link AlbumPage}
|
||||
*/
|
||||
@ -81,7 +79,7 @@ public class AlbumPage extends Page {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the album title input text field
|
||||
* Sets the album title input text field.
|
||||
*
|
||||
* @param albumTitle the new album title value to set
|
||||
* @return {@link AlbumPage}
|
||||
@ -94,7 +92,7 @@ public class AlbumPage extends Page {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the artist input text field
|
||||
* Sets the artist input text field.
|
||||
*
|
||||
* @param artist the new artist value to set
|
||||
* @return {@link AlbumPage}
|
||||
@ -107,7 +105,7 @@ public class AlbumPage extends Page {
|
||||
|
||||
|
||||
/**
|
||||
* Selects the select's option value based on the year value given
|
||||
* Selects the select's option value based on the year value given.
|
||||
*
|
||||
* @param year the new year value to set
|
||||
* @return {@link AlbumPage}
|
||||
@ -121,7 +119,7 @@ public class AlbumPage extends Page {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the album rating input text field
|
||||
* Sets the album rating input text field.
|
||||
*
|
||||
* @param albumRating the new album rating value to set
|
||||
* @return {@link AlbumPage}
|
||||
@ -133,20 +131,21 @@ public class AlbumPage extends Page {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the number of songs number input field
|
||||
* Sets the number of songs number input field.
|
||||
*
|
||||
* @param numberOfSongs the new number of songs value to be set
|
||||
* @return {@link AlbumPage}
|
||||
*/
|
||||
public AlbumPage changeNumberOfSongs(int numberOfSongs) {
|
||||
HtmlNumberInput numberOfSongsNumberField = (HtmlNumberInput) page.getElementById("numberOfSongs");
|
||||
HtmlNumberInput numberOfSongsNumberField =
|
||||
(HtmlNumberInput) page.getElementById("numberOfSongs");
|
||||
numberOfSongsNumberField.setText(Integer.toString(numberOfSongs));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Cancel changes made by clicking the cancel button
|
||||
* Cancel changes made by clicking the cancel button.
|
||||
*
|
||||
* @return {@link AlbumListPage}
|
||||
*/
|
||||
@ -162,7 +161,7 @@ public class AlbumPage extends Page {
|
||||
|
||||
|
||||
/**
|
||||
* Saves changes made by clicking the save button
|
||||
* Saves changes made by clicking the save button.
|
||||
*
|
||||
* @return {@link AlbumPage}
|
||||
*/
|
||||
|
@ -29,7 +29,6 @@ import com.gargoylesoftware.htmlunit.html.HtmlPasswordInput;
|
||||
import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
|
||||
import com.gargoylesoftware.htmlunit.html.HtmlTextInput;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -45,7 +44,7 @@ public class LoginPage extends Page {
|
||||
private HtmlPage page;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Constructor.
|
||||
*
|
||||
* @param webClient {@link WebClient}
|
||||
*/
|
||||
@ -54,7 +53,7 @@ public class LoginPage extends Page {
|
||||
}
|
||||
|
||||
/**
|
||||
* Navigates to the Login page
|
||||
* Navigates to the Login page.
|
||||
*
|
||||
* @return {@link LoginPage}
|
||||
*/
|
||||
@ -77,7 +76,7 @@ public class LoginPage extends Page {
|
||||
|
||||
|
||||
/**
|
||||
* Enters the username into the username input text field
|
||||
* Enters the username into the username input text field.
|
||||
*
|
||||
* @param username the username to enter
|
||||
* @return {@link LoginPage}
|
||||
@ -90,23 +89,24 @@ public class LoginPage extends Page {
|
||||
|
||||
|
||||
/**
|
||||
* Enters the password into the password input password field
|
||||
* Enters the password into the password input password field.
|
||||
*
|
||||
* @param password the password to enter
|
||||
* @return {@link LoginPage}
|
||||
*/
|
||||
public LoginPage enterPassword(String password) {
|
||||
HtmlPasswordInput passwordInputPasswordField = (HtmlPasswordInput) page.getElementById("password");
|
||||
HtmlPasswordInput passwordInputPasswordField =
|
||||
(HtmlPasswordInput) page.getElementById("password");
|
||||
passwordInputPasswordField.setText(password);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clicking on the login button to 'login'
|
||||
* Clicking on the login button to 'login'.
|
||||
*
|
||||
* @return {@link AlbumListPage}
|
||||
* - this is the page that user gets navigated to once successfully logged in
|
||||
* @return {@link AlbumListPage} - this is the page that user gets navigated to once successfully
|
||||
* logged in
|
||||
*/
|
||||
public AlbumListPage login() {
|
||||
HtmlSubmitInput loginButton = (HtmlSubmitInput) page.getElementById("loginButton");
|
||||
|
@ -26,20 +26,19 @@ package com.iluwatar.pageobject;
|
||||
import com.gargoylesoftware.htmlunit.WebClient;
|
||||
|
||||
/**
|
||||
* Encapsulation for a generic 'Page'
|
||||
* Encapsulation for a generic 'Page'.
|
||||
*/
|
||||
public abstract class Page {
|
||||
|
||||
/**
|
||||
* Application Under Test path
|
||||
* This directory location is where html web pages are located
|
||||
* Application Under Test path This directory location is where html web pages are located.
|
||||
*/
|
||||
public static final String AUT_PATH = "../sample-application/src/main/resources/sample-ui/";
|
||||
|
||||
protected final WebClient webClient;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Constructor.
|
||||
*
|
||||
* @param webClient {@link WebClient}
|
||||
*/
|
||||
@ -48,7 +47,7 @@ public abstract class Page {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the current page is actually the page this page object represents
|
||||
* Checks that the current page is actually the page this page object represents.
|
||||
*
|
||||
* @return true if so, otherwise false
|
||||
*/
|
||||
|
Reference in New Issue
Block a user