diff --git a/autogpt_platform/frontend/src/tests/monitor.spec.ts b/autogpt_platform/frontend/src/tests/monitor.spec.ts index bc047f2ab5..ab36b8adb9 100644 --- a/autogpt_platform/frontend/src/tests/monitor.spec.ts +++ b/autogpt_platform/frontend/src/tests/monitor.spec.ts @@ -19,7 +19,7 @@ test.describe.configure({ mode: "parallel", timeout: 30000, }); - +// --8<-- [start:AttachAgentId] test.beforeEach(async ({ page }, testInfo: TestInfo) => { const loginPage = new LoginPage(page); const testUser = await getTestUser(); @@ -45,6 +45,7 @@ test.beforeEach(async ({ page }, testInfo: TestInfo) => { const id = uuidv4(); testInfo.attach("agent-id", { body: id }); }); +// --8<-- [end:AttachAgentId] test.afterAll(async () => { // clear out the downloads folder @@ -63,11 +64,13 @@ test.skip("user can export and import agents", async ({ const monitorPage = new MonitorPage(page); const buildPage = new BuildPage(page); + // --8<-- [start:ReadAgentId] if (testInfo.attachments.length === 0 || !testInfo.attachments[0].body) { throw new Error("No agent id attached to the test"); } const testAttachName = testInfo.attachments[0].body.toString(); + // --8<-- [end:ReadAgentId] const agents = await monitorPage.listAgents(); const downloadPromise = page.waitForEvent("download"); diff --git a/docs/content/platform/contributing/tests.md b/docs/content/platform/contributing/tests.md index 9bf5394c5b..06c8996d61 100644 --- a/docs/content/platform/contributing/tests.md +++ b/docs/content/platform/contributing/tests.md @@ -160,6 +160,7 @@ You can pass information between tests using the `testInfo` object. This is usef }); ``` + ## See Also - [Writing Tests](https://playwright.dev/docs/writing-tests)