-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5346 Fix Menu usage and MaterialUI Menu
- Loading branch information
Showing
5 changed files
with
48 additions
and
26 deletions.
There are no files selected for viewing
5 changes: 2 additions & 3 deletions
5
...light-material-ui-tests/src/main/java/io/github/com/pages/navigation/ContextMenuPage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
package io.github.com.pages.navigation; | ||
|
||
import com.epam.jdi.light.elements.complex.Menu; | ||
import com.epam.jdi.light.elements.composite.WebPage; | ||
import com.epam.jdi.light.elements.pageobjects.annotations.locators.UI; | ||
import com.epam.jdi.light.material.elements.navigation.Menu; | ||
import com.epam.jdi.light.ui.html.elements.common.Text; | ||
|
||
public class ContextMenuPage extends WebPage { | ||
|
||
@UI("p.MuiTypography-root") | ||
public static Text pageText; | ||
|
||
// @todo #5297 Check the locator, looks like it points to item, not for Menu | ||
@UI(".MuiMenuItem-root") | ||
@UI(".MuiMenu-list") | ||
public static Menu contextMenuList; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...ial-ui-tests/src/test/java/io/github/epam/material/tests/navigation/ContextMenuTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package io.github.epam.material.tests.navigation; | ||
|
||
import com.epam.jdi.light.ui.html.elements.common.Button; | ||
import io.github.epam.TestsInit; | ||
import io.github.epam.test.data.MenuDataProvider; | ||
import org.testng.annotations.BeforeMethod; | ||
import org.testng.annotations.Test; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import static com.jdiai.tools.Timer.waitCondition; | ||
import static io.github.com.StaticSite.contextMenuPage; | ||
import static io.github.com.StaticSite.simpleMenuPage; | ||
import static io.github.com.pages.navigation.ContextMenuPage.contextMenuList; | ||
import static io.github.com.pages.navigation.ContextMenuPage.pageText; | ||
import static io.github.com.pages.navigation.SimpleMenuPage.*; | ||
|
||
public class ContextMenuTests extends TestsInit { | ||
|
||
private static final List<String> CONTEXT_MENU_ITEMS = Arrays.asList("Copy", "Print", "Highlight", "Email"); | ||
|
||
@BeforeMethod | ||
public void before() { | ||
contextMenuPage.open(); | ||
contextMenuPage.isOpened(); | ||
} | ||
|
||
@Test | ||
public void contextMenuTest() { | ||
pageText.is().displayed(); | ||
|
||
pageText.rightClick(); | ||
menu.is().displayed().and().has().itemsTexts(CONTEXT_MENU_ITEMS); | ||
contextMenuList.select("Print"); | ||
waitCondition(() -> menu.isHidden()); | ||
menu.is().hidden(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters