Last active
July 22, 2020 06:24
Star
You must be signed in to star a gist
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
| package info.magnolia.test.selenium.pageobjects.selftest; | |
| import static org.junit.jupiter.api.Assertions.assertEquals; | |
| import info.magnolia.test.selenium.Selenium; | |
| import info.magnolia.test.selenium.pageobjects.Form; | |
| import info.magnolia.test.selenium.pageobjects.PageObjects; | |
| import org.junit.jupiter.api.Disabled; | |
| import org.junit.jupiter.api.Test; | |
| import org.junit.jupiter.api.extension.ExtendWith; | |
| @ExtendWith(Selenium.class) | |
| public class FormTestli { | |
| // Original version from Federico | |
| @Test | |
| @Disabled("MGNLUI-5915") | |
| void setComboBoxOption_old(PageObjects expect) { | |
| // GIVEN | |
| expect.userMenu() | |
| .editUserProfile(); | |
| Form form = expect.form("User profile") | |
| .openTab("Preferences"); | |
| // A read-only dropdown | |
| assertEquals("English", form.getComboBoxOptionValue("Language")); | |
| // WHEN | |
| form.setComboBoxOption("Language", "日本語"); | |
| // THEN | |
| assertEquals("日本語", form.getComboBoxOptionValue("Language")); | |
| // WHEN | |
| form.setComboBoxOption("Time zone", "Africa/Abidjan (Greenwich Mean Time)"); | |
| // THEN | |
| assertEquals("Africa/Abidjan (Greenwich Mean Time)", form.getComboBoxOptionValue("Time zone")); | |
| } | |
| // Refactored version | |
| @Test | |
| void setComboBoxOption(PageObjects expect) { | |
| // GIVEN | |
| expect.userMenu() | |
| .editUserProfile(); | |
| Form form = expect.form("User profile") | |
| .openTab("Preferences"); | |
| // A read-only dropdown | |
| assertEquals("English", form.getComboBoxOptionValue("Language")); | |
| // WHEN | |
| form.setComboBoxOption("Time zone", "VST (Indochina Time)"); | |
| // THEN | |
| assertEquals("VST (Indochina Time)", form.getComboBoxOptionValue("Time zone")); | |
| // WHEN | |
| form.setComboBoxOption("Language", "日本語"); | |
| // THEN | |
| assertEquals("日本語", form.getComboBoxOptionValue("Language")); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment