Skip to content

Commit

Permalink
increase timeout (#228)
Browse files Browse the repository at this point in the history
* increase timeout

* Update test-ci.yml

* Update playwright.config.ts

* Update test-ci.yml

* Update 01-signup.spec.ts
  • Loading branch information
younes200 authored Nov 9, 2023
1 parent 20c8671 commit 40ff92a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/test-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI Testing
name: E2E Tests

on:
push:
Expand All @@ -16,28 +16,48 @@ jobs:
redis:
image: redis
ports:
- "0.0.0.0:6379:6379"
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: celluloid
ports:
- "0.0.0.0:5432:5432"
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- name: Checkout
uses: actions/checkout@v2


- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn

- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: install package
run: |
cp .env.ci .env
Expand Down
6 changes: 5 additions & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,18 @@ export default defineConfig({
/* Run your local dev server before starting the tests */
webServer: [
{
command: 'yarn prisma prisma migrate deploy && CI_TEST=true yarn backend start',
command: 'yarn prisma migrate deploy && CI_TEST=true yarn backend start',
url: 'http://localhost:2021',
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
stdout: 'ignore',
stderr: 'pipe'
},
{
command: 'yarn frontend start',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
stdout: 'ignore',
stderr: 'pipe'
}]
});
4 changes: 2 additions & 2 deletions tests/01-signup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ test('test user signup', async () => {

await page.getByTestId('submit').click();

await expect(page).toHaveURL(/.*\/confirm/, { timeout: 15000 });
await expect(page).toHaveURL(/.*\/confirm/);

await page.getByTestId('code').click();
await page.getByTestId('code').fill('0000');
await page.getByTestId('submit').click();

await expect(page).toHaveURL('http://localhost:3000/', { timeout: 15000 });
await expect(page).toHaveURL('http://localhost:3000/');

await page.getByTestId('header-account-menu').click();
await page.getByTestId('header-profile-button').click();
Expand Down

0 comments on commit 40ff92a

Please sign in to comment.