Skip to content

Commit

Permalink
- fix typo (#55)
Browse files Browse the repository at this point in the history
- add option to enable/disable video recording
- remove scope form video_record fixture
  • Loading branch information
midays authored Oct 18, 2023
1 parent 0e9fb26 commit 5f5058a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/fixtures/configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def configurations(

uuid = generate_uuid()

application = setup_intellij if ide == "intellij1" else setup_vscode
application = setup_intellij if ide == "intellij" else setup_vscode
application_config = intellij_config if ide == "intellij" else vscode_config
html_file_location = f"{application_config['plugin_cache_path']}/{uuid}/index.html"
model_json_path = f"{application_config['plugin_cache_path']}/model.json"
Expand Down
6 changes: 6 additions & 0 deletions src/fixtures/pytest_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ def pytest_addoption(parser):
action="store_true",
help="This is when running a test case on MTA (Migration Toolkit for Application) plugin.",
)
parser.addoption(
"--record-video",
action="store_true",
help="This options enables the record video fixture to record the test run.",
)


def pytest_configure(config):
pytest.mtr = config.getoption("--mtr")
pytest.mta = config.getoption("--mta")
pytest.record_video = config.getoption("--record-video")
6 changes: 5 additions & 1 deletion src/fixtures/video_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
)


@pytest.fixture(autouse=True, scope="session")
@pytest.fixture(autouse=True)
def record_test_run(ide, frame_rate=24):

if not pytest.record_video:
return

screen_size = get_screen_size()

run_time = datetime.now().strftime("%d-%m-%Y_%H:%M")
Expand Down

0 comments on commit 5f5058a

Please sign in to comment.