From fff4f112af699e6f6ae5af4e6d529c7d3aab0c81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ott=C3=B3?= Date: Wed, 7 Aug 2024 08:50:38 -0500 Subject: [PATCH] amending qa test as per new cat icon and deleting unused test --- .../test_content_validation_all_book_repos.py | 6 +- .../ui/content/test_problems_tab_all_repos.py | 134 ------------------ 2 files changed, 3 insertions(+), 137 deletions(-) delete mode 100644 tests/ui/content/test_problems_tab_all_repos.py diff --git a/tests/ui/content/test_content_validation_all_book_repos.py b/tests/ui/content/test_content_validation_all_book_repos.py index 49107fb2..68126e87 100644 --- a/tests/ui/content/test_content_validation_all_book_repos.py +++ b/tests/ui/content/test_content_validation_all_book_repos.py @@ -12,7 +12,7 @@ def test_content_validation_all_book_repos( # run the test: pytest -k test_content_validation_all_repos.py tests/ui --github_user xxx --github_password yyy # --github_token zzz > validation.log - # As per github changes, modified on November 30, 2023 + # Updated: August 7th, 2024 sign_in_button_selector = "input.btn.btn-primary.btn-block.js-sign-in-button" @@ -37,10 +37,10 @@ def test_content_validation_all_book_repos( else: home.click_workspace_continue_button() - # THEN: openstax extension launches and icon appears if not home.openstax_icon_is_visible: print("No openstax icon") else: + home.click_cat_icon() home.click_openstax_icon() # THEN: TOC Editor and book list dropdown is visible @@ -105,7 +105,7 @@ def test_content_validation_all_book_repos( if not home.openstax_icon_is_visible: print("No openstax icon") else: - # THEN: openstax extension launches and icon appears + home.click_cat_icon() home.click_openstax_icon() # THEN: TOC Editor and book list dropdown is visible diff --git a/tests/ui/content/test_problems_tab_all_repos.py b/tests/ui/content/test_problems_tab_all_repos.py deleted file mode 100644 index 6f54a952..00000000 --- a/tests/ui/content/test_problems_tab_all_repos.py +++ /dev/null @@ -1,134 +0,0 @@ -import pytest - -from tests.ui.pages.home import HomePoet - - -@pytest.mark.nondestructive -def test_problems_tab_all_repos( - chrome_page, github_user, github_password, git_content_repos, headers_data -): - # GIVEN: Playwright, chromium and gitpod - # repo url as: https://gitpod.io/#https://github.com/openstax/osbooks-otto-book - # run the test: pytest -k test_problems_tab_all_repos.py tests/ui --github_user xxx --github_password yyy - # --github_token zzz > problems.log - - sign_in_button_selector = "input.btn.btn-primary.btn-block.js-sign-in-button" - - for repo in git_content_repos: - gitpod_repo_url = "https://gitpod.io/#https://github.com/openstax/" + repo - - print(f"VERIFYING: {gitpod_repo_url}") - - # WHEN: gitpod launches - chrome_page.goto(gitpod_repo_url) - home = HomePoet(chrome_page) - - if not home.github_login_button_is_visible: - if home.private_repo_warning_is_visible: - print(f"SKIPPING! Book repo is private: {repo}") - continue - - else: - if home.gitpod_user_dropdown.inner_text() == "0 openstax": - pass - - else: - home.click_gitpod_user_dropdown() - home.click_gitpod_user_selector() - - home.click_workspace_continue_button() - - # THEN: openstax extension launches and icon appears - if not home.openstax_icon_is_visible: - print("No openstax icon") - else: - home.click_openstax_icon() - - # THEN: TOC Editor and book list dropdown is visible - if not home.open_toc_editor_button_is_visible: - print(">>>TOC Editor button not loaded, skipping") - continue - - else: - home.click_explorer_button() - home.click_explorer_modules() - home.click_explorer_submodule() - home.click_explorer_index_file() - - home.click_problems_tab() - - try: - assert ( - "No problems have been detected in the workspace." - in home.problems_tab_message.inner_text() - ) - - except AssertionError: - print(f"!!! Problems detected under Problems tab: {repo}") - print(f"{home.problems_tab_message.inner_text()}") - - else: - print(f"NO PROBLEMS IN {repo}") - - home.click_gitpod_menubar() - home.click_stop_workspace_button() - - else: - if home.private_repo_warning_is_visible: - print(f"SKIPPING! Book repo is private: {repo}") - continue - - else: - # WHEN: login into repo - home.click_github_login_button() - - with chrome_page.context.pages[1] as github_login_window: - github_login_window.fill("#login_field", github_user) - github_login_window.fill("#password", github_password) - - github_login_window.click(sign_in_button_selector) - - if home.gitpod_user_dropdown.inner_text() == "0 openstax": - pass - - else: - home.click_gitpod_user_dropdown() - home.click_gitpod_user_selector() - - home.click_workspace_continue_button() - - # THEN: openstax extension launches and icon appears - if not home.openstax_icon_is_visible: - print("No openstax icon") - else: - # THEN: openstax extension launches and icon appears - home.click_openstax_icon() - - # THEN: TOC Editor and book list dropdown is visible - if not home.open_toc_editor_button_is_visible: - print(">>> TOC Editor button not loaded, skipping") - continue - - else: - home.click_explorer_button() - home.click_explorer_modules() - home.click_explorer_submodule() - home.click_explorer_index_file() - - home.click_problems_tab() - - try: - assert ( - "No problems have been detected in the workspace." - in home.problems_tab_message.inner_text() - ) - - except AssertionError: - print(f"!!! Problems detected under Problems tab: {repo}") - print(f"{home.problems_tab_message.inner_text()}") - - else: - print(f"NO PROBLEMS IN {repo}") - - home.click_gitpod_menubar() - home.click_stop_workspace_button()