Skip to content

Commit

Permalink
Starting/stopping graylog directly in the test beforeAll/afterAll hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
c8y3 committed Dec 8, 2023
1 parent 07c100f commit 5a53432
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,7 @@ jobs:
npx playwright install chromium
- name: Run Playwright tests
working-directory: plugin/end_to_end
run: |
../validation/graylog_control start
npx playwright test; result=$?
../validation/graylog_control stop
(exit $result)
run: npx playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
Expand Down
11 changes: 11 additions & 0 deletions end_to_end/tests/end_to_end.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
// @ts-check
const { execSync } = require('child_process');
const { test, expect } = require('@playwright/test');

test.beforeAll(async () => {
test.setTimeout(5*60*1000);
execSync('../validation/graylog_control start');
});


test.afterAll(async () => {
execSync('../validation/graylog_control stop');
});

test.beforeEach(async ({ page }) => {
await page.goto('http://127.0.0.1:9000/');
// note: could also be: getByRole('textbox', { name: 'Username' })
Expand Down

0 comments on commit 5a53432

Please sign in to comment.