-
Notifications
You must be signed in to change notification settings - Fork 32
⚗️ ♻️ improving e2e tests (adding structure for additional CI tests) #6765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
matusdrobuliak66
merged 13 commits into
ITISFoundation:master
from
matusdrobuliak66:e2e/add-additional-ci-frontend-tests
Nov 20, 2024
Merged
Changes from 9 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
d451630
improving e2e tests
matusdrobuliak66 88b8f72
improving e2e tests
matusdrobuliak66 982c2bd
improving e2e tests
matusdrobuliak66 53fc872
Merge branch 'master' into e2e/socketio
matusdrobuliak66 0c7861b
improving e2e tests
matusdrobuliak66 49b9c86
introducing CI playwright tests
matusdrobuliak66 7e15ce8
merge master - resolve conflicts
matusdrobuliak66 4140760
fix headed mode
matusdrobuliak66 774bbe9
fix
matusdrobuliak66 3924c1f
Merge branch 'master' into e2e/add-additional-ci-frontend-tests
matusdrobuliak66 757f4c4
improving e2e tests
matusdrobuliak66 db6a7ed
final touches
matusdrobuliak66 7566445
Merge branch 'master' into e2e/add-additional-ci-frontend-tests
matusdrobuliak66 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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.
68 changes: 68 additions & 0 deletions
68
tests/e2e-playwright/tests/platform_CI_tests/test_platform.py
This file contains hidden or 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 @@ | ||
| # pylint: disable=redefined-outer-name | ||
| # pylint: disable=unused-argument | ||
| # pylint: disable=unused-variable | ||
| # pylint: disable=too-many-arguments | ||
| # pylint: disable=too-many-statements | ||
| # pylint: disable=no-name-in-module | ||
|
|
||
| from pathlib import Path | ||
|
|
||
| import pytest | ||
|
|
||
|
|
||
| @pytest.fixture(scope="session") | ||
| def store_browser_context() -> bool: | ||
| return True | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def logged_in_context( | ||
| playwright, | ||
| store_browser_context: bool, | ||
| request: pytest.FixtureRequest, | ||
| pytestconfig, | ||
| ): | ||
| is_headed = "--headed" in pytestconfig.invocation_params.args | ||
|
|
||
| file_path = Path("state.json") | ||
| if not file_path.exists(): | ||
| request.getfixturevalue("log_in_and_out") | ||
|
|
||
| browser = playwright.chromium.launch(headless=not is_headed) | ||
| context = browser.new_context(storage_state="state.json") | ||
| yield context | ||
| context.close() | ||
| browser.close() | ||
|
|
||
|
|
||
| @pytest.fixture(scope="module") | ||
| def test_module_teardown(): | ||
|
|
||
| yield # Run the tests | ||
|
|
||
| file_path = Path("state.json") | ||
| if file_path.exists(): | ||
| file_path.unlink() | ||
|
|
||
|
|
||
| def test_simple_folder_workflow(logged_in_context, product_url, test_module_teardown): | ||
| page = logged_in_context.new_page() | ||
|
|
||
| page.goto(f"{product_url}") | ||
| page.wait_for_timeout(1000) | ||
| page.get_by_test_id("dashboard").get_by_text("New folder", exact=True).click() | ||
| page.get_by_placeholder("Title").fill("My new folder") | ||
| page.get_by_placeholder("Title").press("Enter") | ||
|
|
||
| page.get_by_test_id("dashboard").get_by_text("My new folder").click() | ||
| page.get_by_test_id("contextTree").get_by_text("My Workspace").click() | ||
|
|
||
|
|
||
| def test_simple_workspace_workflow( | ||
| logged_in_context, product_url, test_module_teardown | ||
| ): | ||
| page = logged_in_context.new_page() | ||
|
|
||
| page.goto(f"{product_url}") | ||
| page.wait_for_timeout(1000) | ||
| page.get_by_text("Shared Workspaces").click() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.