From 0ba34f55b060d76908dd0cb5b36ecd133423144b Mon Sep 17 00:00:00 2001 From: yacchin1205 <968739+yacchin1205@users.noreply.github.com> Date: Mon, 5 Oct 2026 19:06:46 +0900 Subject: [PATCH] Select the JAIRO Cloud index through its searchable picker and check the save confirmation now that the add-on settings offer them --- .github/scripts/generate_ci_config.sh | 2 + ...Migration\345\276\214-20250906-weko.ipynb" | 4 ++ run_tests.py | 4 +- ...343\203\263\350\277\275\345\212\240.ipynb" | 68 +++++++++++++++++-- ...343\203\211\343\202\252\343\203\263.ipynb" | 5 +- 5 files changed, 76 insertions(+), 7 deletions(-) diff --git a/.github/scripts/generate_ci_config.sh b/.github/scripts/generate_ci_config.sh index 86d960c..1ab61e5 100755 --- a/.github/scripts/generate_ci_config.sh +++ b/.github/scripts/generate_ci_config.sh @@ -113,6 +113,7 @@ if [[ "${WEKO}" == "true" ]]; then WEKO_USER_PASSWORD_VALUE=${WEKO_USER_PASSWORD:-} WEKO_INSTITUTION_NAME_VALUE=${WEKO_INSTITUTION_NAME:-} WEKO_INDEX_NAME_VALUE=${WEKO_INDEX_NAME:-'Sample Index'} + WEKO_INDEX_NAME_JA_VALUE=${WEKO_INDEX_NAME_JA:-'サンプルインデックス'} WEKO_DOCKER_COMPOSE_PATH_VALUE=${WEKO_DOCKER_COMPOSE_PATH:-} SWORD_MAPPING_ID_VALUE=${SWORD_MAPPING_ID:-30002} WEKO_TEST_MODE_VALUE=${WEKO_TEST_MODE:-direct} @@ -128,6 +129,7 @@ weko_user_email: '${WEKO_USER_EMAIL_VALUE}' weko_user_password: '${WEKO_USER_PASSWORD_VALUE}' weko_institution_name: '${WEKO_INSTITUTION_NAME_VALUE}' weko_index_name: '${WEKO_INDEX_NAME_VALUE}' +weko_index_name_ja: '${WEKO_INDEX_NAME_JA_VALUE}' weko_docker_compose_path: '${WEKO_DOCKER_COMPOSE_PATH_VALUE}' sword_mapping_id: ${SWORD_MAPPING_ID_VALUE} weko_test_mode: '${WEKO_TEST_MODE_VALUE}' diff --git "a/migrations/\345\217\226\343\202\212\343\201\276\343\201\250\343\202\201-Migration\345\276\214-20250906-weko.ipynb" "b/migrations/\345\217\226\343\202\212\343\201\276\343\201\250\343\202\201-Migration\345\276\214-20250906-weko.ipynb" index 19dfeb6..3cdfb9d 100644 --- "a/migrations/\345\217\226\343\202\212\343\201\276\343\201\250\343\202\201-Migration\345\276\214-20250906-weko.ipynb" +++ "b/migrations/\345\217\226\343\202\212\343\201\276\343\201\250\343\202\201-Migration\345\276\214-20250906-weko.ipynb" @@ -30,6 +30,7 @@ "weko_user_password = None\n", "weko_institution_name = 'GakuNin RDM IdP'\n", "weko_index_name = 'Sample Index'\n", + "weko_index_name_ja = 'サンプルインデックス'\n", "ignore_https_errors = False\n", "\n", "# Migration前手順で作成された移行済みプロジェクト\n", @@ -84,6 +85,8 @@ " weko_institution_name = input('機関名 (例: GakuNin RDM IdP): ')\n", "if weko_index_name is None:\n", " weko_index_name = input('WEKO index name: ')\n", + "if weko_index_name_ja is None:\n", + " weko_index_name_ja = input('WEKO index name (Japanese): ')\n", "\n", "timestamp = datetime.now().strftime('%Y%m%d-%H%M')\n", "project_name_dashboard = project_name_prefix.format(timestamp + '-1')\n", @@ -166,6 +169,7 @@ " weko_user_password=weko_user_password,\n", " weko_institution_name=weko_institution_name,\n", " weko_index_name=weko_index_name,\n", + " weko_index_name_ja=weko_index_name_ja,\n", " ignore_https_errors=ignore_https_errors,\n", " ),\n", " skip_failed_test,\n", diff --git a/run_tests.py b/run_tests.py index d27ea28..db695db 100644 --- a/run_tests.py +++ b/run_tests.py @@ -61,6 +61,7 @@ def __init__(self, config_path, show_disk_usage=False, failed_result_path=None): self.weko_user_password = None self.weko_institution_name = None self.weko_index_name = None + self.weko_index_name_ja = None self.weko_docker_compose_path = None self.sword_mapping_id = 30002 self.mibyo_db_sword_mapping_id = 51000 @@ -491,7 +492,7 @@ def run_weko_tests(self): name for name in [ 'weko_url', 'weko_admin_email', 'weko_admin_password', 'weko_user_email', 'weko_user_password', - 'weko_institution_name', 'weko_index_name', + 'weko_institution_name', 'weko_index_name', 'weko_index_name_ja', 'weko_docker_compose_path' ] if not getattr(self, name, None) @@ -511,6 +512,7 @@ def run_weko_tests(self): weko_user_password=self.weko_user_password, weko_institution_name=self.weko_institution_name, weko_index_name=self.weko_index_name, + weko_index_name_ja=self.weko_index_name_ja, weko_docker_compose_path=self.weko_docker_compose_path, sword_mapping_id=self.sword_mapping_id, weko_test_mode=self.weko_test_mode, diff --git "a/\343\203\206\343\202\271\343\203\210\346\211\213\351\240\206-WEKO\343\202\242\343\203\211\343\202\252\343\203\263-\343\202\242\343\203\211\343\202\252\343\203\263\350\277\275\345\212\240.ipynb" "b/\343\203\206\343\202\271\343\203\210\346\211\213\351\240\206-WEKO\343\202\242\343\203\211\343\202\252\343\203\263-\343\202\242\343\203\211\343\202\252\343\203\263\350\277\275\345\212\240.ipynb" index c99015d..5ee15a2 100644 --- "a/\343\203\206\343\202\271\343\203\210\346\211\213\351\240\206-WEKO\343\202\242\343\203\211\343\202\252\343\203\263-\343\202\242\343\203\211\343\202\252\343\203\263\350\277\275\345\212\240.ipynb" +++ "b/\343\203\206\343\202\271\343\203\210\346\211\213\351\240\206-WEKO\343\202\242\343\203\211\343\202\252\343\203\263-\343\202\242\343\203\211\343\202\252\343\203\263\350\277\275\345\212\240.ipynb" @@ -38,6 +38,7 @@ "weko_user_password = None\n", "weko_institution_name = 'Massachusetts Institute of Technology [Test]'\n", "weko_index_name = 'GRDM-Collaboration-Test-VR-1'\n", + "weko_index_name_ja = 'GRDM連携テスト-VR-1'\n", "default_result_path = None\n", "close_on_fail = False\n", "transition_timeout = 30000\n", @@ -3505,9 +3506,9 @@ } }, "source": [ - "## インデックス「TestJ」を選択する\n", + "## 「インデックス」のプルダウンをクリックし、表示された検索欄にインデックスの日本語名を入力する\n", "\n", - "ドロップダウンに TestJ と表示されること\n" + "候補に「(インデックスの日本語名) (ID:(インデックスID))」が表示されること\n" ] }, { @@ -3634,10 +3635,66 @@ "tags": [] }, "outputs": [], + "source": [ + "index_label = None\n", + "index_id = None\n", + "\n", + "async def _step(page):\n", + " global index_label, index_id\n", + " await page.locator('//div[contains(@class, \"weko-settings\")]//a[contains(@class, \"select2-choice\")]').click()\n", + " await page.locator('//div[@id = \"select2-drop\"]//input').fill(weko_index_name_ja)\n", + " candidate = page.locator(f'//div[@id = \"select2-drop\"]//li[starts-with(normalize-space(.), \"{weko_index_name_ja} (ID:\")]')\n", + " await expect(candidate).to_be_visible(timeout=transition_timeout)\n", + " index_label = await candidate.inner_text()\n", + " index_id = index_label.rsplit('(ID:', 1)[1].rstrip(')')\n", + "\n", + "await run_pw(_step)\n" + ] + }, + { + "cell_type": "markdown", + "id": "6b1f2c7e", + "metadata": {}, + "source": [ + "## 検索欄の入力を、候補に表示されたインデックスIDに置き換える\n", + "\n", + "候補が「(インデックスの日本語名) (ID:(インデックスID))」の1件だけになること" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c4d09a35", + "metadata": {}, + "outputs": [], + "source": [ + "async def _step(page):\n", + " await page.locator('//div[@id = \"select2-drop\"]//input').fill(index_id)\n", + " await expect(page.locator('//div[@id = \"select2-drop\"]//li')).to_have_text([index_label], timeout=transition_timeout)\n", + "\n", + "await run_pw(_step)\n" + ] + }, + { + "cell_type": "markdown", + "id": "e97a5d12", + "metadata": {}, + "source": [ + "## 候補をクリックする\n", + "\n", + "プルダウンに「(インデックスの日本語名) (ID:(インデックスID))」が表示されること" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3f8be0d6", + "metadata": {}, + "outputs": [], "source": [ "async def _step(page):\n", - " select_box = page.locator('//div[contains(@class, \"weko-settings\")]//select')\n", - " await select_box.select_option(label=weko_index_name)\n", + " await page.locator('//div[@id = \"select2-drop\"]//li').click()\n", + " await expect(page.locator('//div[contains(@class, \"weko-settings\")]//span[contains(@class, \"select2-chosen\")]')).to_have_text(index_label, timeout=transition_timeout)\n", "\n", "await run_pw(_step)\n" ] @@ -3734,7 +3791,7 @@ "source": [ "## 「保存」をクリックする\n", "\n", - "現在のインデックス: Index for Testと表示されること\n" + "現在のインデックス: Index for Testと表示され、「インデックス\"Index for Test\"のリンクに成功しました。」から始まるメッセージが表示されること\n" ] }, { @@ -3857,6 +3914,7 @@ "async def _step(page):\n", " await page.locator('//div[contains(@class, \"weko-settings\")]//button[contains(text(), \"保存\")]').click()\n", " await expect(page.locator(f'//div[contains(@class, \"weko-settings\")]//a[contains(text(), \"{weko_index_name}\")]')).to_be_visible(timeout=transition_timeout)\n", + " await expect(page.locator('//div[@id = \"wekoScope\"]/div[contains(@class, \"help-block\")]/p')).to_contain_text(f'インデックス\"{weko_index_name}\"のリンクに成功しました。', timeout=transition_timeout)\n", "\n", "await run_pw(_step)\n" ] diff --git "a/\345\217\226\343\202\212\343\201\276\343\201\250\343\202\201-WEKO\343\202\242\343\203\211\343\202\252\343\203\263.ipynb" "b/\345\217\226\343\202\212\343\201\276\343\201\250\343\202\201-WEKO\343\202\242\343\203\211\343\202\252\343\203\263.ipynb" index 786cd13..86a5ca8 100644 --- "a/\345\217\226\343\202\212\343\201\276\343\201\250\343\202\201-WEKO\343\202\242\343\203\211\343\202\252\343\203\263.ipynb" +++ "b/\345\217\226\343\202\212\343\201\276\343\201\250\343\202\201-WEKO\343\202\242\343\203\211\343\202\252\343\203\263.ipynb" @@ -10,7 +10,7 @@ ] }, "outputs": [], - "source": "from datetime import datetime\nfrom getpass import getpass\n\nrdm_url = 'https://rdm.example.com/'\nadmin_rdm_url = 'https://admin.rdm.example.com/'\nidp_name_1 = 'GakuNin RDM IdP'\nidp_username_1 = None\nidp_password_1 = None\nidp_name_2 = 'GakuNin RDM IdP'\nidp_username_2 = None\nidp_password_2 = None\n\nweko_url = 'https://weko.example.com/'\nweko_admin_email = None\nweko_admin_password = None\nweko_user_email = None\nweko_user_password = None\nweko_institution_name = 'GakuNin RDM IdP'\nweko_index_name = 'Sample Index'\nignore_https_errors = False\n\nproject_name_prefix = 'TEST-WEKO-{}'\noauth_application_name_prefix = 'TEST-WEKO-APP-{}'\ndefault_result_path = None\nclose_on_fail = False\ntransition_timeout = 60000\nskip_failed_test = True\nexclude_notebooks = []\n\n# OAuthクライアント追加テスト用設定\nis_staff = False\nclear_apps = True\n\n# WEKO SWORD API settings\nweko_docker_compose_path = None\nsword_mapping_id = 30002\nsword_workflow_id = 1\n\nweko_test_mode = 'direct'\n" + "source": "from datetime import datetime\nfrom getpass import getpass\n\nrdm_url = 'https://rdm.example.com/'\nadmin_rdm_url = 'https://admin.rdm.example.com/'\nidp_name_1 = 'GakuNin RDM IdP'\nidp_username_1 = None\nidp_password_1 = None\nidp_name_2 = 'GakuNin RDM IdP'\nidp_username_2 = None\nidp_password_2 = None\n\nweko_url = 'https://weko.example.com/'\nweko_admin_email = None\nweko_admin_password = None\nweko_user_email = None\nweko_user_password = None\nweko_institution_name = 'GakuNin RDM IdP'\nweko_index_name = 'Sample Index'\nweko_index_name_ja = 'サンプルインデックス'\nignore_https_errors = False\n\nproject_name_prefix = 'TEST-WEKO-{}'\noauth_application_name_prefix = 'TEST-WEKO-APP-{}'\ndefault_result_path = None\nclose_on_fail = False\ntransition_timeout = 60000\nskip_failed_test = True\nexclude_notebooks = []\n\n# OAuthクライアント追加テスト用設定\nis_staff = False\nclear_apps = True\n\n# WEKO SWORD API settings\nweko_docker_compose_path = None\nsword_mapping_id = 30002\nsword_workflow_id = 1\n\nweko_test_mode = 'direct'\n" }, { "cell_type": "code", @@ -40,6 +40,8 @@ " weko_institution_name = input('機関名 (例: GakuNin RDM IdP): ')\n", "if weko_index_name is None:\n", " weko_index_name = input('WEKO index name: ')\n", + "if weko_index_name_ja is None:\n", + " weko_index_name_ja = input('WEKO index name (Japanese): ')\n", "\n", "timestamp = datetime.now().strftime('%Y%m%d-%H%M')\n", "project_name_dashboard = project_name_prefix.format(timestamp + '-1')\n", @@ -116,6 +118,7 @@ " weko_user_password=weko_user_password,\n", " weko_institution_name=weko_institution_name,\n", " weko_index_name=weko_index_name,\n", + " weko_index_name_ja=weko_index_name_ja,\n", " ignore_https_errors=ignore_https_errors,\n", " ),\n", " skip_failed_test,\n",