This repository has been archived by the owner on Apr 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(#1696): Test playground is up and running
- Loading branch information
Showing
7 changed files
with
134 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#Thu Aug 27 14:51:34 BST 2020 | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME |
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,3 @@ | ||
build/ | ||
out/ | ||
bin/ |
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,27 @@ | ||
plugins { | ||
id 'java' | ||
} | ||
|
||
group 'com.scottlogic.datahelix.generator' | ||
|
||
sourceCompatibility = 1.8 | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
testCompile "org.seleniumhq.selenium:selenium-java:${SELENIUM_VERSION}" | ||
testCompile "org.junit.jupiter:junit-jupiter-api:${JUNIT_JUPITER_VERSION}" | ||
testCompile "junit:junit:${JUNIT_4_VERSION}" | ||
testCompile "org.junit.platform:junit-platform-runner:${JUNIT_PLATFORM_RUNNER_VERSION}" | ||
testCompile "org.junit.vintage:junit-vintage-engine:${JUNIT_JUPITER_VERSION}" | ||
testCompile "org.junit.jupiter:junit-jupiter-params:${JUNIT_JUPITER_VERSION}" | ||
testCompile "org.junit.jupiter:junit-jupiter-engine:${JUNIT_JUPITER_VERSION}" | ||
testImplementation("org.junit.jupiter:junit-jupiter:${JUNIT_JUPITER_VERSION}") | ||
} | ||
|
||
test { | ||
systemProperty "webdriver.gecko.driver", "/usr/local/bin/geckodriver" | ||
useJUnitPlatform() | ||
} |
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,68 @@ | ||
/* | ||
* Copyright 2019 Scott Logic Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import org.junit.jupiter.api.AfterAll; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import org.openqa.selenium.By; | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.firefox.FirefoxDriver; | ||
import org.openqa.selenium.support.ui.ExpectedConditions; | ||
import org.openqa.selenium.support.ui.WebDriverWait; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
import static org.openqa.selenium.support.ui.ExpectedConditions.invisibilityOfElementLocated; | ||
|
||
|
||
class PlaygroundTest { | ||
|
||
private static final String PLAYGROUND_URL = "https://finos.github.io/datahelix/playground/"; | ||
private static WebDriver driver; | ||
private static WebDriverWait wait; | ||
|
||
@BeforeAll | ||
static void before() { | ||
driver = new FirefoxDriver(); | ||
wait = new WebDriverWait(driver, 30); | ||
} | ||
|
||
@AfterAll | ||
static void afterAll() { | ||
driver.quit(); | ||
} | ||
|
||
@BeforeEach | ||
void beforeEach() { | ||
driver.get(PLAYGROUND_URL); | ||
|
||
wait.until(ExpectedConditions.attributeContains(By.id("output-panel"), "textContent", "Click Run")); | ||
driver.findElement(By.id("run")).click(); | ||
wait.until(invisibilityOfElementLocated(By.id("spinner"))); | ||
} | ||
|
||
@Test | ||
void clickRun_showsContentInOutputPanel() { | ||
boolean outputExists = driver.findElements(By.id("output")).size() > 0; | ||
assertTrue(outputExists); | ||
} | ||
|
||
@Test | ||
void clickRun_doesNotShowErrorMessage() { | ||
boolean errorExists = driver.findElements(By.id("error-popup")).size() > 0; | ||
assertFalse(errorExists); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -26,4 +26,5 @@ include 'common' | |
include 'orchestrator' | ||
include 'output' | ||
include 'custom' | ||
include 'playground' | ||
|