Skip to content

Commit

Permalink
add video
Browse files Browse the repository at this point in the history
  • Loading branch information
kcpevey committed Jan 9, 2024
1 parent a4cdf3a commit fe795f2
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 32 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ src/version.ts

# playwright screenshots
static
test-results/*

# yarn

Expand Down
10 changes: 7 additions & 3 deletions test/playwright/conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import pytest

from playwright.sync_api import expect



def pytest_addoption(parser):
parser.addoption("--screenshots", action="store", default="false")
Expand All @@ -13,3 +10,10 @@ def screenshot(pytestconfig):
return False
else:
return True

@pytest.fixture(scope="session")
def browser_context_args(browser_context_args):
return {
**browser_context_args,
"record_video_dir": "test-results/videos/",
}
58 changes: 29 additions & 29 deletions test/playwright/test_ux.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,32 +136,32 @@ def _create_new_environment(page, screenshot=False):
if screenshot:
page.screenshot(path="test-results/yaml-editor.png")
# switch back
page.get_by_label("Standard", exact=False).click()
# page.get_by_label("Standard", exact=False).click()

if screenshot:
page.screenshot(path="test-results/create-button.png")
# click create to start building the env
page.get_by_role("button", name="Create", exact=True).click()

# Interact with the environment shortly after creation
# click to open the Active environment dropdown manu
page.get_by_role("button", name=" - Active", exact=False).click()
if screenshot:
page.keyboard.press("PageUp") # ensure we are at the top of the page
page.screenshot(path="test-results/version-select.png")
# click on the Active environment on the dropdown menu item (which is currently building)
page.get_by_role("option", name=" - Active", exact=False).click()
if screenshot:
page.screenshot(path="test-results/version-select-done.png")
# ensure that the environment is building
expect(page.get_by_text("Building")).to_be_visible()
if screenshot:
page.keyboard.press("PageUp") # ensure we are at the top of the page
page.screenshot(path="test-results/environment-building.png", clip={'x': 300, 'y': 190, 'width': 285, 'height': 100})
# wait until the status is `Completed`
completed = page.get_by_text("Completed", exact=False)
completed.wait_for(state='attached', timeout=time_to_build_env)
expect(completed).to_be_visible()
# if screenshot:
# page.screenshot(path="test-results/create-button.png")
# # click create to start building the env
# page.get_by_role("button", name="Create", exact=True).click()

# # Interact with the environment shortly after creation
# # click to open the Active environment dropdown manu
# page.get_by_role("button", name=" - Active", exact=False).click()
# if screenshot:
# page.keyboard.press("PageUp") # ensure we are at the top of the page
# page.screenshot(path="test-results/version-select.png")
# # click on the Active environment on the dropdown menu item (which is currently building)
# page.get_by_role("option", name=" - Active", exact=False).click()
# if screenshot:
# page.screenshot(path="test-results/version-select-done.png")
# # ensure that the environment is building
# expect(page.get_by_text("Building")).to_be_visible()
# if screenshot:
# page.keyboard.press("PageUp") # ensure we are at the top of the page
# page.screenshot(path="test-results/environment-building.png", clip={'x': 300, 'y': 190, 'width': 285, 'height': 100})
# # wait until the status is `Completed`
# completed = page.get_by_text("Completed", exact=False)
# completed.wait_for(state='attached', timeout=time_to_build_env)
# expect(completed).to_be_visible()

return new_env_name

Expand Down Expand Up @@ -321,11 +321,11 @@ def test_integration(page: Page, test_config, screenshot):
# create a new environment
env_name = _create_new_environment(page, screenshot=screenshot)

# close any open tabs on the conda-store ui
_close_environment_tabs(page)
# # close any open tabs on the conda-store ui
# _close_environment_tabs(page)

# interact with an existing environment
_existing_environment_interactions(page, env_name, screenshot=screenshot)
# # interact with an existing environment
# _existing_environment_interactions(page, env_name, screenshot=screenshot)


if __name__ == "__main__":
Expand Down

0 comments on commit fe795f2

Please sign in to comment.