-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
71 additions
and
30 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
15 changes: 15 additions & 0 deletions
15
server/application-server/src/test/java/de/tum/cit/aet/helios/ListRepositoryPageTest.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,15 @@ | ||
package de.tum.cit.aet.helios; | ||
|
||
import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat; | ||
|
||
import de.tum.cit.aet.helios.e2e.HeliosPlaywrightTest; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class ListRepositoryPageTest extends HeliosPlaywrightTest { | ||
@Test | ||
public void testPageIsRendering() { | ||
page.navigate(this.baseUrl); | ||
assertThat(page).hasURL(this.baseUrl + "/repo/list"); | ||
assertThat(page.getByText("Connected Repositories")).isVisible(); | ||
} | ||
} |
28 changes: 0 additions & 28 deletions
28
server/application-server/src/test/java/de/tum/cit/aet/helios/TrivialPlaywrightTestE2E.java
This file was deleted.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
server/application-server/src/test/java/de/tum/cit/aet/helios/e2e/HeliosPlaywrightTest.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,49 @@ | ||
package de.tum.cit.aet.helios.e2e; | ||
|
||
import com.microsoft.playwright.Browser; | ||
import com.microsoft.playwright.BrowserContext; | ||
import com.microsoft.playwright.Page; | ||
import com.microsoft.playwright.Playwright; | ||
import io.zonky.test.db.AutoConfigureEmbeddedDatabase; | ||
import org.junit.jupiter.api.AfterAll; | ||
import org.junit.jupiter.api.AfterEach; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Tag; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
|
||
@SpringBootTest() | ||
@Tag("playwright") | ||
@AutoConfigureEmbeddedDatabase | ||
public abstract class HeliosPlaywrightTest { | ||
|
||
protected final String baseUrl = "http://localhost:4200"; | ||
|
||
private static Playwright playwright; | ||
private static Browser browser; | ||
|
||
protected BrowserContext context; | ||
protected Page page; | ||
|
||
@BeforeAll | ||
static void launchBrowser() { | ||
playwright = Playwright.create(); | ||
browser = playwright.chromium().launch(); | ||
} | ||
|
||
@AfterAll | ||
static void closeBrowser() { | ||
playwright.close(); | ||
} | ||
|
||
@BeforeEach | ||
void createContextAndPage() { | ||
context = browser.newContext(); | ||
page = context.newPage(); | ||
} | ||
|
||
@AfterEach | ||
void closeContext() { | ||
context.close(); | ||
} | ||
} |