Skip to content

Commit

Permalink
5017 progress bar tests refactoring (#5022)
Browse files Browse the repository at this point in the history
* 5017-progressBarTestsRefactoring

* 5017-progressBarTestsRefactoringFixedLocator

* 5017-progressBarTestsRefactoringFixCheckStyle

* 5017-progressBarTestsRefactoringFixAssert

* 5017-progressBarTestsRefactoringFixAssert2

* 5017-progressBarTestsRefactoringFixMethodSlide

* 5017-progressBarTestsRefactoringFixMethodSlide2

* 5017-progressBarTestsRefactoringFixMethodSlide2

* 5017-progressBarTestsRefactoringDeleteTransformTests

* 5017-progressBarTestsRefactoringDeleteCodacy

* 5017-progressBarTestsGeneralXmlFix

* 5017-progressBarTestsSliderChangesRollBack

---------

Co-authored-by: Maiia_Afanaseva <[email protected]>
  • Loading branch information
MayaElf and Maiia_Afanaseva authored Jul 24, 2023
1 parent 50b9d5d commit 3c8babe
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import static io.github.com.pages.ProgressBarPage.matProgressBarIndeterminate;
import static io.github.com.pages.ProgressBarPage.matProgressBarQuery;
import static io.github.com.pages.ProgressBarPage.modeRadioButtons;
import static io.github.com.pages.ProgressBarPage.progressBarsBufferSlider;
import static io.github.com.pages.ProgressBarPage.progressBarsProgressSlider;
import static io.github.com.pages.ProgressBarPage.progressBarsQueryModeRadio;
import static io.github.com.pages.ProgressBarPage.showBufferProgressBarButton;
import static io.github.com.pages.ProgressBarPage.showIndeterminateProgressBarButton;
Expand Down Expand Up @@ -148,52 +146,4 @@ public void verifyConfiguredProgressBarModeTransformationsTest() {
matProgressBarConfigurable.has().bufferValue(75);
}

@Test(description = "Test checks progress bar's mode values transformation",
enabled = false)
public void verifyDeterminateModeValuesTransformation() {
matProgressBarConfigurable.has().value(50);
matProgressBarConfigurable.has().max(100);
matProgressBarConfigurable.has().min(0);
progressBarsProgressSlider.moveRight();
matProgressBarConfigurable.has().value(51);
while (!matProgressBarConfigurable.getValue().equals("100")) {
progressBarsProgressSlider.moveRight();
}
matProgressBarConfigurable.has().value(100);
while (!matProgressBarConfigurable.getValue().equals("0")) {
progressBarsProgressSlider.moveLeft();
}
matProgressBarConfigurable.has().value(0);
while (!matProgressBarConfigurable.getValue().equals("50")) {
progressBarsProgressSlider.moveRight();
}
}

@Test(description = "Test checks progress bar's buffer mode transformation",
enabled = false)
public void verifyBufferModeValuesTransformation() {
modeRadioButtons.click(BUFFER.getMode());
matProgressBarConfigurable.has().value(50);
matProgressBarConfigurable.has().bufferValue(75);
matProgressBarConfigurable.has().max(100);
matProgressBarConfigurable.has().min(0);
progressBarsProgressSlider.moveRight();
matProgressBarConfigurable.has().value(51);
while (!matProgressBarConfigurable.getValue().equals("25")) {
progressBarsProgressSlider.moveLeft();
}
matProgressBarConfigurable.has().value(25);
while (matProgressBarConfigurable.bufferValue() != 95) {
progressBarsBufferSlider.moveRight();
}
matProgressBarConfigurable.has().bufferValue(95);
while (matProgressBarConfigurable.bufferValue() != 75) {
progressBarsBufferSlider.moveLeft();
}
matProgressBarConfigurable.has().bufferValue(75);
while (!matProgressBarConfigurable.getValue().equals("50")) {
progressBarsProgressSlider.moveRight();
}
matProgressBarConfigurable.has().value(50);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void before() {
progressBarPage.checkOpened();
}

@Test
@Test(description = "Unit test checks whether element is displayed")
public void isDisplayedTest() {
assertTrue(matProgressBarDeterminate.isDisplayed());
assertTrue(matProgressBarQuery.isDisplayed());
Expand All @@ -41,7 +41,7 @@ public void isDisplayedTest() {
assertTrue(matProgressBarConfigurable.isDisplayed());
}

@Test
@Test(description = "Unit test checks whether element is visible")
public void isVisibleTest() {
matProgressBarDeterminate.show();
assertTrue(matProgressBarDeterminate.isVisible());
Expand All @@ -55,7 +55,7 @@ public void isVisibleTest() {
assertTrue(matProgressBarConfigurable.isVisible());
}

@Test
@Test(description = "Unit test checks that after stated period of time element becomes hidden")
public void verifyDisappearTest() {
refresh();
assertFalse(matProgressBarIndeterminate.isDisplayed());
Expand All @@ -69,7 +69,7 @@ public void verifyDisappearTest() {
assertTrue(matProgressBarBuffer.isHidden());
}

@Test
@Test(description = "Unit test checks progress bar modes: DETERMINATE, INDETERMINATE, QUERY, BUFFER")
public void verifyModesTest() {
assertEquals(matProgressBarDeterminate.mode(), DETERMINATE.getMode());
assertEquals(matProgressBarQuery.mode(), QUERY.getMode());
Expand All @@ -80,7 +80,7 @@ public void verifyModesTest() {
assertEquals(matProgressBarConfigurable.mode(), DETERMINATE.getMode());
}

@Test
@Test(description = "Unit test checks progress bar values")
public void verifyValuesTest() throws Exception {
assertEquals(matProgressBarDeterminate.value(), 40);
showBufferProgressBarButton.click();
Expand All @@ -89,7 +89,7 @@ public void verifyValuesTest() throws Exception {
assertEquals(matProgressBarConfigurable.value(), 50);
}

@Test
@Test(description = "Unit test checks progress bar MIN values")
public void verifyMinValuesTest() {
assertEquals(matProgressBarDeterminate.min(), 0);
showBufferProgressBarButton.click();
Expand All @@ -101,7 +101,7 @@ public void verifyMinValuesTest() {
assertEquals(matProgressBarConfigurable.min(), 0);
}

@Test
@Test(description = "Unit test checks progress bar MAX values")
public void verifyMaxValuesTest() {
assertEquals(matProgressBarDeterminate.max(), 100);
showBufferProgressBarButton.click();
Expand Down
2 changes: 1 addition & 1 deletion jdi-light-angular-tests/src/test/resources/general.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<test name="Common elements tests">
<packages>
<package name="io.github.epam.angular.tests.elements.common.*"/>
<package name="io.github.epam.angular.tests.elements.unit.*"/>
<package name="io.github.epam.angular.tests.unit.*"/>
<package name="io.github.epam.angular.tests.elements.complex.*"/>
</packages>
</test>
Expand Down
2 changes: 1 addition & 1 deletion jdi-light-angular-tests/src/test/resources/test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ page.check.after.open=NONE
element.search.strategy=strict
smart.locator=#%s;[ui=%s]
#smart.locator.toName=kebab-case | camelCase | snake_case | PascalCase | UPPER_SNAKE_CASE | First Upper Case | ALL UPPER CASE | First capital | As Is
log.level=TRACE
log.level=INFO
#text.type=SMART_TEXT | TEXT | VALUE | INNER | LABEL
#set.text.type=SET_TEXT | SEND_KEYS | CLEAR_SEND_KEYS
#assert.type=strict | soft
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ public int bufferValue() {
if (matcher.find()) {
String bufferValue = matcher.group(1);
return getInt(bufferValue);
} else {
throw new IllegalStateException("No buffer value found");
}
// TODO fix this
return -1;

}

@Override
Expand Down

0 comments on commit 3c8babe

Please sign in to comment.