Skip to content

Commit

Permalink
4988-refactoringSelect3tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MayaElf committed Oct 20, 2023
1 parent d50930e commit 3ad2d56
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.epam.jdi.light.angular.elements.common.Checkbox;
import com.epam.jdi.light.angular.elements.complex.MaterialSelector;
import com.epam.jdi.light.angular.elements.complex.NativeSelector;
import com.epam.jdi.light.elements.pageobjects.annotations.locators.UI;
import com.epam.jdi.light.ui.html.elements.common.Text;

public class SelectPage extends NewAngularPage {
Expand Down Expand Up @@ -38,6 +39,7 @@ public class SelectPage extends NewAngularPage {

public static MaterialSelector noOptionRippleSelect;

@UI("#custom-panel-styling-select")
public static MaterialSelector customPanelStylingSelect;

public static MaterialSelector matErrorStateMatcherSelect;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,28 @@ public void before() {
basicNativeSelect.show();
}

@Test
@Test(description = "Test checks label value")
public void checkLabelValue() {
basicNativeSelect.label().has().value("Cars *");
basicNativeSelect.label().has().value("Cars");
}

@Test
@Test(description = "Test checks preselected value in the field")
public void checkPreselectedValue() {
basicNativeSelect.verify().selected(matchesPattern("[a-zA-Z]+"));
}

@Test
@Test(description = "Test checks option can be selected by name")
public void checkOptionCanBeSelectedByName() {
basicNativeSelect.select(SAAB);
basicNativeSelect.is().selected(SAAB);
}

@Test
public void checkListDisabledOptions() {
basicNativeSelect.has().listDisabled(Collections.EMPTY_LIST);
}

@Test
public void checkListEnabledOptions() {
basicNativeSelect.has().listEnabled(Arrays.asList(VOLVO, SAAB, MERCEDES, AUDI));
}

@Test
@Test(description = "Test checks available groups")
public void checkAvailableGroups() {
basicNativeSelect.is().groups(Collections.EMPTY_LIST);
}

@Test
@Test(description = "Test checks available options")
public void checkAvailableOptions() {
basicNativeSelect.assertThat().values(hasItem(AUDI)).values(hasItems(AUDI, VOLVO, SAAB, MERCEDES));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

import java.util.Arrays;

import static com.jdiai.tools.Timer.sleep;
import static com.jdiai.tools.Timer.waitCondition;
import static io.github.com.pages.SelectPage.customPanelStylingSelect;
import static org.hamcrest.Matchers.hasItems;

Expand Down Expand Up @@ -34,7 +36,7 @@ public void checkGreenOptionCanBeSelectedByName() {
}

@Test
public void checkBlueOptionCanBeSelectedByName() {
public void checkBlueOptionCanBeSelectedByName() throws InterruptedException {
customPanelStylingSelect.select(BLUE);
customPanelStylingSelect.is().selected(BLUE);
customPanelStylingSelect.has().color(0, 0, 255, 0.5);
Expand Down

0 comments on commit 3ad2d56

Please sign in to comment.