-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(selenium): storybook learning events (#1861)
- Loading branch information
Showing
7 changed files
with
84 additions
and
10 deletions.
There are no files selected for viewing
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
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
19 changes: 19 additions & 0 deletions
19
src/test/java/selenium/analytics/StoryBookLearningEventsPage.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,19 @@ | ||
package selenium.analytics; | ||
|
||
import org.openqa.selenium.By; | ||
import org.openqa.selenium.WebDriver; | ||
|
||
import selenium.util.ErrorHelper; | ||
|
||
public class StoryBookLearningEventsPage { | ||
|
||
private WebDriver driver; | ||
|
||
public StoryBookLearningEventsPage(WebDriver driver) { | ||
this.driver = driver; | ||
|
||
driver.findElement(By.id("storyBookLearningEventsPage")); | ||
|
||
ErrorHelper.verifyNoScriptOrMarkupError(driver); | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
src/test/java/selenium/analytics/StoryBookLearningEventsPageTest.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,55 @@ | ||
package selenium.analytics; | ||
|
||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.junit.jupiter.api.AfterEach; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.chrome.ChromeDriver; | ||
import org.openqa.selenium.chrome.ChromeOptions; | ||
|
||
import selenium.util.DomainHelper; | ||
|
||
public class StoryBookLearningEventsPageTest { | ||
|
||
private final Logger logger = LogManager.getLogger(); | ||
|
||
private WebDriver driver; | ||
|
||
@BeforeEach | ||
public void setUp() { | ||
logger.info("setUp"); | ||
|
||
ChromeOptions chromeOptions = new ChromeOptions(); | ||
|
||
// Read "headless" property set on the command line: | ||
// mvn clean verify -P regression-testing-ui -D headless=true | ||
String headlessSystemProperty = System.getProperty("headless"); | ||
logger.info("headlessSystemProperty: \"" + headlessSystemProperty + "\""); | ||
if ("true".equals(headlessSystemProperty)) { | ||
chromeOptions.addArguments("headless"); | ||
} | ||
|
||
driver = new ChromeDriver(chromeOptions); | ||
|
||
driver.get(DomainHelper.getBaseUrl() + "/analytics"); | ||
} | ||
|
||
@AfterEach | ||
public void tearDown() { | ||
logger.info("tearDown"); | ||
|
||
driver.quit(); | ||
} | ||
|
||
@Test | ||
public void testStoryBookLearningEventsPage() { | ||
logger.info("testStoryBookLearningEventsPage"); | ||
|
||
MainAnalyticsPage mainAnalyticsPage = new MainAnalyticsPage(driver); | ||
mainAnalyticsPage.pressStoryBookLearningEventsLink(); | ||
|
||
StoryBookLearningEventsPage storyBookLearningEventsPage = new StoryBookLearningEventsPage(driver); | ||
} | ||
} |
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