Skip to content

Commit

Permalink
Added missing files with python end to end tests
Browse files Browse the repository at this point in the history
  • Loading branch information
c8y3 committed Jan 3, 2024
1 parent 5af120c commit 8688139
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
# For backend tests in python
/validation/__pycache__/
/validation/venv/
/validation/end_to_end/__pycache__/
/validation/end_to_end/venv/

# IDE
.idea
1 change: 1 addition & 0 deletions validation/end_to_end/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest-playwright~=0.4
29 changes: 29 additions & 0 deletions validation/end_to_end/test_end_to_end.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from pytest import fixture
from graylog import Graylog

from playwright.sync_api import Page, expect


@fixture(scope="function", autouse=True)
def before_each_after_each(page: Page):
graylog = Graylog('../../runtime')
graylog.start()
graylog.configure_telemetry()

page.goto('http://127.0.0.1:9000/')
# note: could also be: getByRole('textbox', { name: 'Username' })
page.get_by_label('Username').fill('admin')
page.get_by_label('Password').fill('admin')
page.get_by_role('button', name='Sign in').click()

yield
graylog.stop()

def test_plugin_logging_alert_should_be_registered_issue_50(page: Page):
page.get_by_role('button', name='System').click()
page.get_by_role('menuitem', name='Configurations').click()
page.get_by_role('button', name='Plugins').click()

# note: could also be: await expect(page.getByText('Logging Alert')).toBeVisible();
expect(page.get_by_role('button', name='Logging')).to_have_text('Logging Alert')

15 changes: 0 additions & 15 deletions validation/graylog_control

This file was deleted.

0 comments on commit 8688139

Please sign in to comment.