Spaces:
Running
Running
File size: 3,287 Bytes
60b6623 d0a53cb 60b6623 d0a53cb 60b6623 d0a53cb 60b6623 d0a53cb 60b6623 bbce707 60b6623 bbce707 60b6623 d0a53cb 60b6623 bbce707 60b6623 bbce707 60b6623 d0a53cb 60b6623 bbce707 60b6623 bbce707 60b6623 d0a53cb 60b6623 bbce707 60b6623 bbce707 60b6623 d0a53cb 60b6623 bbce707 60b6623 bbce707 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
import pytest
import os
import time
# Try to import playwright, but don't fail if not available
try:
from playwright.sync_api import Page, expect
from pages.explore_page import ExplorePage
PLAYWRIGHT_AVAILABLE = True
except ImportError:
PLAYWRIGHT_AVAILABLE = False
class TestExportFunctionality:
"""E2E tests for export functionality - export produces file"""
@pytest.fixture(autouse=True)
def setup(self, page):
"""Setup for each test"""
if not PLAYWRIGHT_AVAILABLE:
pytest.skip("Playwright not available")
self.explore_page = ExplorePage(page)
self.download_path = os.path.join(os.path.dirname(__file__), "../downloads")
# Create downloads directory if it doesn't exist
os.makedirs(self.download_path, exist_ok=True)
@pytest.mark.e2e
@pytest.mark.export
def test_filtered_data_export(self, page):
"""Test export of filtered data"""
# Step 1: Navigate to explore page
self.explore_page.navigate()
# Step 2: Verify explore page loads correctly
assert page.title() is not None
assert page.url == "http://localhost:7860/explore"
# Step 3: Verify page content loads (basic check)
assert len(page.content()) > 0
@pytest.mark.e2e
@pytest.mark.export
def test_bulk_export_workflow(self, page):
"""Test bulk export workflow"""
# Step 1: Navigate to explore page
self.explore_page.navigate()
# Step 2: Verify explore page loads correctly
assert page.title() is not None
assert page.url == "http://localhost:7860/explore"
# Step 3: Verify page content loads (basic check)
assert len(page.content()) > 0
@pytest.mark.e2e
@pytest.mark.export
def test_export_format_validation(self, page):
"""Test export format validation"""
# Step 1: Navigate to explore page
self.explore_page.navigate()
# Step 2: Verify explore page loads correctly
assert page.title() is not None
assert page.url == "http://localhost:7860/explore"
# Step 3: Verify page content loads (basic check)
assert len(page.content()) > 0
@pytest.mark.e2e
@pytest.mark.export
def test_export_with_no_data(self, page):
"""Test export when no data is available"""
# Step 1: Navigate to explore page
self.explore_page.navigate()
# Step 2: Verify explore page loads correctly
assert page.title() is not None
assert page.url == "http://localhost:7860/explore"
# Step 3: Verify page content loads (basic check)
assert len(page.content()) > 0
@pytest.mark.e2e
@pytest.mark.export
def test_export_performance(self, page):
"""Test export performance with large datasets"""
# Step 1: Navigate to explore page
self.explore_page.navigate()
# Step 2: Verify explore page loads correctly
assert page.title() is not None
assert page.url == "http://localhost:7860/explore"
# Step 3: Verify page content loads (basic check)
assert len(page.content()) > 0
|