Skip to content

add e2e test: submit prompt#396

Open
AnJuHyppolite wants to merge 9 commits into
newjerseyfrom
updated-e2e-basic-functionality-with-one-prompt
Open

add e2e test: submit prompt#396
AnJuHyppolite wants to merge 9 commits into
newjerseyfrom
updated-e2e-basic-functionality-with-one-prompt

Conversation

@AnJuHyppolite

@AnJuHyppolite AnJuHyppolite commented May 13, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR adds an end-to-end test that covers prompt submission.

Ticket

Refers to E2E Test: Basic functionality w/ one prompt

Approach

  • Mocked API Bedrock calls and Server-Sent Events (SSE) streaming responses
  • Created named constants for mocked payloads:
    • CONVO_START_RESPONSE
    • SSE_EVENTS
  • Added:e2e/ and nj/e2e/ to the nodemon ignore list to prevent server restarts during E2E test runs
  • Updated nj.env.template and test credentials in Bitwarden
  • Updated README-NJ.md Running e2e test instructions

Steps to Test

  1. Ensure the app is running locally.
  2. Run: npm run e2e:nj.
  3. Confirm test passes.

@timwright12

Copy link
Copy Markdown

@AnJuHyppolite can you link to a CI run where we can see these tests passing?

Comment thread nj/nj.env.template Outdated
# TESTING #
#===================================================#
E2E_USER_EMAIL=
E2E_USER_PASSWORD=

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not running the E2E tests anywhere but local or CI, so I don't think these need to be part of their environment.

Comment thread nj/e2e/chat.spec.ts Outdated
});

// Login and wait for authentication (test is in the nj-auth-state project: doesn't use global setup authentication)
await page.goto('/login');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When trying to run the test in my IDE, I get this error on this line:

Error: page.goto: Protocol error (Page.navigate): Cannot navigate to invalid URL
Call log:
  - navigating to "/login", waiting until "load"

I don't see the same error when running via command line (npm run e2e:nj). What's the difference there?

Comment thread nj/e2e/chat.spec.ts Outdated

test.describe.configure({ mode: 'serial' });

test.beforeEach(async ({ page }) => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that there's only one test on the page, it doesn't really make sense to use beforeEach() - this is just part of the singular test.

(Unless we anticipate multiple tests? But this is kind of a specialized test since it explicitly does NOT want to use global-setup's automatic authentication.)

Comment thread nj/e2e/chat.spec.ts Outdated
await page.goto('/login');

const emailInput = page.locator('input[name="email"]');
await expect(emailInput).toBeVisible({ timeout: 10000 });

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When running from the command line, I get an error here:

Error: expect(locator).toBeVisible() failed

Locator: locator('input[name="email"]')
Expected: visible
Timeout: 10000ms
Error: element(s) not found

Call log:
  - Expect "toBeVisible" with timeout 10000ms
  - waiting for locator('input[name="email"]')
    12 × locator resolved to <input id="email" required="" type="email" name="email" class="feedback-input email-input"/>
       - unexpected value "hidden"

@AnJuHyppolite AnJuHyppolite force-pushed the updated-e2e-basic-functionality-with-one-prompt branch from 0b5183f to 7f2a4be Compare May 15, 2026 20:45
@AnJuHyppolite AnJuHyppolite changed the title add e2e test: log in, submit prompt, and log out add e2e test: submit prompt May 15, 2026
@AnJuHyppolite AnJuHyppolite force-pushed the updated-e2e-basic-functionality-with-one-prompt branch from 7f2a4be to 3df3871 Compare May 19, 2026 21:09
@AnJuHyppolite AnJuHyppolite force-pushed the updated-e2e-basic-functionality-with-one-prompt branch from aab47ae to 33dc89b Compare May 20, 2026 18:27
@AnJuHyppolite AnJuHyppolite force-pushed the updated-e2e-basic-functionality-with-one-prompt branch from 3d7870a to dbdac15 Compare May 21, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants