Skip to content

test(e2e): add End-to-End (E2E) tests for the OpenAI Moderation API integration #1431

Description

@YasharF

Prerequisites:

  1. You must have obtained a valid OpenAI API Key - see https://github.com/sahat/hackathon-starter?tab=readme-ov-file#obtaining-api-keys
  2. Have Hackathon Starter up and running with the OpenAI key and be able to load /ai/openai-moderation and check a sentence that gets flagged and one that does not get flagged.
  3. Be able to run npm run test:e2e with all existing tests passing.

Scope:

  • Create test/e2e/openai-moderation.e2e.test.js for E2E testing of /ai/openai-moderation with Playwrite. See test/e2e/github-api.e2e.test.js as an example.
  • The test must submit check at least one sentence that would be flagged and a sentence that would not get flagged.
  • All page elements that map to data from the API should be included in the tests.
  • npm run test:e2e should run all existing and new tests, and they should all pass.

Please include a screenshot of the console output with your PR submission.

Note 1: You would need to complete the prerequisites before asking for GitHub issue assignment.
Note 2: Please don't just copy-paste AI-generated content (code, issue replies, or PR text), as such submissions will be rejected and may be marked as spam. You can use AI assistants to be more efficient, but the final result should be your work with the help of an assistant, not an assistant's output taken at face value and copy-pasted.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions