From e413a128c4a306af48c31078f31e89c5e9d7bee0 Mon Sep 17 00:00:00 2001 From: Joe Baker Date: Wed, 6 Nov 2024 08:30:40 +0000 Subject: [PATCH] chore: update test fixtures --- .../add-additional-materials.chunks.txt | 204 +++++++++++++----- .../add-additional-materials.formatted.json | 18 +- .../add-additional-materials.moderation.json | 18 +- .../modify-lesson-easier.chunks.txt | 61 ++++-- .../modify-lesson-easier.formatted.json | 18 +- .../modify-lesson-easier.moderation.json | 18 +- .../tests-e2e/tests/modifiy-lesson.test.ts | 27 ++- 7 files changed, 251 insertions(+), 113 deletions(-) diff --git a/apps/nextjs/tests-e2e/recordings/add-additional-materials.chunks.txt b/apps/nextjs/tests-e2e/recordings/add-additional-materials.chunks.txt index c8a131229..5d28f21fd 100644 --- a/apps/nextjs/tests-e2e/recordings/add-additional-materials.chunks.txt +++ b/apps/nextjs/tests-e2e/recordings/add-additional-materials.chunks.txt @@ -3,26 +3,35 @@ type":" ll m Message -","patches":[ +","sectionsToEdit":[" +additional +Materials +"],"patches":[ {" type":" patch ","reasoning":" -Added +Adding a homework task - to + will reinforce the lesson - content - and - provide - additional - practice - for +'s + concepts +, + allowing students + to + consolidate + their + understanding + of + software + testing + techniques ."," value":{" type":" @@ -38,66 +47,142 @@ Materials Task \n \n +1 +. + ** Research + Activity +** +: + Investig +ate a real -world software application - of - your - choice and - describe + identify which testing techniques - ( -black --box -, - white --box -, - manual -, + you + think + were + used + during + its + development +. + Write + a + short + paragraph + explaining + your + reasoning +.\ +n +\n +2 +. + ** +Reflection + Questions +** +:\ +n + + - + Why + might + a + company + choose automated -) + testing + over + manual + testing +?\ +n + + - + Describe + a + scenario + where + black +-box + testing would be - most - suitable - for - ensuring - its - quality + more + effective + than + white +-box + testing +.\ +n +\n +3 . - Provide - reasons - for - your - choices + ** +Pr +actical + Application +** +: + Choose + a + simple + program + you + have + written + previously . - Write + Conduct a - short - report - ( -300 -- -400 - words -) - summar -ising + black +-box + test + and + note + any + inputs + that + produce + unexpected + outputs +.\ +n +\n +Remember + to + bring your findings + to + the + next + class + for + a + group + discussion ." -}}],"prompt":{" +} ,"status":" +complete +"}],"sectionsEdited":[" +additional +Materials +"],"prompt":{" type":" text ","value":" -The +A homework task has @@ -110,18 +195,25 @@ The section . If - there's - anything - else - you'd - like - to - include + you + have + any + more + changes or - modify + are + ready + to + final +ise + the + lesson , + please let me know !" -}} \ No newline at end of file +} ,"status":" +complete +"} \ No newline at end of file diff --git a/apps/nextjs/tests-e2e/recordings/add-additional-materials.formatted.json b/apps/nextjs/tests-e2e/recordings/add-additional-materials.formatted.json index cb70bd3a4..383930555 100644 --- a/apps/nextjs/tests-e2e/recordings/add-additional-materials.formatted.json +++ b/apps/nextjs/tests-e2e/recordings/add-additional-materials.formatted.json @@ -1,19 +1,27 @@ { "type": "llmMessage", + "sectionsToEdit": [ + "additionalMaterials" + ], "patches": [ { "type": "patch", - "reasoning": "Added a homework task to reinforce the lesson content and provide additional practice for students.", + "reasoning": "Adding a homework task will reinforce the lesson's concepts, allowing students to consolidate their understanding of software testing techniques.", "value": { "type": "string", "op": "replace", "path": "/additionalMaterials", - "value": "## Homework Task\n\nResearch a real-world software application of your choice and describe which testing techniques (black-box, white-box, manual, automated) would be most suitable for ensuring its quality. Provide reasons for your choices. Write a short report (300-400 words) summarising your findings." - } + "value": "## Homework Task\n\n1. **Research Activity**: Investigate a real-world software application and identify which testing techniques you think were used during its development. Write a short paragraph explaining your reasoning.\n\n2. **Reflection Questions**:\n - Why might a company choose automated testing over manual testing?\n - Describe a scenario where black-box testing would be more effective than white-box testing.\n\n3. **Practical Application**: Choose a simple program you have written previously. Conduct a black-box test and note any inputs that produce unexpected outputs.\n\nRemember to bring your findings to the next class for a group discussion." + }, + "status": "complete" } ], + "sectionsEdited": [ + "additionalMaterials" + ], "prompt": { "type": "text", - "value": "The homework task has been added to the additional materials section. If there's anything else you'd like to include or modify, let me know!" - } + "value": "A homework task has been added to the additional materials section. If you have any more changes or are ready to finalise the lesson, please let me know!" + }, + "status": "complete" } \ No newline at end of file diff --git a/apps/nextjs/tests-e2e/recordings/add-additional-materials.moderation.json b/apps/nextjs/tests-e2e/recordings/add-additional-materials.moderation.json index 2e8877746..4eb80960f 100644 --- a/apps/nextjs/tests-e2e/recordings/add-additional-materials.moderation.json +++ b/apps/nextjs/tests-e2e/recordings/add-additional-materials.moderation.json @@ -1,14 +1,14 @@ { - "id": "chatcmpl-ALGQjkZI8nYu5fIuzzyY6mGomJNkp", + "id": "chatcmpl-AQKuGEQfBdf77GC8OiM2lM61m1fVa", "object": "chat.completion", - "created": 1729631409, + "created": 1730840256, "model": "gpt-4o-2024-08-06", "choices": [ { "index": 0, "message": { "role": "assistant", - "content": "{\"scores\":{\"l\":5,\"v\":5,\"u\":5,\"s\":5,\"p\":5,\"t\":5},\"justification\":\"The lesson plan on software testing techniques is fully compliant across all categories. There is no discriminatory language, offensive language, or strong language present (Language and discrimination: 5). The content does not include any depiction or discussion of violence, serious violence, or sexual violence (Violence and crime: 5). There is no upsetting, sensitive, or distressing content; the material is technical and educational, focusing on software testing methodologies (Upsetting, disturbing and sensitive: 5). There is no content related to nudity or sexual topics (Nudity and sex: 5). The lesson does not involve physical activities, exploration of objects, or use of equipment requiring supervision, nor does it utilize external content that could pose safety concerns (Physical activity and safety: 5). Finally, the lesson does not contain any toxic content such as guides or encouragement of harmful behavior or illegal activities (Toxic: 5).\",\"categories\":[]}", + "content": "{\"scores\":{\"l\":5,\"v\":5,\"u\":5,\"s\":5,\"p\":4,\"t\":5},\"justification\":\"The lesson plan on 'Software Testing Techniques' for Key Stage 4 is thoroughly compliant with most guidelines. It does not contain any discriminatory language, offensive language, or strong language, making it fully compliant in the 'Language and discrimination' category. The content does not depict or discuss any form of conflict, violence, or sexual violence, ensuring full compliance with the 'Violence and crime' category. Similarly, there are no upsetting, sensitive, or distressing materials, resulting in a full compliance score for the 'Upsetting, disturbing and sensitive' category. There is no depiction or discussion of nudity or sexual content, ensuring full compliance in the 'Nudity and sex' category. The lesson involves some exploration of objects and the use of external content, such as diagrams and tables, which requires some supervision or guidance, hence a score of 4 in the 'Physical' category. Lastly, the lesson does not contain any toxic content or guidance on harmful behaviors, making it fully compliant in the 'Toxic' category.\",\"categories\":[\"p/exploration-of-objects\",\"p/external-content\"]}", "refusal": null }, "logprobs": null, @@ -16,15 +16,17 @@ } ], "usage": { - "prompt_tokens": 3860, - "completion_tokens": 219, - "total_tokens": 4079, + "prompt_tokens": 3931, + "completion_tokens": 253, + "total_tokens": 4184, "prompt_tokens_details": { "cached_tokens": 3584 }, "completion_tokens_details": { - "reasoning_tokens": 0 + "reasoning_tokens": 0, + "accepted_prediction_tokens": 0, + "rejected_prediction_tokens": 0 } }, - "system_fingerprint": "fp_a7d06e42a7" + "system_fingerprint": "fp_159d8341cc" } \ No newline at end of file diff --git a/apps/nextjs/tests-e2e/recordings/modify-lesson-easier.chunks.txt b/apps/nextjs/tests-e2e/recordings/modify-lesson-easier.chunks.txt index 77717100e..a08aee89a 100644 --- a/apps/nextjs/tests-e2e/recordings/modify-lesson-easier.chunks.txt +++ b/apps/nextjs/tests-e2e/recordings/modify-lesson-easier.chunks.txt @@ -3,16 +3,16 @@ type":" ll m Message -","patches":[ +","sectionsToEdit":[" +learning +Outcome +"],"patches":[ {" type":" patch ","reasoning":" Simpl ifying - the - language - of the learning outcome @@ -22,7 +22,7 @@ ifying more accessible for - pupils + students ."," value":{" type":" @@ -40,30 +40,45 @@ I software testing techniques - and - why - they - are - used ." -}}],"prompt":{" +},"status":" +complete +"}],"sectionsEdited":[" +learning +Outcome +"],"prompt":{" type":" text ","value":" -The +I've + simplified + the learning outcome - has - been - simplified . - Is + If this - version - more + is suitable - for - your - pupils -?" -}} \ No newline at end of file +, + please + let + me + know + or + suggest + further + changes +. + Otherwise +, + tap + ** +Continue +** + to + proceed +." +},"status":" +complete +"} \ No newline at end of file diff --git a/apps/nextjs/tests-e2e/recordings/modify-lesson-easier.formatted.json b/apps/nextjs/tests-e2e/recordings/modify-lesson-easier.formatted.json index 8dad11d9c..1739d070d 100644 --- a/apps/nextjs/tests-e2e/recordings/modify-lesson-easier.formatted.json +++ b/apps/nextjs/tests-e2e/recordings/modify-lesson-easier.formatted.json @@ -1,19 +1,27 @@ { "type": "llmMessage", + "sectionsToEdit": [ + "learningOutcome" + ], "patches": [ { "type": "patch", - "reasoning": "Simplifying the language of the learning outcome to make it more accessible for pupils.", + "reasoning": "Simplifying the learning outcome to make it more accessible for students.", "value": { "type": "string", "op": "replace", "path": "/learningOutcome", - "value": "I can describe different software testing techniques and why they are used." - } + "value": "I can describe different software testing techniques." + }, + "status": "complete" } ], + "sectionsEdited": [ + "learningOutcome" + ], "prompt": { "type": "text", - "value": "The learning outcome has been simplified. Is this version more suitable for your pupils?" - } + "value": "I've simplified the learning outcome. If this is suitable, please let me know or suggest further changes. Otherwise, tap **Continue** to proceed." + }, + "status": "complete" } \ No newline at end of file diff --git a/apps/nextjs/tests-e2e/recordings/modify-lesson-easier.moderation.json b/apps/nextjs/tests-e2e/recordings/modify-lesson-easier.moderation.json index 8c576d608..e0676884e 100644 --- a/apps/nextjs/tests-e2e/recordings/modify-lesson-easier.moderation.json +++ b/apps/nextjs/tests-e2e/recordings/modify-lesson-easier.moderation.json @@ -1,14 +1,14 @@ { - "id": "chatcmpl-AL9uRnl5stfRS6dx0NxmkHS42k4Ij", + "id": "chatcmpl-AQKjiTMyfZm7COyYeYIyCJcJTDV1Z", "object": "chat.completion", - "created": 1729606343, + "created": 1730839602, "model": "gpt-4o-2024-08-06", "choices": [ { "index": 0, "message": { "role": "assistant", - "content": "{\"scores\":{\"l\":5,\"v\":5,\"u\":5,\"s\":5,\"p\":4,\"t\":5},\"justification\":\"The lesson plan is fully compliant in terms of language, violence, upsetting content, nudity, and toxic content. It does not contain any discriminatory, offensive, or strong language. There is no depiction or discussion of violence, upsetting or sensitive content, or nudity. However, the lesson involves concepts of manual and automated testing which may involve the use of computers or software tools. While this doesn't directly require adult supervision, it suggests a minimal level of involvement in physical aspects, hence the score of 4 in physical activity and safety.\",\"categories\":[\"p/external-content\"]}", + "content": "{\"scores\":{\"l\":5,\"v\":5,\"u\":5,\"s\":5,\"p\":5,\"t\":5},\"justification\":\"The lesson plan for 'Software Testing Techniques' is compliant across all categories. It does not contain any discriminatory language or behavior, offensive language, or strong language, making it fully compliant in the 'Language and discrimination' category group. There is no depiction or discussion of conflict, violence, serious violence, or sexual violence, ensuring full compliance in the 'Violence and crime' category group. The lesson plan does not delve into any upsetting, sensitive, or distressing content, such as criminal behavior, natural disasters, or mental health issues, ensuring it is appropriate for the key stage 4 audience. There is no depiction or discussion of nudity or sexual content, making it fully compliant in the 'Nudity and sex' group. The lesson plan does not involve exploration of objects, equipment requiring supervision, imitable behaviors, external content, or physical activity, ensuring full compliance in the 'Physical activity and safety' category group. Finally, the lesson plan does not contain any guides, instructions, or encouragement of harmful behavior, illegal activity, or violence, making it fully compliant in the 'Toxic' category group.\",\"categories\":[]}", "refusal": null }, "logprobs": null, @@ -16,15 +16,17 @@ } ], "usage": { - "prompt_tokens": 3803, - "completion_tokens": 145, - "total_tokens": 3948, + "prompt_tokens": 3798, + "completion_tokens": 258, + "total_tokens": 4056, "prompt_tokens_details": { "cached_tokens": 2048 }, "completion_tokens_details": { - "reasoning_tokens": 0 + "reasoning_tokens": 0, + "accepted_prediction_tokens": 0, + "rejected_prediction_tokens": 0 } }, - "system_fingerprint": "fp_a7d06e42a7" + "system_fingerprint": "fp_159d8341cc" } \ No newline at end of file diff --git a/apps/nextjs/tests-e2e/tests/modifiy-lesson.test.ts b/apps/nextjs/tests-e2e/tests/modifiy-lesson.test.ts index b126cbbb7..c79dcf855 100644 --- a/apps/nextjs/tests-e2e/tests/modifiy-lesson.test.ts +++ b/apps/nextjs/tests-e2e/tests/modifiy-lesson.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from "@playwright/test"; +import { test, expect, type Page } from "@playwright/test"; import { TEST_BASE_URL } from "../config/config"; import { prepareUser } from "../helpers/auth"; @@ -37,28 +37,32 @@ test.describe("Modify a lesson plan", () => { }); }); - async function modifyLessonResource(page, setFixture) { + async function modifyLessonResource( + page: Page, + setFixture: (name: string) => void, + ) { const modifyButtons = page.locator("text=Modify"); await modifyButtons.first().click(); const modifyRadioButton = page.locator("text=Make them easier"); await modifyRadioButton.click(); + setFixture("modify-lesson-easier"); await page.locator("text=Modify section").click(); await waitForGeneration(page, generationTimeout); await expect( page.locator( - "text=I can describe different software testing techniques and why they are used.", + "text=I can describe different software testing techniques.", ), ).toBeVisible(); await expect( page.locator( - "text=The learning outcome has been simplified. Is this version more suitable for your pupils?", + "text=I've simplified the learning outcome. If this is suitable, please let me know or suggest further changes. Otherwise, tap Continue to proceed.", ), ).toBeVisible(); } - async function selectOtherModification(page) { + async function selectOtherModification(page: Page) { const modifyButtons = page.locator("text=Modify"); await modifyButtons.first().click(); const radioButtonOther = page.locator('input[type="radio"][value="OTHER"]'); @@ -67,7 +71,10 @@ test.describe("Modify a lesson plan", () => { await expect(otherInput).toBeVisible(); } - async function selectAdditionalResource(page, setFixture) { + async function selectAdditionalResource( + page: Page, + setFixture: (name: string) => void, + ) { const addAdditionalMaterialsButton = page.locator( "text=Add additional materials", ); @@ -80,10 +87,14 @@ test.describe("Modify a lesson plan", () => { await addMaterialsButton.click(); await waitForGeneration(page, generationTimeout); - await expect(page.getByText("The homework task has been")).toBeVisible(); await expect( page.getByText( - "Research a real-world software application of your choice and describe which testing techniques (black-box, white-box, manual, automated) would be most suitable for ensuring its quality. Provide reasons for your choices. Write a short report (300-400 words) summarising your findings.", + "A homework task has been added to the additional materials section. If you have any more changes or are ready to finalise the lesson, please let me know!", + ), + ).toBeVisible(); + await expect( + page.getByText( + "Research Activity: Investigate a real-world software application and identify which testing techniques you think were used during its development. Write a short paragraph explaining your reasoning.", ), ).toBeVisible(); }