Skip to content

Conversation

cprecioso
Copy link
Member

@cprecioso cprecioso commented Oct 13, 2025

Adds a simple E2E test. Due to it using Google login and OpenAI as core app functionality, right now I'm only testing that it loads and shows the searchbox.

We don't need to use the custom DB commands as wasp-app-runner has support for the --db-image argument.


PR hierarchy:

@cprecioso cprecioso self-assigned this Oct 13, 2025
@cprecioso cprecioso changed the title Add testing Add testing to ask-the-documents Oct 13, 2025
@cprecioso cprecioso force-pushed the cprecioso/atd-testing branch 2 times, most recently from fb19c24 to 8dd3092 Compare October 13, 2025 09:37
@cprecioso cprecioso changed the base branch from cprecioso/3141-add-ask-the-docs to cprecioso/atd-add-env October 13, 2025 09:38
Copy link
Member Author

cprecioso commented Oct 13, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@cprecioso cprecioso marked this pull request as ready for review October 13, 2025 10:08
@cprecioso cprecioso changed the title Add testing to ask-the-documents ask-the-documents: Add CI testing Oct 13, 2025
@cprecioso cprecioso requested a review from infomiho October 13, 2025 10:16
Copy link
Contributor

@infomiho infomiho left a comment

Choose a reason for hiding this comment

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

One question


/* Run your local dev server before starting the tests */
webServer: {
command: `run-wasp-app ${WASP_RUN_MODE} --path-to-app=../ --wasp-cli-cmd=${WASP_CLI_CMD} --db-image pgvector/pgvector:pg17`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice

Comment on lines +6 to +10
test("shows the search bar", async ({ page }) => {
await page.goto("/");
await page.waitForSelector("input[type='search']");
await expect(page.locator("input[type='search']")).toBeVisible();
});
Copy link
Contributor

Choose a reason for hiding this comment

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

What would need to happen for us to be able to test:

  • logging in with Google
  • scraping some website
  • search

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we'd need either some framework-level way of mocking external services, or come up with a solution to MitM the HTTP connections.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh yeah, it's either mock the whole Google flow or actually log in which might be problematic due to some anti-bot measures. Hm, so MitM sounds the most reliable way of it to me 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's encode this in a existing or a new issue and link back to this file / PR.

I think this is enough for now 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

@cprecioso cprecioso force-pushed the cprecioso/atd-testing branch from 8dd3092 to f9fccfb Compare October 13, 2025 10:28
@cprecioso cprecioso force-pushed the cprecioso/atd-add-env branch from 0d7e6e7 to bd81e2d Compare October 13, 2025 10:28
Base automatically changed from cprecioso/atd-add-env to main October 13, 2025 10:29
@cprecioso cprecioso merged commit ad1ec0b into main Oct 14, 2025
24 checks passed
@cprecioso cprecioso deleted the cprecioso/atd-testing branch October 14, 2025 10:17
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.

2 participants