test: Enable tests via playwright, disable interactive in CI

This commit is contained in:
Chris Coutinho
2025-10-14 01:23:38 +02:00
parent 37b0577bfd
commit 6ce411094c
4 changed files with 161 additions and 30 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ async def test_oauth_client_create_note(nc_oauth_client: NextcloudClient):
async def test_token_in_request_headers(
nc_oauth_client: NextcloudClient, interactive_oauth_token: str
nc_oauth_client: NextcloudClient, playwright_oauth_token: str
):
"""Verify that bearer token is being used in requests."""
# The client should be using BearerAuth
+8 -6
View File
@@ -10,24 +10,26 @@ pytestmark = [pytest.mark.integration, pytest.mark.oauth]
class TestOAuthInteractive:
"""Test interactive OAuth authentication."""
"""Test interactive OAuth authentication with manual browser login."""
async def test_oauth_client_with_interactive_flow(self, nc_oauth_client):
async def test_oauth_client_with_interactive_flow(
self, nc_oauth_client_interactive
):
"""Test that OAuth client created via interactive flow can access Nextcloud APIs."""
# Test 1: Check capabilities
capabilities = await nc_oauth_client.capabilities()
capabilities = await nc_oauth_client_interactive.capabilities()
assert capabilities is not None
logger.info("OAuth client (interactive) successfully fetched capabilities")
# Test 2: List notes
notes = await nc_oauth_client.notes.get_all_notes()
notes = await nc_oauth_client_interactive.notes.get_all_notes()
assert isinstance(notes, list)
logger.info(
f"OAuth client (interactive) successfully listed {len(notes)} notes"
)
# Test 3: Create and delete a note
test_note = await nc_oauth_client.notes.create_note(
test_note = await nc_oauth_client_interactive.notes.create_note(
title="OAuth Interactive Test Note",
content="This note was created during OAuth interactive testing",
)
@@ -37,5 +39,5 @@ class TestOAuthInteractive:
logger.info(f"OAuth client (interactive) successfully created note {note_id}")
# Clean up
await nc_oauth_client.notes.delete_note(note_id=note_id)
await nc_oauth_client_interactive.notes.delete_note(note_id=note_id)
logger.info(f"OAuth client (interactive) successfully deleted note {note_id}")