-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup test db #132
Setup test db #132
Conversation
Your Render PR Server URL is https://taco-dev-prototyp-se-pr-132.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cn19i7021fec73bgkq2g. |
…action Also adjust DATABASE_URL in env example
8dc7e01
to
6b05863
Compare
tests/test.ts
Outdated
test('should perform a test that touches the database', async ({ page }) => { | ||
await page.goto('/signup') | ||
|
||
await page.getByLabel('Name').fill('Test User') | ||
await page.getByLabel('Email').fill('[email protected]') | ||
await page.getByLabel('Password', { exact: true }).fill('password123') | ||
await page.getByLabel('Confirm Password').fill('password123') | ||
|
||
await page.getByText('Sign up').click() | ||
|
||
console.log('INI-BEFORE') | ||
console.log('INI-BEFORE') | ||
console.log('INI-BEFORE') | ||
console.log(await page.content()) | ||
console.log('END-BEFORE') | ||
console.log('END-BEFORE') | ||
console.log('END-BEFORE') | ||
|
||
await page.waitForURL('/app/settings/teams') | ||
|
||
console.log('INI-AFTER') | ||
console.log('INI-AFTER') | ||
console.log('INI-AFTER') | ||
console.log(await page.content()) | ||
console.log('END-AFTER') | ||
console.log('END-AFTER') | ||
console.log('END-AFTER') | ||
|
||
await expect(page).toHaveURL('/app/settings/teams') | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you get this to work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only locally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Console logs can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally, I just left them because I didn't fix the issue in GH actions. So when/if erik tries it out has something to look at. But yep, they can be removed.
|
87583e8
to
1c178cf
Compare
* add test db in compose and gh actions * add test db setup script * move cleanDatabase to a helper file * rm unused test * adjustments to make it work * remove header param from playwright and add NODE_ENV=test in gh test action Also adjust DATABASE_URL in env example * install browsers with deps * fix seeds
* add key perk to landing page (#107) * add key perk to landing page * fix spelling * 98-clarify-copy-when-creating-a-team * modify copy when creating a new team * add missing env to gh action/workflow --------- Co-authored-by: Toni Oriol <[email protected]> * 104-change-the-word-fork-it-to-clone-including-icon * Change 'fork' to 'clone' and change icon * Change copy of modal after clicking 'Clone' * replace fork with clone * add missing env vars to example * Create dependabot.yml * Bump vite from 4.3.9 to 4.5.2 (#112) Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.3.9 to 4.5.2. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v4.5.2/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v4.5.2/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update dependabot.yml Include GitHub Actions version updates. * Bump actions/checkout from 2 to 4 (#123) Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v2...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump actions/setup-node from 2 to 4 (#122) Bumps [actions/setup-node](https://github.com/actions/setup-node) from 2 to 4. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](actions/setup-node@v2...v4) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Upgrade to node 20 * Run tests on push to dev * Bump axios, openai and postmark (#113) * Bump axios, openai and postmark Bumps [axios](https://github.com/axios/axios) to 1.6.5 and updates ancestor dependencies [axios](https://github.com/axios/axios), [openai](https://github.com/openai/openai-node) and [postmark](https://github.com/ActiveCampaign/postmark.js). These dependencies need to be updated together. Updates `axios` from 0.25.0 to 1.6.5 - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](axios/axios@v0.25.0...v1.6.5) Updates `openai` from 3.3.0 to 4.25.0 - [Release notes](https://github.com/openai/openai-node/releases) - [Changelog](https://github.com/openai/openai-node/blob/master/CHANGELOG.md) - [Commits](openai/openai-node@v3.3.0...v4.25.0) Updates `postmark` from 3.0.19 to 4.0.2 - [Release notes](https://github.com/ActiveCampaign/postmark.js/releases) - [Changelog](https://github.com/ActiveCampaign/postmark.js/blob/main/CHANGELOG.md) - [Commits](ActiveCampaign/postmark.js@3.0.19...4.0.2) --- updated-dependencies: - dependency-name: axios dependency-type: indirect - dependency-name: openai dependency-type: direct:production - dependency-name: postmark dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * update to openai@4 fixes --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Toni Oriol <[email protected]> * 99 group chat history by monthyear (#111) * add grouping to chats * add last 30 days group * add last year group * refactor time functions * change function name * change func name * add tests + new grouping function * refactoring * add grouping to all chats ever made * add code fix * change function name * change type name * refactor * style code * add tests * catch future dates¨ * add final fixes * Setup test db (#132) * add test db in compose and gh actions * add test db setup script * move cleanDatabase to a helper file * rm unused test * adjustments to make it work * remove header param from playwright and add NODE_ENV=test in gh test action Also adjust DATABASE_URL in env example * install browsers with deps * fix seeds * add local llm support with ollama * add field validation wip * finish ollama model implementation * remove dupl code * remove whitespace * rm unused axios dept * fix: seed file imports * chore: update and organize deps * fix: team validations --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Toni Oriol <[email protected]> Co-authored-by: Erik Lindgren <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
You'll need to:
docker compose down --volumes && docker compose up -d
so the docker test db gets created.DATABASE_URL
in the.env
file. Copy the one from the.env.example
..env.test
copying.env.test.example
. The values are ok as they are in the.env.test.example
.Then you should be able to run
npm test
and the example test under/tests
should run and pass. Maybe you'll need to runnpx playwright update
or similar, as it will ask you in the console so it updates the browsers.