Skip to content

Commit

Permalink
Update dataDisplay and feedback components test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
grossopa committed Dec 7, 2024
1 parent 8224986 commit 7439dbc
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public class MuiAvatarsTestCases extends AbstractBrowserSupport {
/**
* Tests the image avatars.
*
* @see <a href="https://mui.com/components/avatars/#image-avatars">
* https://mui.com/components/avatars/#image-avatars</a>
* @see <a href="https://mui.com/material-ui/react-avatar/#image-avatars">
* https://mui.com/material-ui/react-avatar/#image-avatars</a>
*/
public void testImageAvatars() {
List<MuiAvatar> imageAvatarList = driver.findComponent(By.id("ImageAvatars.js")).findComponent(By2.parent())
Expand All @@ -67,8 +67,8 @@ public void testImageAvatars() {
/**
* Tests the letter avatars.
*
* @see <a href="https://mui.com/components/avatars/#letter-avatars">
* https://mui.com/components/avatars/#letter-avatars</a>
* @see <a href="https://mui.com/material-ui/react-avatar/#letter-avatars">
* https://mui.com/material-ui/react-avatar/#letter-avatars</a>
*/
public void testLetterAvatars() {
List<MuiAvatar> letterAvatarList = driver.findComponent(By.id("LetterAvatars.js")).findComponent(By2.parent())
Expand All @@ -83,7 +83,7 @@ public void testLetterAvatars() {
public static void main(String[] args) {
MuiAvatarsTestCases test = new MuiAvatarsTestCases();
test.setUpDriver(EDGE);
test.driver.navigate().to("https://mui.com/components/avatars/");
test.driver.navigate().to("https://mui.com/material-ui/react-avatar/");

test.testImageAvatars();
test.testLetterAvatars();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class MuiBadgeTestCases extends AbstractBrowserSupport {
/**
* Tests for basic badge
*
* @see <a href="https://mui.com/components/badges/#basic-badge">https://mui.com/components/badges/#basic-badge</a>
* @see <a href="https://mui.com/material-ui/react-badge/#basic-badge">https://mui.com/material-ui/react-badge/#basic-badge</a>
*/
public void testBasicBadge() {
MuiBadge badge = driver.findComponent(By.id("SimpleBadge.js")).findComponent(By2.parent())
Expand All @@ -61,8 +61,8 @@ public void testBasicBadge() {
/**
* Tests for badge visibility
*
* @see <a href="https://mui.com/components/badges/#badge-visibility">
* https://mui.com/components/badges/#badge-visibility</a>
* @see <a href="https://mui.com/material-ui/react-badge/#badge-visibility">
* https://mui.com/material-ui/react-badge/#badge-visibility</a>
*/
public void testBadgeVisibility() {
List<MuiBadge> badgeList = driver.findComponent(By.id("BadgeVisibility.js")).findComponent(By2.parent())
Expand All @@ -80,8 +80,8 @@ public void testBadgeVisibility() {
/**
* Tests the show / hide badge when it's zero
*
* @see <a href="https://mui.com/components/badges/#badge-visibility">
* https://mui.com/components/badges/#badge-visibility</a>
* @see <a href="https://mui.com/material-ui/react-badge/#badge-visibility">
* https://mui.com/material-ui/react-badge/#badge-visibility</a>
*/
public void testShowZeroBadge() {
List<MuiBadge> badgeList = driver.findComponent(By.id("ShowZeroBadge.js")).findComponent(By2.parent())
Expand All @@ -99,8 +99,8 @@ public void testShowZeroBadge() {
/**
* Tests the maximum value
*
* @see <a href="https://mui.com/components/badges/#maximum-value">
* https://mui.com/components/badges/#maximum-value</a>
* @see <a href="https://mui.com/material-ui/react-badge/#maximum-value">
* https://mui.com/material-ui/react-badge/#maximum-value</a>
*/
public void testMaximumValue() {
List<MuiBadge> badgeList = driver.findComponent(By.id("BadgeMax.js")).findComponent(By2.parent())
Expand All @@ -119,7 +119,7 @@ public void testMaximumValue() {
public static void main(String[] args) {
MuiBadgeTestCases test = new MuiBadgeTestCases();
test.setUpDriver(EDGE);
test.driver.navigate().to("https://mui.com/components/badges/");
test.driver.navigate().to("https://mui.com/material-ui/react-badge/");

test.testBasicBadge();
test.testBadgeVisibility();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public class MuiChipTestCases extends AbstractBrowserSupport {
/**
* Tests the basic chip.
*
* @see <a href="https://mui.com/components/chips/#basic-chip">
* https://mui.com/components/chips/#basic-chip</a>
* @see <a href="https://mui.com/material-ui/react-chip/#basic-chip">
* https://mui.com/material-ui/react-chip/#basic-chip</a>
*/
public void testBasicChip() {
List<MuiChip> chipList = driver.findComponent(By.id("BasicChips.js")).findComponent(By2.parent())
Expand All @@ -66,8 +66,8 @@ public void testBasicChip() {
/**
* Tests the deletable chips.
*
* @see <a href="https://mui.com/components/chips/#deletable">
* https://mui.com/components/chips/#deletable</a>
* @see <a href="https://mui.com/material-ui/react-chip/#deletable">
* https://mui.com/material-ui/react-chip/#deletable</a>
*/
public void testDeletable() {
List<MuiChip> chipList = driver.findComponent(By.id("DeletableChips.js")).findComponent(By2.parent())
Expand All @@ -87,8 +87,8 @@ public void testDeletable() {
/**
* Tests the avatar chips.
*
* @see <a href="https://mui.com/components/chips/#avatar-chip">
* https://mui.com/components/chips/#avatar-chip</a>
* @see <a href="https://mui.com/material-ui/react-chip/#avatar-chip">
* https://mui.com/material-ui/react-chip/#avatar-chip</a>
*/
public void testAvatarChips() {
List<MuiChip> chipList = driver.findComponent(By.id("AvatarChips.js")).findComponent(By2.parent())
Expand All @@ -108,8 +108,8 @@ public void testAvatarChips() {
/**
* Tests the icon chips.
*
* @see <a href="https://mui.com/components/chips/#icon-chip">
* https://mui.com/components/chips/#icon-chip</a>
* @see <a href="https://mui.com/material-ui/react-chip/#icon-chip">
* https://mui.com/material-ui/react-chip/#icon-chip</a>
*/
public void testIconChips() {
List<MuiChip> chipList = driver.findComponent(By.id("IconChips.js")).findComponent(By2.parent())
Expand All @@ -129,7 +129,7 @@ public void testIconChips() {
public static void main(String[] args) {
MuiChipTestCases test = new MuiChipTestCases();
test.setUpDriver(EDGE);
test.driver.navigate().to("https://mui.com/components/chips/");
test.driver.navigate().to("https://mui.com/material-ui/react-chip/");

test.testBasicChip();
test.testAvatarChips();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ public class MuiDividerTestCases extends AbstractBrowserSupport {
/**
* Tests the list dividers.
*
* @see <a href="https://mui.com/components/dividers/#list-dividers">
* https://mui.com/components/dividers/#list-dividers</a>
* @see <a href="https://mui.com/material-ui/react-divider/#list-dividers">
* https://mui.com/material-ui/react-divider/#list-dividers</a>
*/
public void testListDividers() {
List<MuiDivider> dividerList = driver.findComponent(By.id("ListDividers.js")).findComponent(By2.parent())
.findComponent(By.className("MuiList-root"))
.findComponentsAs(className("MuiDivider-root"), c -> c.as(muiV5()).toDivider());
assertEquals(2, dividerList.size());
assertEquals(3, dividerList.size());

dividerList.forEach(divider -> {
assertTrue(divider.validate());
Expand All @@ -64,8 +65,8 @@ public void testListDividers() {
/**
* Tests the dividers with text, introduced in V5.
*
* @see <a href="https://mui.com/components/dividers/#dividers-with-text">
* https://mui.com/components/dividers/#dividers-with-text</a>
* @see <a href="https://mui.com/material-ui/react-divider/#dividers-with-text">
* https://mui.com/material-ui/react-divider/#dividers-with-text</a>
*/
public void testDividersWithText() {
List<MuiDivider> dividerList = driver.findComponent(By.id("DividerText.js")).findComponent(By2.parent())
Expand All @@ -80,15 +81,15 @@ public void testDividersWithText() {
assertEquals("CENTER", dividerList.get(0).getText());
assertEquals("LEFT", dividerList.get(1).getText());
assertEquals("RIGHT", dividerList.get(2).getText());
assertEquals("CHIP",
assertEquals("Chip",
dividerList.get(3).findComponent(className("MuiChip-root")).as(muiV5()).toChip().getLabel().getText());
}

/**
* Tests the vertical divider.
*
* @see <a href="https://mui.com/components/dividers/#vertical-divider">
* https://mui.com/components/dividers/#vertical-divider</a>
* @see <a href="https://mui.com/material-ui/react-divider/#vertical-divider">
* https://mui.com/material-ui/react-divider/#vertical-divider</a>
*/
public void testVerticalDivider() {
List<MuiDivider> dividerList = driver.findComponent(By.id("VerticalDividers.js")).findComponent(By2.parent())
Expand All @@ -103,7 +104,7 @@ public void testVerticalDivider() {
public static void main(String[] args) {
MuiDividerTestCases test = new MuiDividerTestCases();
test.setUpDriver(EDGE);
test.driver.navigate().to("https://mui.com/components/dividers/");
test.driver.navigate().to("https://mui.com/material-ui/react-divider/");

test.testListDividers();
test.testDividersWithText();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public class MuiListTestCases extends AbstractBrowserSupport {
/**
* Tests the basic lists.
*
* @see <a href="https://mui.com/components/dividers/#basic-list">
* https://mui.com/components/dividers/#basic-list</a>
* @see <a href="https://mui.com/material-ui/react-divider/#basic-list">
* https://mui.com/material-ui/react-divider/#basic-list</a>
*/
public void testBasicList() {
List<MuiList> lists = driver.findComponent(By.id("BasicList.js")).findComponent(By2.parent())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class MuiBackdropTestCases extends AbstractBrowserSupport {
/**
* Tests the example.
*
* @see <a href="https://mui.com/components/backdrop/#example">https://mui.com/components/backdrop/#example</a>
* @see <a href="https://mui.com/material-ui/react-backdrop/#example">https://mui.com/material-ui/react-backdrop/#example</a>
*/
public void testExample() {
MuiButton showBackdropButton = driver.findComponent(By.id("SimpleBackdrop.js")).findComponent(By2.parent())
Expand All @@ -63,7 +63,7 @@ public void testExample() {
public static void main(String[] args) {
MuiBackdropTestCases test = new MuiBackdropTestCases();
test.setUpDriver(EDGE);
test.driver.navigate().to("https://mui.com/components/backdrop/");
test.driver.navigate().to("https://mui.com/material-ui/react-backdrop/");

test.testExample();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ public class MuiDialogTestCases extends AbstractBrowserSupport {
/**
* Tests the basic dialog
*
* @see <a href="https://mui.com/components/dialogs/#basic-dialog">
* https://mui.com/components/dialogs/#basic-dialog</a>
* @see <a href="https://mui.com/material-ui/react-dialog/#basic-dialog">
* https://mui.com/material-ui/react-dialog/#basic-dialog</a>
*/
public void testBasicDialog() {
MuiButton showDialogButton = driver.findComponent(By.id("SimpleDialog.js")).findComponent(By2.parent())
MuiButton showDialogButton = driver.findComponent(By.id("SimpleDialogDemo.js")).findComponent(By2.parent())
.findComponent(By.className("MuiButton-root")).as(muiV5()).toButton();

showDialogButton.click();
Expand All @@ -68,8 +68,8 @@ public void testBasicDialog() {
/**
* Tests the alerts
*
* @see <a href="https://mui.com/components/dialogs/#alerts">
* https://mui.com/components/dialogs/#alerts</a>
* @see <a href="https://mui.com/material-ui/react-dialog/#alerts">
* https://mui.com/material-ui/react-dialog/#alerts</a>
*/
public void testAlerts() {
MuiButton openDialogButton = driver.findComponent(By.id("AlertDialog.js")).findComponent(By2.parent())
Expand All @@ -95,7 +95,7 @@ public void testAlerts() {
public static void main(String[] args) {
MuiDialogTestCases test = new MuiDialogTestCases();
test.setUpDriver(EDGE);
test.driver.navigate().to("https://mui.com/components/dialogs/");
test.driver.navigate().to("https://mui.com/material-ui/react-dialog/");

test.testBasicDialog();
test.testAlerts();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public class MuiSnackbarTestCases extends AbstractBrowserSupport {
/**
* Tests the simple Snackbars.
*
* @see <a href="https://mui.com/components/snackbars/#simple-snackbars">
* https://mui.com/components/snackbars/#simple-snackbars</a>
* @see <a href="https://mui.com/material-ui/react-snackbar/#simple-snackbars">
* https://mui.com/material-ui/react-snackbar/#simple-snackbars</a>
*/
public void testSimpleSnackbars() {
MuiButton simpleSnackbarButton = driver.findComponent(By.id("SimpleSnackbar.js")).findComponent(By2.parent())
Expand Down Expand Up @@ -79,7 +79,7 @@ public void testSimpleSnackbars() {
public static void main(String[] args) {
MuiSnackbarTestCases test = new MuiSnackbarTestCases();
test.setUpDriver(EDGE);
test.driver.navigate().to("https://mui.com/components/snackbars/");
test.driver.navigate().to("https://mui.com/material-ui/react-snackbar/");

test.testSimpleSnackbars();
}
Expand Down

0 comments on commit 7439dbc

Please sign in to comment.