Skip to content

Commit

Permalink
4953+4965: Angular input implementing and refactoring tests (#5058)
Browse files Browse the repository at this point in the history
* add new classes

* add methods and tests

* add unit tests and refactor page object + tests

* refactor code

* 4953-65-refactoringInputAfterRebase

* 4953 Added methods and tests for Input and TextArea

* 4953 Added methods and tests for scrolling text area

* 4953 edited locator

---------

Co-authored-by: Maya Afanaseva <afanasevaml@yandex.ru>
Co-authored-by: Kira Vlasova <vlsv-kira@ya.ru>
  • Loading branch information
3 people authored Dec 21, 2023
1 parent 835bfbc commit 786e1c9
Show file tree
Hide file tree
Showing 12 changed files with 578 additions and 143 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import io.github.com.pages.AngularPage;
import io.github.com.pages.AutocompletePage;
import io.github.com.pages.BadgePage;
import io.github.com.pages.InputPage;
import io.github.com.pages.ButtonTogglePage;
import io.github.com.pages.ButtonsPage;
import io.github.com.pages.CheckBoxPage;
Expand All @@ -25,6 +26,9 @@ public class StaticSite {
@Url("progress_spinner")
public static ProgressSpinnerPage progressSpinnerPage;

@Url("input")
public static InputPage inputPage;

@Url("buttons")
public static ButtonsPage buttonsPage;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
package io.github.com.pages.sections;
package io.github.com.entities;

import com.epam.jdi.light.angular.elements.common.Input;
import com.epam.jdi.light.angular.elements.common.TextArea;
import com.epam.jdi.light.elements.composite.Form;
import com.epam.jdi.light.elements.pageobjects.annotations.locators.UI;
import com.epam.jdi.light.ui.html.elements.common.TextField;
import io.github.com.entities.User;

public class InputsForm extends Form<User> {

@UI("[id^='mat-input-']")
public Input company;

@UI("#inputs_form_firstName")
public TextField firstName;
public Input firstName;

@UI("#inputs_form_lastName")
public TextField lastName;
public Input lastName;

@UI("#inputs_form_address")
public TextField address;
public TextArea address;

@UI("#inputs_form_address2")
public TextField address2;
public TextArea address2;

@UI("#inputs_form_city")
public TextField city;
public Input city;

@UI("#inputs_form_state")
public TextField state;
public Input state;

@UI("#inputs_form_postalCode")
public TextField postalCode;
public Input postalCode;
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public class AngularPage extends WebPage {
public static Dialog dialog;
public static ToolbarSection toolbarSection;
public static SlideToggleSection slideToggleSection;
public static InputSection inputSection;
public static SelectSection selectSection;
public static ListSection listSection;
public static GridListSection gridListSection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class CheckBoxPage extends NewAngularPage {
@UI("#checkbox-required-option")
public static Checkbox requiredCheckbox;

@UI("//*[@class='error']")
@UI("//*[contains(@class, 'error')]")
public static Text requiredCheckboxText;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package io.github.com.pages;

import com.epam.jdi.light.angular.elements.common.Input;
import com.epam.jdi.light.angular.elements.common.TextArea;
import com.epam.jdi.light.elements.pageobjects.annotations.locators.UI;
import com.epam.jdi.light.ui.html.elements.common.Button;
import com.epam.jdi.light.ui.html.elements.common.Icon;
import com.epam.jdi.light.ui.html.elements.common.Text;
import io.github.com.entities.InputsForm;

public class InputPage extends NewAngularPage {

@UI("#inputs_basic_food")
public static Input inputBasicFood;

@UI("#inputs_basic_comment")
public static TextArea textAreaBasicLeaveAComment;

@UI("#inputs_errorStateMatcher_email")
public static Input inputEmailErrorStateMatcher;

@UI("#inputs_errorStateMatcher_message")
public static Text messageErrorStateMatcher;

@UI("#inputs_autosize_textarea")
public static TextArea textAreaAutoSize;

@UI("#inputs_clearable_textbox")
public static Input inputWithClearButton;

@UI("#inputs_clearable_button")
public static Button buttonClear;

@UI("#inputs_error_email")
public static Input inputErrorMail;

@UI("#inputs_error_message")
public static Text messageError;

@UI("input-form-example form")
public static InputsForm inputsForm;

@UI("#inputs_hints_message")
public static Input inputWithMessageHint;

@UI("#inputs_hints_text")
public static Text messageHint;

@UI("#inputs_hints_counter")
public static Text messageHintCounter;

@UI("#inputs_prefixes")
public static Text prefixForInput;

@UI("#inputs_suffixes")
public static Icon suffixForInput;

@UI("#inputs_prefixes_suffixes_phone")
public static Input inputTelephone;

@UI("#input-readonly-option")
public static Input inputWithReadonly;

@UI("[id^='mat-input-'][type='text']")
public static Input inputAriaLabel;
}

This file was deleted.

Loading

0 comments on commit 786e1c9

Please sign in to comment.