diff --git a/.github/scripts/setup_tljh.sh b/.github/scripts/setup_tljh.sh index 70b1cd3..38eeee8 100755 --- a/.github/scripts/setup_tljh.sh +++ b/.github/scripts/setup_tljh.sh @@ -31,7 +31,7 @@ case "$COMMAND" in curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg sudo chmod a+r /etc/apt/keyrings/nodesource.gpg - NODE_MAJOR=21 + NODE_MAJOR=22 echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | \ sudo tee /etc/apt/sources.list.d/nodesource.list sudo apt-get update @@ -51,9 +51,6 @@ case "$COMMAND" in --admin admin:change-your-password \ --plugin "git+https://github.com/${TLJH_PLUGIN%%@*}.git@${TLJH_PLUGIN#*@}" - # Workaround: upgrade to the latest version of jupyterhub - sudo /opt/tljh/hub/bin/pip install --upgrade jupyterhub\<5 - # Configure the plugin cat <<'EOF' | sudo tee /opt/tljh/config/jupyterhub_config.d/repo2docker.py from tljh_repo2docker import TLJH_R2D_ADMIN_SCOPE diff --git "a/\343\203\206\343\202\271\343\203\210\346\211\213\351\240\206-BinderHub\343\202\242\343\203\211\343\202\252\343\203\263-Dockerfile.ipynb" "b/\343\203\206\343\202\271\343\203\210\346\211\213\351\240\206-BinderHub\343\202\242\343\203\211\343\202\252\343\203\263-Dockerfile.ipynb" index bc9980f..39c2522 100644 --- "a/\343\203\206\343\202\271\343\203\210\346\211\213\351\240\206-BinderHub\343\202\242\343\203\211\343\202\252\343\203\263-Dockerfile.ipynb" +++ "b/\343\203\206\343\202\271\343\203\210\346\211\213\351\240\206-BinderHub\343\202\242\343\203\211\343\202\252\343\203\263-Dockerfile.ipynb" @@ -504,7 +504,7 @@ "id": "7316011f", "metadata": {}, "outputs": [], - "source": "import traceback\n\nenvironment_name = None\n\nasync def _step(page):\n global environment_name\n await page.locator('#username_input').fill(tljh_username)\n await page.locator('#password_input').fill(tljh_password)\n await page.locator('#login_submit').click()\n\n sync_icon = page.locator(f'//a[text()=\"{project_url}\"]/../..//*[@data-testid=\"SyncIcon\"]')\n try:\n await expect(sync_icon).to_be_visible(timeout=transition_timeout)\n except:\n traceback.print_exc()\n await page.reload()\n await expect(sync_icon).to_be_visible(timeout=transition_timeout)\n await sync_icon.click()\n\n env_locator = page.locator('//*[@data-testid=\"SyncIcon\"]/../../..//*[@data-field=\"display_name\"]//*[@role=\"presentation\"]')\n environment_name = await env_locator.text_content()\n print(environment_name)\n await asyncio.sleep(3)\n\nawait run_pw(_step)" + "source": "import traceback\n\nenvironment_name = None\n\nasync def _step(page):\n global environment_name\n await page.locator('#username_input').fill(tljh_username)\n await page.locator('#password_input').fill(tljh_password)\n await page.locator('#login_submit').click()\n\n log_button = page.locator(f'//a[text()=\"{project_url}\"]/ancestor::*[@role=\"row\"]//*[@data-field=\"status\"]//button[.//*[@color=\"orange\"]]')\n try:\n await expect(log_button).to_be_visible(timeout=transition_timeout)\n except:\n traceback.print_exc()\n await page.reload()\n await expect(log_button).to_be_visible(timeout=transition_timeout)\n await log_button.click()\n\n env_locator = log_button.locator('xpath=ancestor::*[@role=\"row\"]//*[@data-field=\"display_name\"]')\n environment_name = await env_locator.text_content()\n print(environment_name)\n await asyncio.sleep(3)\n\nawait run_pw(_step)" }, { "cell_type": "markdown", @@ -525,12 +525,12 @@ "\n", "async def _step(page):\n", " global environment_name\n", - " await page.locator('//*[contains(text(), \"Close\")]').click()\n", + " await page.get_by_role('button', name='Close', exact=True).click()\n", " retry_count = 40\n", " while retry_count > 0:\n", " try:\n", - " check_icon = page.locator(f'//*[@title=\"{environment_name}\"]/../..//*[@data-testid=\"CheckIcon\"]')\n", - " await expect(check_icon).to_be_visible(timeout=transition_timeout)\n", + " build_complete = page.locator(f'//*[@title=\"{environment_name}\"]/ancestor::*[@role=\"row\"]//*[@data-field=\"status\"]//*[contains(@class, \"MuiSvgIcon-colorSuccess\")]')\n", + " await expect(build_complete).to_be_visible(timeout=transition_timeout)\n", " break\n", " except:\n", " retry_count -= 1\n", @@ -538,13 +538,13 @@ " traceback.print_exc()\n", " await page.reload()\n", "\n", - " target_check_icon = page.locator(f'//*[@title=\"{environment_name}\"]/../..//*[@data-testid=\"CheckIcon\"]')\n", + " target_build_complete = page.locator(f'//*[@title=\"{environment_name}\"]/ancestor::*[@role=\"row\"]//*[@data-field=\"status\"]//*[contains(@class, \"MuiSvgIcon-colorSuccess\")]')\n", " try:\n", - " await expect(target_check_icon).to_be_visible(timeout=transition_timeout)\n", + " await expect(target_build_complete).to_be_visible(timeout=transition_timeout)\n", " except:\n", " try:\n", - " sync_icon = page.locator(f'//*[@title=\"{environment_name}\"]/../..//*[@data-testid=\"SyncIcon\"]')\n", - " await sync_icon.click()\n", + " log_button = page.locator(f'//*[@title=\"{environment_name}\"]/ancestor::*[@role=\"row\"]//*[@data-field=\"status\"]//button[.//*[@color=\"orange\"]]')\n", + " await log_button.click()\n", " await asyncio.sleep(30)\n", " except:\n", " traceback.print_exc()\n", @@ -597,7 +597,7 @@ "async def _step(page):\n", " global environment_name\n", " await page.locator('//button[contains(text(), \"Create new Server\")]').click()\n", - " checkbox = page.locator(f'//*[@title=\"{environment_name}\"]/../..//input[@type=\"checkbox\"]')\n", + " checkbox = page.locator(f'//*[@title=\"{environment_name}\"]/ancestor::*[@role=\"row\"]//input[@type=\"checkbox\"]')\n", " await expect(checkbox).to_be_visible(timeout=transition_timeout)\n", "\n", "await run_pw(_step)" @@ -619,7 +619,7 @@ "outputs": [], "source": [ "async def _step(page):\n", - " await page.locator(f'//*[@title=\"{environment_name}\"]/../..//input[@type=\"checkbox\"]').click()\n", + " await page.locator(f'//*[@title=\"{environment_name}\"]/ancestor::*[@role=\"row\"]//input[@type=\"checkbox\"]').click()\n", " await page.locator('#server_name').fill('test-server')\n", " await page.locator('//button[contains(text(), \"Create Server\")]').click()\n", " await expect(page.locator('#server_name')).not_to_be_visible(timeout=transition_timeout * 5)\n", @@ -796,6 +796,7 @@ " await expect(rename_dialog).to_be_visible(timeout=transition_timeout)\n", " await rename_dialog.click()\n", " await expect(rename_dialog).not_to_be_visible(timeout=transition_timeout)\n", + " await expect(page.locator('.lm-TabBar-tab.lm-mod-current.jp-mod-dirty')).to_have_count(0, timeout=transition_timeout)\n", "\n", " close_icon = page.locator('//*[contains(@class, \"lm-mod-current\")]//*[contains(@class, \"lm-TabBar-tabCloseIcon\")]')\n", " await expect(close_icon).to_be_visible(timeout=transition_timeout)\n", @@ -914,7 +915,7 @@ "execution_count": null, "metadata": {}, "outputs": [], - "source": "nocopy_environment_name = None\n\nasync def _step(page):\n global nocopy_environment_name\n popup_future = page.wait_for_event('popup', timeout=transition_timeout)\n await page.locator('//*[@data-test-binderhub-launch]').click()\n popup = await popup_future\n\n sync_icon = popup.locator(f'//a[text()=\"{project_url}\"]/../..//*[@data-testid=\"SyncIcon\"]')\n try:\n await expect(sync_icon).to_be_visible(timeout=transition_timeout)\n except:\n traceback.print_exc()\n await popup.reload()\n await expect(sync_icon).to_be_visible(timeout=transition_timeout)\n await sync_icon.click()\n\n env_locator = popup.locator('//*[@data-testid=\"SyncIcon\"]/../../..//*[@data-field=\"display_name\"]//*[@role=\"presentation\"]')\n nocopy_environment_name = await env_locator.text_content()\n print(nocopy_environment_name)\n await asyncio.sleep(3)\n\n return popup\n\nawait run_pw(_step)" + "source": "nocopy_environment_name = None\n\nasync def _step(page):\n global nocopy_environment_name\n popup_future = page.wait_for_event('popup', timeout=transition_timeout)\n await page.locator('//*[@data-test-binderhub-launch]').click()\n popup = await popup_future\n\n log_button = popup.locator(f'//a[text()=\"{project_url}\"]/ancestor::*[@role=\"row\"]//*[@data-field=\"status\"]//button[.//*[@color=\"orange\"]]')\n try:\n await expect(log_button).to_be_visible(timeout=transition_timeout)\n except:\n traceback.print_exc()\n await popup.reload()\n await expect(log_button).to_be_visible(timeout=transition_timeout)\n await log_button.click()\n\n env_locator = log_button.locator('xpath=ancestor::*[@role=\"row\"]//*[@data-field=\"display_name\"]')\n nocopy_environment_name = await env_locator.text_content()\n print(nocopy_environment_name)\n await asyncio.sleep(3)\n\n return popup\n\nawait run_pw(_step)" }, { "cell_type": "markdown", @@ -930,12 +931,12 @@ "outputs": [], "source": [ "async def _step(page):\n", - " await page.locator('//*[contains(text(), \"Close\")]').click()\n", + " await page.get_by_role('button', name='Close', exact=True).click()\n", " retry_count = 40\n", " while retry_count > 0:\n", " try:\n", - " check_icon = page.locator(f'//*[@title=\"{nocopy_environment_name}\"]/../..//*[@data-testid=\"CheckIcon\"]')\n", - " await expect(check_icon).to_be_visible(timeout=transition_timeout)\n", + " build_complete = page.locator(f'//*[@title=\"{nocopy_environment_name}\"]/ancestor::*[@role=\"row\"]//*[@data-field=\"status\"]//*[contains(@class, \"MuiSvgIcon-colorSuccess\")]')\n", + " await expect(build_complete).to_be_visible(timeout=transition_timeout)\n", " break\n", " except:\n", " retry_count -= 1\n", @@ -963,7 +964,7 @@ " await page.locator('//a[@href=\"/services/tljh_repo2docker/servers\"]').click()\n", " await expect(page.locator('//button[contains(text(), \"Create new Server\")]')).to_be_visible(timeout=transition_timeout)\n", " await page.locator('//button[contains(text(), \"Create new Server\")]').click()\n", - " checkbox = page.locator(f'//*[@title=\"{nocopy_environment_name}\"]/../..//input[@type=\"checkbox\"]')\n", + " checkbox = page.locator(f'//*[@title=\"{nocopy_environment_name}\"]/ancestor::*[@role=\"row\"]//input[@type=\"checkbox\"]')\n", " await expect(checkbox).to_be_visible(timeout=transition_timeout)\n", " await checkbox.click()\n", " await page.locator('#server_name').fill('nocopy-server')\n", @@ -1215,7 +1216,7 @@ "id": "292c0c98", "metadata": {}, "outputs": [], - "source": "async def _step(page):\n popup_future = page.wait_for_event('popup', timeout=transition_timeout)\n await page.locator('//*[@data-test-binderhub-launch]').click()\n popup = await popup_future\n sync_icon = popup.locator('//*[@data-testid=\"SyncIcon\"]')\n try:\n await expect(sync_icon).to_be_visible(timeout=transition_timeout)\n except:\n traceback.print_exc()\n await popup.reload()\n await expect(sync_icon).to_be_visible(timeout=transition_timeout)\n return popup\n\nawait run_pw(_step)" + "source": "async def _step(page):\n popup_future = page.wait_for_event('popup', timeout=transition_timeout)\n await page.locator('//*[@data-test-binderhub-launch]').click()\n popup = await popup_future\n log_button = popup.locator('//*[@role=\"row\"]//*[@data-field=\"status\"]//button[.//*[@color=\"orange\"]]')\n try:\n await expect(log_button).to_be_visible(timeout=transition_timeout)\n except:\n traceback.print_exc()\n await popup.reload()\n await expect(log_button).to_be_visible(timeout=transition_timeout)\n return popup\n\nawait run_pw(_step)" }, { "cell_type": "markdown", @@ -1231,7 +1232,7 @@ "id": "b5dd8d9b", "metadata": {}, "outputs": [], - "source": "import traceback\n\nasync def _step(page):\n global environment_name\n\n sync_icon = page.locator(f'//a[text()=\"{project_url}\"]/../..//*[@data-testid=\"SyncIcon\"]')\n try:\n await expect(sync_icon).to_be_visible(timeout=transition_timeout)\n except:\n traceback.print_exc()\n await page.reload()\n await expect(sync_icon).to_be_visible(timeout=transition_timeout)\n await sync_icon.click()\n await asyncio.sleep(3)\n\n env_locator = page.locator('//*[@data-testid=\"SyncIcon\"]/../../..//*[@data-field=\"display_name\"]//*[@role=\"presentation\"]')\n environment_name = await env_locator.text_content()\n print(environment_name)\n\n await page.locator('//*[contains(text(), \"Close\")]').click()\n\n retry_count = 40\n while retry_count > 0:\n try:\n check_icon = page.locator(f'//*[@title=\"{environment_name}\"]/../..//*[@data-testid=\"CheckIcon\"]')\n await expect(check_icon).to_be_visible(timeout=transition_timeout)\n break\n except:\n retry_count -= 1\n if retry_count == 0:\n traceback.print_exc()\n await page.reload()\n\n target_check_icon = page.locator(f'//*[@title=\"{environment_name}\"]/../..//*[@data-testid=\"CheckIcon\"]')\n try:\n await expect(target_check_icon).to_be_visible(timeout=transition_timeout)\n except:\n try:\n sync_icon = page.locator(f'//*[@title=\"{environment_name}\"]/../..//*[@data-testid=\"SyncIcon\"]')\n await sync_icon.click()\n await asyncio.sleep(30)\n except:\n traceback.print_exc()\n raise\n\nawait run_pw(_step)" + "source": "import traceback\n\nasync def _step(page):\n global environment_name\n\n log_button = page.locator(f'//a[text()=\"{project_url}\"]/ancestor::*[@role=\"row\"]//*[@data-field=\"status\"]//button[.//*[@color=\"orange\"]]')\n try:\n await expect(log_button).to_be_visible(timeout=transition_timeout)\n except:\n traceback.print_exc()\n await page.reload()\n await expect(log_button).to_be_visible(timeout=transition_timeout)\n await log_button.click()\n await asyncio.sleep(3)\n\n env_locator = log_button.locator('xpath=ancestor::*[@role=\"row\"]//*[@data-field=\"display_name\"]')\n environment_name = await env_locator.text_content()\n print(environment_name)\n\n await page.get_by_role('button', name='Close', exact=True).click()\n\n retry_count = 40\n while retry_count > 0:\n try:\n build_complete = page.locator(f'//*[@title=\"{environment_name}\"]/ancestor::*[@role=\"row\"]//*[@data-field=\"status\"]//*[contains(@class, \"MuiSvgIcon-colorSuccess\")]')\n await expect(build_complete).to_be_visible(timeout=transition_timeout)\n break\n except:\n retry_count -= 1\n if retry_count == 0:\n traceback.print_exc()\n await page.reload()\n\n target_build_complete = page.locator(f'//*[@title=\"{environment_name}\"]/ancestor::*[@role=\"row\"]//*[@data-field=\"status\"]//*[contains(@class, \"MuiSvgIcon-colorSuccess\")]')\n try:\n await expect(target_build_complete).to_be_visible(timeout=transition_timeout)\n except:\n try:\n log_button = page.locator(f'//*[@title=\"{environment_name}\"]/ancestor::*[@role=\"row\"]//*[@data-field=\"status\"]//button[.//*[@color=\"orange\"]]')\n await log_button.click()\n await asyncio.sleep(30)\n except:\n traceback.print_exc()\n raise\n\nawait run_pw(_step)" }, { "cell_type": "markdown", @@ -1253,7 +1254,7 @@ " await page.locator('//a[@href=\"/services/tljh_repo2docker/servers\"]').click()\n", " await expect(page.locator('//button[contains(text(), \"Create new Server\")]')).to_be_visible(timeout=transition_timeout)\n", " await page.locator('//button[contains(text(), \"Create new Server\")]').click()\n", - " checkbox = page.locator(f'//*[@title=\"{environment_name}\"]/../..//input[@type=\"checkbox\"]')\n", + " checkbox = page.locator(f'//*[@title=\"{environment_name}\"]/ancestor::*[@role=\"row\"]//input[@type=\"checkbox\"]')\n", " await expect(checkbox).to_be_visible(timeout=transition_timeout)\n", " await checkbox.click()\n", " await page.locator('#server_name').fill('dockerfile-server')\n", diff --git "a/\343\203\206\343\202\271\343\203\210\346\211\213\351\240\206-BinderHub\343\202\242\343\203\211\343\202\252\343\203\263-repo2docker.ipynb" "b/\343\203\206\343\202\271\343\203\210\346\211\213\351\240\206-BinderHub\343\202\242\343\203\211\343\202\252\343\203\263-repo2docker.ipynb" index 19824f7..841d226 100644 --- "a/\343\203\206\343\202\271\343\203\210\346\211\213\351\240\206-BinderHub\343\202\242\343\203\211\343\202\252\343\203\263-repo2docker.ipynb" +++ "b/\343\203\206\343\202\271\343\203\210\346\211\213\351\240\206-BinderHub\343\202\242\343\203\211\343\202\252\343\203\263-repo2docker.ipynb" @@ -555,7 +555,7 @@ "id": "ae5bf19f", "metadata": {}, "outputs": [], - "source": "import traceback\n\nenvironment_name = None\n\nasync def _step(page):\n await page.locator('#username_input').fill(tljh_username)\n await page.locator('#password_input').fill(tljh_password)\n await page.locator('#login_submit').click()\n\n sync_icon = page.locator(f'//a[text()=\"{project_url}\"]/../..//*[@data-testid=\"SyncIcon\"]')\n try:\n await expect(sync_icon).to_be_visible(timeout=transition_timeout)\n except:\n traceback.print_exc()\n await page.reload()\n await expect(sync_icon).to_be_visible(timeout=transition_timeout)\n await sync_icon.click()\n\n global environment_name\n env_locator = page.locator('//*[@data-testid=\"SyncIcon\"]/../../..//*[@data-field=\"display_name\"]//*[@role=\"presentation\"]')\n environment_name = await env_locator.text_content()\n print(environment_name)\n await asyncio.sleep(3)\n\nawait run_pw(_step)" + "source": "import traceback\n\nenvironment_name = None\n\nasync def _step(page):\n await page.locator('#username_input').fill(tljh_username)\n await page.locator('#password_input').fill(tljh_password)\n await page.locator('#login_submit').click()\n\n log_button = page.locator(f'//a[text()=\"{project_url}\"]/ancestor::*[@role=\"row\"]//*[@data-field=\"status\"]//button[.//*[@color=\"orange\"]]')\n try:\n await expect(log_button).to_be_visible(timeout=transition_timeout)\n except:\n traceback.print_exc()\n await page.reload()\n await expect(log_button).to_be_visible(timeout=transition_timeout)\n await log_button.click()\n\n global environment_name\n env_locator = log_button.locator('xpath=ancestor::*[@role=\"row\"]//*[@data-field=\"display_name\"]')\n environment_name = await env_locator.text_content()\n print(environment_name)\n await asyncio.sleep(3)\n\nawait run_pw(_step)" }, { "cell_type": "markdown", @@ -571,7 +571,7 @@ "id": "887db787", "metadata": {}, "outputs": [], - "source": "import traceback\n\nasync def _step(page):\n await page.locator('//*[contains(text(), \"Close\")]').click()\n retry_count = 40\n while retry_count > 0:\n try:\n await expect(page.locator(f'//*[@title=\"{environment_name}\"]/../..//*[@data-testid=\"CheckIcon\"]')).to_be_visible(timeout=transition_timeout)\n break\n except:\n retry_count -= 1\n if retry_count == 0:\n traceback.print_exc()\n await page.reload()\n\n try:\n await expect(page.locator(f'//*[@title=\"{environment_name}\"]/../..//*[@data-testid=\"CheckIcon\"]')).to_be_visible(timeout=transition_timeout)\n except:\n try:\n await page.locator(f'//*[@title=\"{environment_name}\"]/../..//*[@data-testid=\"SyncIcon\"]').click()\n await asyncio.sleep(30)\n except:\n traceback.print_exc()\n raise\n\nawait run_pw(_step)" + "source": "import traceback\n\nasync def _step(page):\n await page.get_by_role('button', name='Close', exact=True).click()\n retry_count = 40\n while retry_count > 0:\n try:\n await expect(page.locator(f'//*[@title=\"{environment_name}\"]/ancestor::*[@role=\"row\"]//*[@data-field=\"status\"]//*[contains(@class, \"MuiSvgIcon-colorSuccess\")]')).to_be_visible(timeout=transition_timeout)\n break\n except:\n retry_count -= 1\n if retry_count == 0:\n traceback.print_exc()\n await page.reload()\n\n try:\n await expect(page.locator(f'//*[@title=\"{environment_name}\"]/ancestor::*[@role=\"row\"]//*[@data-field=\"status\"]//*[contains(@class, \"MuiSvgIcon-colorSuccess\")]')).to_be_visible(timeout=transition_timeout)\n except:\n try:\n await page.locator(f'//*[@title=\"{environment_name}\"]/ancestor::*[@role=\"row\"]//*[@data-field=\"status\"]//button[.//*[@color=\"orange\"]]').click()\n await asyncio.sleep(30)\n except:\n traceback.print_exc()\n raise\n\nawait run_pw(_step)" }, { "cell_type": "markdown", @@ -614,7 +614,7 @@ "source": [ "async def _step(page):\n", " await page.locator('//button[contains(text(), \"Create new Server\")]').click()\n", - " await expect(page.locator(f'//*[@title=\"{environment_name}\"]/../..//input[@type=\"checkbox\"]')).to_be_visible(timeout=transition_timeout)\n", + " await expect(page.locator(f'//*[@title=\"{environment_name}\"]/ancestor::*[@role=\"row\"]//input[@type=\"checkbox\"]')).to_be_visible(timeout=transition_timeout)\n", "\n", "await run_pw(_step)" ] @@ -635,7 +635,7 @@ "outputs": [], "source": [ "async def _step(page):\n", - " await page.locator(f'//*[@title=\"{environment_name}\"]/../..//input[@type=\"checkbox\"]').click()\n", + " await page.locator(f'//*[@title=\"{environment_name}\"]/ancestor::*[@role=\"row\"]//input[@type=\"checkbox\"]').click()\n", " await page.locator('#server_name').fill('test-server')\n", " await page.locator('//button[contains(text(), \"Create Server\")]').click()\n", " await expect(page.locator('#server_name')).not_to_be_visible(timeout=transition_timeout * 5)\n", @@ -813,6 +813,7 @@ " await expect(rename_dialog).to_be_visible(timeout=transition_timeout)\n", " await rename_dialog.click()\n", " await expect(rename_dialog).not_to_be_visible(timeout=transition_timeout)\n", + " await expect(page.locator('.lm-TabBar-tab.lm-mod-current.jp-mod-dirty')).to_have_count(0, timeout=transition_timeout)\n", "\n", " close_icon = page.locator('//*[contains(@class, \"lm-mod-current\")]//*[contains(@class, \"lm-TabBar-tabCloseIcon\")]')\n", " await expect(close_icon).to_be_visible(timeout=transition_timeout)\n", diff --git "a/\343\203\206\343\202\271\343\203\210\346\211\213\351\240\206-BinderHub\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-BinderHub\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 311718c..6b26bd5 100644 --- "a/\343\203\206\343\202\271\343\203\210\346\211\213\351\240\206-BinderHub\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-BinderHub\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" @@ -467,7 +467,7 @@ "id": "97a5d39d", "metadata": {}, "outputs": [], - "source": "import traceback\n\nasync def _step(page):\n await page.locator('#username_input').fill(tljh_username)\n await page.locator('#password_input').fill(tljh_password)\n await page.locator('#login_submit').click()\n\n sync_icon = page.locator(f'//a[text()=\"{project_url}\"]/../..//*[@data-testid=\"SyncIcon\"]')\n try:\n await expect(sync_icon).to_be_visible(timeout=transition_timeout)\n except:\n traceback.print_exc()\n await page.reload()\n await expect(sync_icon).to_be_visible(timeout=transition_timeout)\n await sync_icon.click()\n await asyncio.sleep(3)\n\nawait run_pw(_step)" + "source": "import traceback\n\nasync def _step(page):\n await page.locator('#username_input').fill(tljh_username)\n await page.locator('#password_input').fill(tljh_password)\n await page.locator('#login_submit').click()\n\n log_button = page.locator(f'//a[text()=\"{project_url}\"]/ancestor::*[@role=\"row\"]//*[@data-field=\"status\"]//button[.//*[@color=\"orange\"]]')\n try:\n await expect(log_button).to_be_visible(timeout=transition_timeout)\n except:\n traceback.print_exc()\n await page.reload()\n await expect(log_button).to_be_visible(timeout=transition_timeout)\n await log_button.click()\n await asyncio.sleep(3)\n\nawait run_pw(_step)" }, { "cell_type": "markdown", @@ -487,11 +487,11 @@ "import traceback\n", "\n", "async def _step(page):\n", - " await page.locator('//*[contains(text(), \"Close\")]').click()\n", + " await page.get_by_role('button', name='Close', exact=True).click()\n", " retry_count = 40\n", " while retry_count > 0:\n", " try:\n", - " await expect(page.locator(f'//a[text()=\"{project_url}\"]/../..//*[@data-testid=\"CheckIcon\"]')).to_be_visible(timeout=transition_timeout)\n", + " await expect(page.locator(f'//a[text()=\"{project_url}\"]/ancestor::*[@role=\"row\"]//*[@data-field=\"status\"]//*[contains(@class, \"MuiSvgIcon-colorSuccess\")]')).to_be_visible(timeout=transition_timeout)\n", " break\n", " except:\n", " retry_count -= 1\n", @@ -500,10 +500,10 @@ " await page.reload()\n", "\n", " try:\n", - " await expect(page.locator(f'//a[text()=\"{project_url}\"]/../..//*[@data-testid=\"CheckIcon\"]')).to_be_visible(timeout=transition_timeout)\n", + " await expect(page.locator(f'//a[text()=\"{project_url}\"]/ancestor::*[@role=\"row\"]//*[@data-field=\"status\"]//*[contains(@class, \"MuiSvgIcon-colorSuccess\")]')).to_be_visible(timeout=transition_timeout)\n", " except:\n", " try:\n", - " await page.locator(f'//a[text()=\"{project_url}\"]/../..//*[@data-testid=\"SyncIcon\"]').click()\n", + " await page.locator(f'//a[text()=\"{project_url}\"]/ancestor::*[@role=\"row\"]//*[@data-field=\"status\"]//button[.//*[@color=\"orange\"]]').click()\n", " await asyncio.sleep(30)\n", " except:\n", " traceback.print_exc()\n",