ทดสอบและแก้ไขข้อบกพร่องส่วนเสริม Google Workspace ของ Apps Script
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เมื่อคุณเผยแพร่ส่วนเสริม ผู้ใช้จะติดตั้งส่วนเสริมได้ผ่านแอปพลิเคชันโฮสต์หรือ Google Workspace Marketplace ก่อนเผยแพร่ ให้ทดสอบส่วนเสริมที่คุณพัฒนาภายในแอปพลิเคชันโฮสต์ที่ส่วนเสริมขยายการให้บริการ
หน้านี้จะอธิบายวิธีติดตั้งส่วนเสริมที่อยู่ระหว่างการพัฒนา (เรียกว่าส่วนเสริมที่ยังไม่เผยแพร่หรือสำหรับนักพัฒนาซอฟต์แวร์) เพื่อทดสอบหรือใช้ส่วนตัว นอกจากนี้ คุณยังแก้ไขข้อบกพร่องของส่วนเสริมได้โดยใช้โปรแกรมแก้ไขข้อบกพร่องและจุดหยุดพักของ IDE ของ Apps Script
ข้อกำหนดเบื้องต้น
- คุณต้องมีสิทธิ์ผู้แก้ไขในโปรเจ็กต์สคริปต์ของส่วนเสริม
- หากต้องการให้คนอื่นๆ ในองค์กรทดสอบส่วนเสริม ให้มอบสิทธิ์แก้ไขโปรเจ็กต์สคริปต์แก่บุคคลเหล่านั้น โปรดดูรายละเอียดเกี่ยวกับการให้สิทธิ์เข้าถึงที่หัวข้อการทำงานร่วมกับนักพัฒนาแอปรายอื่น
ติดตั้งส่วนเสริมที่ยังไม่ได้เผยแพร่
คุณติดตั้งส่วนเสริมที่ยังไม่ได้เผยแพร่ได้จากกล่องโต้ตอบการติดตั้งใช้งานของ Apps Script
ทำตามขั้นตอนต่อไปนี้เพื่อติดตั้งส่วนเสริม Google Workspace ที่ยังไม่ได้เผยแพร่เพื่อทดสอบ
- เปิดโปรเจ็กต์สคริปต์ในเครื่องมือแก้ไข Apps Script
- คลิกทำให้ใช้งานได้ > การนำการทดสอบไปใช้งาน
- คลิกติดตั้ง
- คลิกเสร็จสิ้นที่ด้านล่าง
คุณสามารถอนุญาตให้ผู้ใช้รายอื่นทดสอบส่วนเสริมได้โดยแชร์โปรเจ็กต์ Apps Script กับบัญชีของผู้ใช้รายนั้น (ต้องมีสิทธิ์แก้ไข) จากนั้นแจ้งให้ผู้ใช้ทำตามขั้นตอนข้างต้น
เมื่อติดตั้งแล้ว ส่วนเสริมจะพร้อมใช้งานทันทีในแอปพลิเคชันโฮสต์ที่ขยายการให้บริการ คุณอาจต้องรีเฟรชแท็บแอปพลิเคชันโฮสต์ก่อนส่วนเสริมจะปรากฏขึ้น นอกจากนี้ คุณยังต้องให้สิทธิ์ส่วนเสริมก่อนใช้งานด้วย
ถอนการติดตั้งส่วนเสริมที่ไม่ได้เผยแพร่
หากต้องการถอนการติดตั้งการติดตั้งใช้งานส่วนเสริมที่ยังไม่ได้เผยแพร่ ให้ทำตามขั้นตอนต่อไปนี้
- เปิดโปรเจ็กต์สคริปต์ในเครื่องมือแก้ไข Apps Script
- คลิกทำให้ใช้งานได้ > การนำการทดสอบไปใช้งาน
- คลิกถอนการติดตั้ง
- คลิกเสร็จสิ้นที่ด้านล่าง
ขั้นตอนเหล่านี้จะนำการติดตั้งใช้งานออกทันทีและส่วนเสริมจะไม่ปรากฏในแอปพลิเคชันโฮสต์อีกต่อไป คุณสามารถติดตั้งใช้งานอีกครั้งได้ทุกเมื่อโดยทำขั้นตอนการติดตั้งซ้ำ
แนวทางปฏิบัติแนะนำในการทดสอบ
ขณะทดสอบส่วนเสริม Google Workspace โปรดทำตามแนวทางปฏิบัติแนะนำสำหรับการพัฒนาส่วนเสริม นอกจากนี้ โปรดทำสิ่งต่อไปนี้
ทดสอบขั้นตอนการไปยังส่วนต่างๆ ของการ์ดอย่างละเอียดในแอปพลิเคชันโฮสต์ทั้งหมดที่ส่วนเสริมขยายการให้บริการ ตรวจสอบว่าลักษณะการทํางานของส่วนเสริมถูกต้องเมื่อผู้ใช้ย้ายจากบริบทหนึ่งไปยังอีกบริบทหนึ่ง และระหว่างการ์ดแบบไม่อิงตามบริบทกับการ์ดแบบอิงตามบริบท
ใช้ข้อมูลทดสอบตัวอย่างเพื่อประเมินลักษณะการทํางานของส่วนเสริม
หากส่วนเสริมเชื่อมต่อกับ API ของบุคคลที่สามหรือบริการอื่นๆ ให้ตรวจสอบว่าเข้าถึงบริการได้และทำงานตามที่คาดไว้ ตรวจสอบว่าส่วนเสริมจัดการรายละเอียดการให้สิทธิ์และการเข้าสู่ระบบอย่างถูกต้อง
ตรวจสอบว่าเงื่อนไขข้อผิดพลาดได้รับการจัดการอย่างเหมาะสม ใช้การ์ดข้อผิดพลาดเมื่อจำเป็น
โปรดสังเกตประสิทธิภาพของส่วนเสริม หากคุณทำการเปลี่ยนแปลงโค้ดและส่วนเสริมเริ่มทำงานช้าลง คุณอาจต้องนำฟีเจอร์นั้นออกหรือแก้ไขใหม่
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-12-22 UTC
[null,null,["อัปเดตล่าสุด 2024-12-22 UTC"],[[["\u003cp\u003eUnpublished Google Workspace add-ons can be installed for testing and personal use directly from the Apps Script project.\u003c/p\u003e\n"],["\u003cp\u003eUsers need editor access to the script project to install and test the unpublished add-on.\u003c/p\u003e\n"],["\u003cp\u003eUninstalling an unpublished add-on removes it from all host applications and requires reinstallation for further use.\u003c/p\u003e\n"],["\u003cp\u003eThorough testing is crucial, including card navigation, data handling, external service integrations, error management, and performance evaluation.\u003c/p\u003e\n"]]],["To test an unpublished add-on, open its script project in the Apps Script editor and navigate to **Deploy \u003e Test deployments**. Click **Install**, then **Done** to make it available in host applications. Share the project for others to test. Uninstall by repeating the process and selecting **Uninstall**. Testing should include card navigation, example data evaluation, third-party service verification, error handling, and performance monitoring.\n"],null,["# Test and debug Apps Script Google Workspace add-ons\n\nWhen you publish an add-on, users can install it\nthrough the host application\nor the [Google Workspace Marketplace](https://workspace.google.com/marketplace/). Before you publish, test the\nadd-ons that you develop within the host applications that\nthey extend.\n\nThis page describes how to install an add-on that is\nunder development (called an *unpublished* or *developer*\nadd-on) for testing or\npersonal use. You can also debug add-ons using the\nApps Script\nIDE's [debugger and breakpoints](/apps-script/guides/support/troubleshooting#use-debugger).\n\nPrerequisites\n-------------\n\n- You must have editor access to the add-on's script project.\n- To let other people in your organization test the add-on, grant them editor access to the script project. For details about granting access, see [Collaborating with Other Developers](/apps-script/guides/collaborating).\n\nInstall an unpublished add-on\n-----------------------------\n\nYou can install unpublished add-ons from Apps Script's **Deployments**\ndialog.\n\nFollow these steps to install an unpublished\nGoogle Workspace add-on for testing:\n\n1. Open the script project in the Apps Script editor.\n2. Click **Deploy \\\u003e Test deployments**.\n3. Click **Install**.\n4. At the bottom, click **Done**.\n\nYou can let other users test the add-on by sharing the Apps Script project\nwith their account (edit access is required). Then prompt the users to\nfollow the above steps.\n\nOnce installed, the add-on is immediately available in host applications it\nextends. You may need to refresh the host application tab before the add-on\nappears. You must also\n[authorize](/workspace/add-ons/how-tos/authorizing-addons#authorizing_unpublished_g_suite_add-ons)\nthe add-on before using it.\n\nUninstall an unpublished add-on\n-------------------------------\n\nTo uninstall an unpublished add-on deployment, follow these steps:\n\n1. Open the script project in the Apps Script editor.\n2. Click **Deploy \\\u003e Test deployments**.\n3. Click **Uninstall**.\n4. At the bottom, click **Done**.\n\nThese steps immediately remove the deployment and the add-on no longer appears\nin any host application. You can reinstall the deployment at any time by\nrepeating the [install procedure](#install_an_unpublished_add-on).\n\nTesting best practices\n----------------------\n\nWhile testing your Google Workspace add-on, be sure\nto follow the\n[Best practices](/workspace/add-ons/guides/workspace-best-practices)\nfor add-on development. In addition, be sure to do the following:\n\n1. Test card navigation flows thoroughly in all the host applications the\n add-on extends. Make sure the add-on behavior is correct as the user moves\n from context to context, and between non-contextual and contextual cards.\n\n2. [Use example test data](/workspace/add-ons/guides/workspace-best-practices#_write_tests_and_test_messages)\n to evaluate your add-on's behavior.\n\n3. If your add-on connects to a third-party API or other service, verify\n that the service can be accessed and behaves as expected. Make sure\n your add-on is handling the\n [authorization and log-in details](/workspace/add-ons/how-tos/non-google-services)\n correctly.\n\n4. Make sure any error conditions are handled gracefully. [Use error cards](/workspace/add-ons/guides/workspace-best-practices#_use_error_cards)\n where needed.\n\n5. Pay attention to how performant the add-on is. If you make a change to the\n code and the add-on starts slowing down, you may need to remove or rework\n that feature."]]