-
-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #653 from keisuke-umezawa/feature/add-standalone-d…
…b-test Add standalone e2e tests
- Loading branch information
Showing
9 changed files
with
106 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: e2e-standalone-tests | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- '.github/workflows/e2e-standalone-tests.yml' | ||
- '**.py' | ||
- '**.ts' | ||
- '**.tsx' | ||
- 'package.json' | ||
- 'package-lock.json' | ||
- 'tsconfig.json' | ||
jobs: | ||
test: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
optuna-version: ['optuna==2.10.0', 'git+https://github.com/optuna/optuna.git'] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Rust toolchains | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Install wasm-pack | ||
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Setup Optuna ${{ matrix.optuna-version }} | ||
run: | | ||
python -m pip install --progress-bar off --upgrade pip setuptools | ||
python -m pip install --progress-bar off --upgrade ${{ matrix.optuna-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --progress-bar off . | ||
python -m pip install --progress-bar off pytest-playwright | ||
- name: Build standalone_app | ||
run: make MODE="prd" standalone_app/public/bundle.js | ||
|
||
- name: Install the required browsers | ||
run: playwright install | ||
|
||
- name: Run e2e tests | ||
run: pytest e2e_tests/test_standalone |
File renamed without changes.
Empty file.
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
Empty file.
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,22 @@ | ||
from playwright.sync_api import Page | ||
import pytest | ||
|
||
from ..test_server import make_standalone_server | ||
|
||
|
||
@pytest.fixture | ||
def server_url(request: pytest.FixtureRequest) -> str: | ||
return make_standalone_server(request) | ||
|
||
|
||
def test_home( | ||
page: Page, | ||
server_url: str, | ||
) -> None: | ||
url = f"{server_url}" | ||
page.goto(url) | ||
element = page.get_by_role("heading") | ||
assert element is not None | ||
title = element.text_content() | ||
assert title is not None | ||
assert title == "Optuna Dashboard (Wasm ver.)" |