add e2e test: submit prompt#396
Conversation
|
@AnJuHyppolite can you link to a CI run where we can see these tests passing? |
| # TESTING # | ||
| #===================================================# | ||
| E2E_USER_EMAIL= | ||
| E2E_USER_PASSWORD= |
There was a problem hiding this comment.
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.
| }); | ||
|
|
||
| // Login and wait for authentication (test is in the nj-auth-state project: doesn't use global setup authentication) | ||
| await page.goto('/login'); |
There was a problem hiding this comment.
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?
|
|
||
| test.describe.configure({ mode: 'serial' }); | ||
|
|
||
| test.beforeEach(async ({ page }) => { |
There was a problem hiding this comment.
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.)
| await page.goto('/login'); | ||
|
|
||
| const emailInput = page.locator('input[name="email"]'); | ||
| await expect(emailInput).toBeVisible({ timeout: 10000 }); |
There was a problem hiding this comment.
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"
0b5183f to
7f2a4be
Compare
7f2a4be to
3df3871
Compare
aab47ae to
33dc89b
Compare
3d7870a to
dbdac15
Compare
Description
This PR adds an end-to-end test that covers prompt submission.
Ticket
Refers to E2E Test: Basic functionality w/ one prompt
Approach
CONVO_START_RESPONSESSE_EVENTSe2e/andnj/e2e/to the nodemon ignore list to prevent server restarts during E2E test runsnj.env.templateand test credentials in BitwardenREADME-NJ.mdRunning e2e test instructionsSteps to Test
npm run e2e:nj.