diff --git a/docs/browser-local-storage.md b/docs/browser-local-storage.md new file mode 100644 index 0000000..279120b --- /dev/null +++ b/docs/browser-local-storage.md @@ -0,0 +1,362 @@ +# πŸ—„οΈ Browser local storage + +Configure and upload browser local storage data to ensure your tests run with the necessary application state and user preferences. + +## Overview + +Browser local storage is crucial for testing web applications that rely on client-side data persistence. Wopee.io allows you to upload and configure local storage data that will be available during test execution, ensuring tests run with realistic application states. + +## What is browser local storage? + +Local storage is a web storage mechanism that allows web applications to store data locally within a user's browser. This data includes: + +- **User preferences**: Theme settings, language choices, display options +- **Authentication tokens**: Session tokens, API keys, refresh tokens +- **Application state**: Shopping cart contents, form data, user progress +- **Cache data**: Frequently accessed information, user-specific configurations + +## Supported storage types + +Wopee.io AI Agent automatically loads data from the `data` directory. It is based on Playwright's [browser context](https://playwright.dev/docs/test-state#browser-context) and supports multiple browser storage mechanisms: + +### localStorage + +Key-value pairs stored persistently in the browser. + +### sessionStorage + +Temporary storage that lasts for the duration of the page session. + +### Cookies + +Small pieces of data stored by the browser for specific domains. + +### IndexedDB + +More complex database storage for larger amounts of structured data. + +## How to upload local storage data: JSON Context File + +Upload a complete browser context file to your repository's `data` directory. The AI testing agent will automatically detect and apply this storage state. + +Create a file named `auth.json` in your `data` directory (example): + +```json +{ + "cookies": [ + { + "name": "session-username", + "value": "standard_user", + "domain": "www.saucedemo.com", + "path": "/", + "expires": 1752609084, + "httpOnly": false, + "secure": false, + "sameSite": "Lax" + } + ], + "origins": [ + { + "origin": "https://www.saucedemo.com", + "localStorage": [ + { + "name": "backtrace-guid", + "value": "b6ff9051-63fb-49f5-9ce9-7706db9c4960" + }, + { + "name": "backtrace-last-active", + "value": "1752608467035" + } + ] + } + ] +} +``` + +## File organization in your repository + +### Repository structure + +Place your browser context files in the `data` directory of your repository: + +``` +your-repository/ +β”œβ”€β”€ data/ +β”‚ └── auth.json # Authentication context +β”œβ”€β”€ tests/ +└── src/ +``` + +### Naming conventions + +- Use file name: `auth.json` +- The agent automatically loads the the JSON file + +## Storage data formats + +### Origin-based localStorage format + +The recommended format organizes storage by domain origin: + +```json +{ + "origins": [ + { + "origin": "https://example.com", + "localStorage": [ + { + "name": "user_id", + "value": "12345" + }, + { + "name": "settings", + "value": "{\"theme\": \"dark\", \"notifications\": true}" + } + ] + } + ] +} +``` + +### Cookies configuration + +Cookies are specified in an array with detailed properties: + +```json +{ + "cookies": [ + { + "name": "auth_session", // Cookie name + "value": "encrypted_session_data", // Cookie value + "domain": ".myapp.com", // Domain scope + "path": "/", // Path scope + "expires": 1752609084, // Unix timestamp + "secure": true, // HTTPS only + "httpOnly": false, // JavaScript accessible + "sameSite": "Lax" // SameSite policy + } + ] +} +``` + +### IndexedDB data + +Complex structured data for IndexedDB: + +```javascript +{ + "databases": [ + { + "name": "MyAppDB", + "version": 1, + "stores": [ + { + "name": "users", + "data": [ + {"id": 1, "name": "John Doe", "email": "john@example.com"}, + {"id": 2, "name": "Jane Smith", "email": "jane@example.com"} + ] + } + ] + } + ] +} +``` + +## Using storage data in tests + +### Automatic detection and application + +When you commit a JSON context file to your repository's `data` directory: + +1. **Automatic detection**: The AI agent scans the `data` directory for JSON files during test initialization +2. **Context loading**: When found, the agent logs "Browser storage state found and to be uploaded" +3. **Browser initialization**: A new browser context is created with the pre-configured storage state +4. **State persistence**: All cookies, localStorage, and sessionStorage remain available throughout the test session +5. **Cross-domain support**: Storage data is applied per origin, supporting multi-domain applications + +This seamless integration means tests automatically start with your configured authentication, user preferences, and application state. + +### Practical example: Setting up authentication + +1. **Create the context file**: Add `auth.json` to your `data` directory: + +```json +{ + "cookies": [ + { + "name": "session-username", + "value": "standard_user", + "domain": "www.saucedemo.com", + "path": "/", + "expires": 1752609084, + "httpOnly": false, + "secure": false, + "sameSite": "Lax" + } + ], + "origins": [ + { + "origin": "https://www.saucedemo.com", + "localStorage": [ + { + "name": "user-session", + "value": "authenticated" + }, + { + "name": "user-role", + "value": "standard" + } + ] + } + ] +} +``` + +2. **Run your tests**: The AI agent will automatically detect this file and initialize the browser with this authentication state + +3. **Tests start authenticated**: Your tests begin as if the user is already logged in, skipping login steps + +## Common use cases + +### Authentication testing + +Pre-configure authentication tokens and user sessions: + +```json +{ + "localStorage": { + "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", + "refresh_token": "def456ghi789jkl012mno345pqr678stu901", + "user_profile": "{\"id\": 123, \"role\": \"admin\", \"permissions\": [\"read\", \"write\"]}" + }, + "cookies": [ + { + "name": "session_id", + "value": "secure_session_hash", + "domain": ".myapp.com", + "secure": true, + "httpOnly": true + } + ] +} +``` + +### E-commerce testing + +Set up shopping cart and user preferences: + +```json +{ + "localStorage": { + "shopping_cart": "{\"items\": [{\"product_id\": 456, \"quantity\": 2, \"price\": 29.99}], \"total\": 59.98}", + "user_preferences": "{\"currency\": \"USD\", \"shipping_address\": \"123 Main St\"}", + "recently_viewed": "[456, 789, 123, 654]", + "wishlist": "[789, 321, 555]" + } +} +``` + +### Application state testing + +Configure complex application states: + +```json +{ + "localStorage": { + "app_state": "{\"current_page\": \"dashboard\", \"sidebar_collapsed\": false}", + "user_settings": "{\"theme\": \"dark\", \"language\": \"en\", \"timezone\": \"UTC\"}", + "feature_flags": "{\"beta_ui\": true, \"advanced_features\": false}", + "cache_timestamp": "2024-01-15T10:30:00Z" + }, + "sessionStorage": { + "form_data": "{\"step\": 3, \"completed_steps\": [1, 2]}", + "temp_calculations": "{\"total\": 1250.50, \"tax\": 125.05}" + } +} +``` + +## Best practices + +!!! tip "Local storage best practices" + + - **Data consistency**: Ensure storage data matches your application's expected format + - **Token validity**: Use valid, non-expired authentication tokens + - **Minimal data**: Include only necessary data to avoid bloating + - **Security**: Avoid real user credentials in test storage data + - **Versioning**: Maintain different storage configurations for different test scenarios + +## Environment-specific configurations + +### Development environment + +```json +{ + "localStorage": { + "api_endpoint": "https://dev-api.myapp.com", + "debug_mode": "true", + "log_level": "debug" + } +} +``` + +### Staging environment + +```json +{ + "localStorage": { + "api_endpoint": "https://staging-api.myapp.com", + "debug_mode": "false", + "log_level": "info" + } +} +``` + +### Production-like testing + +```json +{ + "localStorage": { + "api_endpoint": "https://api.myapp.com", + "debug_mode": "false", + "log_level": "error" + } +} +``` + +## Troubleshooting + +### Storage not applied + +- Verify JSON format is valid +- Check that domain settings match your application +- Ensure storage keys match application expectations + +### Authentication issues + +- Validate token format and expiration +- Check cookie domain and path settings +- Verify authentication flow compatibility + +### Data format errors + +- Ensure nested JSON is properly escaped +- Validate data types match application requirements +- Check for special characters in values + +### Performance issues + +- Reduce storage data size if tests are slow +- Avoid large IndexedDB datasets +- Clean up unnecessary storage entries + +!!! warning "Security considerations" + + - Never use real user credentials in test storage data + - Avoid storing sensitive information in plain text + - Use test-specific tokens and session data + - Regularly rotate test authentication data + +!!! note "Need help?" + + For browser storage configuration issues, contact our support team at [help@wopee.io](mailto:help@wopee.io) or visit our [community discussions](https://github.com/orgs/Wopee-io/discussions). diff --git a/docs/download-files.md b/docs/download-files.md new file mode 100644 index 0000000..bcf59c1 --- /dev/null +++ b/docs/download-files.md @@ -0,0 +1,296 @@ +# πŸ“₯ Download files + +Test your web application's file download functionality to ensure users can successfully download files, reports, and other content. + +## Overview + +File downloads are a common feature in web applications, from document exports to media downloads. Wopee.io helps you test these download functionalities to ensure they work correctly across different browsers and scenarios. + +## Types of downloadable files to test + +### Common web app downloads + +- **Documents**: PDFs, Word documents, spreadsheets, presentations +- **Reports**: Generated reports, analytics exports, user data exports +- **Media files**: Images, videos, audio files, graphics +- **Data exports**: CSV files, JSON exports, database backups +- **Software**: Installers, updates, mobile apps +- **Templates**: Document templates, configuration files + +### Dynamic vs static downloads + +- **Static files**: Pre-existing files stored on the server +- **Dynamic files**: Generated on-demand based on user data or requests +- **Streaming downloads**: Large files downloaded in chunks +- **Authenticated downloads**: Files requiring login or permissions + +## How to test file downloads + +### Creating download tests with AI + +Use prompts to generate tests that verify download functionality: + +!!! tip "Use prompt for download testing" + + Create tests that verify file download functionality with specific prompts. + + ```prompt + Create test with following steps: + + - Navigate to `https://example.com/reports` + - Click the "Download PDF Report" button + - Verify that a PDF file was downloaded + - Check that the downloaded file is not empty + ``` + +### Manual test creation + +1. Navigate to your project in [Wopee Commander](https://cmd.wopee.io): Project > Analysis > Test +2. Click "Add new user story" or "Add new test" for existing user story +3. Add steps that include download interactions: + - Click download buttons or links + - Verify download completion + - Check file properties (size, format, content) +4. Save and run the test + +### Testing different download scenarios + +Create comprehensive tests for various download patterns: + +#### Direct download links + +```prompt +Test direct file download: +- Navigate to `https://example.com/files` +- Click on "sample-document.pdf" link +- Verify PDF file downloads successfully +- Check file size is greater than 0 bytes +``` + +#### Form-based downloads + +```prompt +Test report generation and download: +- Navigate to `https://example.com/reports` +- Select date range from "2024-01-01" to "2024-01-31" +- Click "Generate Report" button +- Wait for report generation +- Click "Download Report" button +- Verify CSV file downloads with correct data +``` + +## Download verification methods + +### What to verify in download tests + +When testing file downloads, verify these aspects: + +=== "File Properties" + + ```prompt + Verify download properties: + - Check that file was downloaded + - Verify file size is greater than 0 bytes + - Confirm correct file extension (.pdf, .csv, .xlsx) + - Check filename matches expected pattern + ``` + +=== "File Content" + + ```prompt + Verify download content: + - Open downloaded PDF and check it contains data + - Verify CSV has correct headers and data rows + - Check image files display correctly + - Confirm document formatting is preserved + ``` + +=== "Download Timing" + + ```prompt + Test download performance: + - Measure time from click to download completion + - Verify download doesn't timeout + - Check progress indicators work correctly + - Test download cancellation functionality + ``` + +## AI testing agent for downloads + +### Automatic download handling + +When using AI testing agent, file downloads are automatically handled: + +- **Download detection**: Automatically detects when downloads are triggered +- **File verification**: Checks that files are successfully downloaded +- **Content validation**: Basic verification that files contain data +- **Format checking**: Confirms file extensions match expected types + +The AI agent will automatically: + +- Click download buttons and links +- Wait for download completion +- Verify downloaded files exist +- Check basic file properties (size, format) +- Report download success or failure + +### Advanced download testing + +For more complex download scenarios, use specific prompts: + +#### Testing authenticated downloads + +```prompt +Test secure file download: +- Login with username "testuser" and password "password123" +- Navigate to "My Documents" section +- Click "Download Confidential Report" +- Verify PDF downloads successfully +- Logout and verify download link no longer works +``` + +#### Testing bulk downloads + +```prompt +Test multiple file download: +- Navigate to file gallery +- Select 3 images using checkboxes +- Click "Download Selected" button +- Verify ZIP file downloads containing all 3 images +- Extract ZIP and confirm all files are present +``` + +#### Testing download permissions + +```prompt +Test download access control: +- Login as regular user +- Navigate to admin reports section +- Attempt to download "Admin Only Report" +- Verify access denied message appears +- Login as admin user +- Verify same report downloads successfully +``` + +## Download test scenarios + +### E-commerce downloads + +Test digital product delivery and receipts: + +```prompt +Test digital product download: +- Add digital product to cart +- Complete purchase process +- Go to "My Downloads" page +- Click download link for purchased item +- Verify digital product file downloads +- Test download limit restrictions +``` + +### Report generation testing + +Test dynamic report creation: + +```prompt +Test custom report generation: +- Navigate to analytics dashboard +- Select "Last 30 days" date range +- Choose "Sales Report" type +- Click "Generate Report" button +- Wait for "Report Ready" notification +- Click "Download Report" button +- Verify Excel file downloads with correct data +``` + +### Media download testing + +Test image and video downloads: + +```prompt +Test media gallery downloads: +- Navigate to photo gallery +- Click on high-resolution image +- Click "Download Original" button +- Verify high-quality image downloads +- Check file size is larger than thumbnail +- Test download of different image formats +``` + +## Best practices + +!!! tip "Download testing best practices" + + - **Test different file types**: Verify downloads work for PDFs, images, documents, etc. + - **Check file integrity**: Ensure downloaded files are not corrupted + - **Test download limits**: Verify restrictions on file size, download attempts, etc. + - **Browser compatibility**: Test downloads across different browsers + - **Network conditions**: Test downloads with slow/unstable connections + - **Authentication**: Verify download permissions and access controls + +## Common download patterns to test + +### Direct download links + +- Static files linked directly from pages +- Right-click "Save As" functionality +- Download progress indicators + +### Generated file downloads + +- Reports created on-demand +- Export functionality from databases +- Customized documents based on user input + +### Authenticated downloads + +- Login-protected files +- Role-based download permissions +- Session-dependent file access + +### Bulk download operations + +- Multiple file selection and download +- ZIP archive creation and download +- Batch export functionality + +## Troubleshooting download tests + +### Download not working + +- Check if download button/link is correctly identified +- Verify the element selector is accurate +- Ensure download triggers are properly clicked +- Check for JavaScript-based download mechanisms + +### Download verification fails + +- Increase wait time for large file downloads +- Check if download location is accessible +- Verify file naming patterns match expectations +- Ensure browser download settings allow automatic downloads + +### Authentication issues + +- Verify login credentials are correct +- Check if session hasn't expired during test +- Ensure user has proper permissions for file access +- Test download links work manually first + +### Browser-specific issues + +- Some browsers block automatic downloads +- Different browsers have different download behaviors +- Test across multiple browser types +- Check browser download directory settings + +!!! warning "Testing considerations" + + - Large files may timeout during automated tests + - Some download types require specific browser configurations + - Network speed affects download test reliability + - Browser popup blockers may interfere with downloads + +!!! note "Need help?" + + For download testing issues, contact support at [help@wopee.io](mailto:help@wopee.io) or check our [community discussions](https://github.com/orgs/Wopee-io/discussions). diff --git a/docs/img/guides/upload-files/add-stories.png b/docs/img/guides/upload-files/add-stories.png new file mode 100644 index 0000000..d86ce4e Binary files /dev/null and b/docs/img/guides/upload-files/add-stories.png differ diff --git a/docs/img/guides/upload-files/new-test-upload-file.png b/docs/img/guides/upload-files/new-test-upload-file.png new file mode 100644 index 0000000..9fa65fb Binary files /dev/null and b/docs/img/guides/upload-files/new-test-upload-file.png differ diff --git a/docs/img/guides/upload-files/prompt-new-test.png b/docs/img/guides/upload-files/prompt-new-test.png new file mode 100644 index 0000000..32e9e92 Binary files /dev/null and b/docs/img/guides/upload-files/prompt-new-test.png differ diff --git a/docs/project-context.md b/docs/project-context.md new file mode 100644 index 0000000..776752d --- /dev/null +++ b/docs/project-context.md @@ -0,0 +1,328 @@ +# 🌍 Project context + +Configure global instructions and context that guide the AI testing agent's behavior across all tests in your project. + +## Overview + +Global project context provides a way to give the AI testing agent specific instructions, preferences, and contextual information about your application. These instructions are automatically loaded and applied whenever the Wopee.io AI testing agent executes tests. + +## What is global context? + +Global project context includes: + +- **Testing instructions**: Specific guidance on how tests should be performed +- **Application behavior**: How your application works and what to expect +- **User interaction preferences**: Language, formatting, and interaction style +- **Business rules**: Domain-specific requirements and constraints +- **Testing scenarios**: Common patterns and workflows in your application + +## How to set up project context + +### Creating the context file + +Create a `project-context.md` file in your repository's `data` directory. The AI testing agent will automatically load and apply these instructions during test execution. + +``` +your-repository/ +β”œβ”€β”€ data/ +β”‚ β”œβ”€β”€ project-context.md # Global instructions for AI agent +β”‚ └── auth.json # Browser storage context +β”œβ”€β”€ tests/ +└── src/ +``` + +### Basic context structure + +The `project-context.md` file uses simple markdown format to provide instructions: + +```markdown +# Project Context for AI Testing Agent + +## Application Information + +This is an e-commerce platform for selling organic products. + +## Testing Instructions + +- All form inputs should be filled in Spanish +- Use emojis extensively in text fields where appropriate +- Always use EUR currency for currency fields + +## Application Behavior + +- Product search results appear after typing 3+ characters +- Shopping cart updates immediately when items are added +- When user is logged in, there is avatar and user initials in the top left corner of the page +- When user is not logged in, there is login button in the top right corner of the page +- When user is logged in, there is logout button in the top right corner of the page +``` + +## Real-world context examples + +### E-commerce platform + +```markdown +# Project Context for AI Testing Agent + +## Application Information + +This is a luxury fashion e-commerce platform targeting Spanish-speaking customers. + +## Testing Instructions + +- Always fill forms in Spanish (e.g., "Juan GarcΓ­a" for names, "Calle Mayor 123" for addresses) +- Use appropriate Spanish email formats: usuario@ejemplo.es +- Select "EspaΓ±a" as country and "EUR" as currency +- Use fashion-related emojis when filling product reviews: βœ¨πŸ‘—πŸ›οΈπŸ’Ž + +## Application Behavior + +- Product images take 2-3 seconds to load due to high resolution +- Size charts appear as overlays when clicking "GuΓ­a de tallas" +- Free shipping banner shows only for orders over €50 +- Guest checkout requires email verification step + +## Business Rules + +- VIP customers (loyalty tier "Oro") get 24h early access to sales +- Returns are only available for 30 days, except for undergarments +- International shipping is disabled for leather products +``` + +### Banking application + +```markdown +# Project Context for AI Testing Agent + +## Application Information + +This is a mobile banking app for a German financial institution. + +## Testing Instructions + +- Use German formatting for amounts: 1.234,56 € (dot for thousands, comma for decimals) +- Fill dates in DD.MM.YYYY format +- Use German addresses: "Hauptstraße 45, 10115 Berlin" +- IBAN validation requires DE country code format + +## Application Behavior + +- All transactions require 2FA via SMS or authenticator app +- Account balance updates may take 10-15 seconds after transactions +- PDF statements are generated asynchronously - wait for email notification +- Session timeout occurs after 15 minutes of inactivity + +## Security Requirements + +- Never use real account numbers - use test IBANs starting with DE89370400440532013000 +- Sensitive actions trigger additional PIN verification +- Transaction history shows only last 90 days by default +``` + +### Healthcare platform + +```markdown +# Project Context for AI Testing Agent + +## Application Information + +This is a patient portal for a healthcare provider with HIPAA compliance requirements. + +## Testing Instructions + +- Use realistic but fake medical data: "Type 2 Diabetes", "Hypertension" +- Patient names should follow format: "LastName, FirstName MiddleInitial" +- Use medical terminology correctly: "Prescription" not "Medicine" +- Always verify privacy notices are displayed before entering sensitive data + +## Application Behavior + +- Medical history loads in paginated chunks of 10 records +- Prescription refill requests require pharmacy selection +- Appointment scheduling shows availability 2 weeks in advance +- Lab results appear with 24-48 hour delay after tests + +## Compliance Requirements + +- All test data must be clearly marked as "TEST PATIENT - NOT REAL" +- Screenshots cannot contain any identifiable information +- Session expires after 20 minutes for security +- Audit logs are generated for all data access +``` + +### Educational platform + +```markdown +# Project Context for AI Testing Agent + +## Application Information + +This is a learning management system for K-12 education with multilingual support. + +## Testing Instructions + +- Use age-appropriate student names: "Emma Thompson", "Liam Johnson" +- Fill assignment submissions with educational content, not lorem ipsum +- Use encouraging emojis in feedback: πŸ“šβœοΈβ­πŸŽ“ +- Select appropriate grade levels: "Grade 3", "Grade 7", etc. + +## Application Behavior + +- Video lessons buffer for 5-10 seconds before playing +- Quiz auto-saves every 30 seconds +- Grade calculations update overnight (not real-time) +- Parent notifications are sent via email and SMS + +## Educational Requirements + +- Content must be age-appropriate for selected grade level +- Assignments have due dates that affect late penalty calculations +- Student progress tracking includes time spent on activities +- Accessibility features must work with screen readers +``` + +## How the AI agent uses project context + +### Automatic loading + +When you place a `project-context.md` file in your repository's `data` directory, the AI testing agent automatically: + +1. **Loads instructions** during test initialization +2. **Applies context** to all testing decisions and actions +3. **Follows preferences** for language, formatting, and interaction style +4. **Respects business rules** and application-specific behavior +5. **Maintains consistency** across all test executions + +### Context application examples + +If your context specifies "All inputs should be in Spanish", the agent will: + +- Fill name fields with "MarΓ­a GonzΓ‘lez" instead of "John Doe" +- Use Spanish addresses: "Calle Principal 123, Madrid" +- Select Spanish language options in dropdowns +- Write Spanish text in comment fields and reviews + +### Context-aware testing benefits + +With project context in place, your AI testing becomes: + +- **Culturally appropriate**: Tests use correct language, formats, and cultural conventions +- **Domain-specific**: Agent understands your business terminology and processes +- **Consistent**: All tests follow the same guidelines and preferences +- **Realistic**: Test data matches your actual user patterns and requirements + +## Context organization tips + +### Structuring your context file + +Organize your `project-context.md` file in clear sections: + +```markdown +# Project Context for AI Testing Agent + +## Application Information + +Brief description of your application and its purpose. + +## Testing Instructions + +- Specific guidelines for how tests should be performed +- Language and formatting preferences +- Data entry requirements + +## Application Behavior + +- How your application works and responds +- Timing expectations and loading behaviors +- Special features or interactions + +## Business Rules + +- Domain-specific requirements +- Validation rules and constraints +- Workflow requirements + +## Error Handling + +- Expected error messages and how to handle them +- Recovery procedures for failed operations +``` + +## Best practices + +!!! tip "Project context best practices" + + - **Be specific**: Provide clear, actionable instructions rather than vague guidelines + - **Use examples**: Include concrete examples of preferred data formats and values + - **Keep updated**: Regularly review and update context as your application evolves + - **Test your context**: Verify that the AI agent correctly applies your instructions + - **Version control**: Track context changes alongside your code changes + +## Common context patterns + +### Language and localization + +```markdown +## Testing Instructions + +- All form inputs should be in French +- Use French date format: DD/MM/YYYY +- Currency should always be EUR with French formatting: 1 234,56 € +- Use French postal codes: 75001, 69001, etc. +- Select "France" as country in all dropdowns +``` + +### Industry-specific terminology + +```markdown +## Application Behavior + +- Medical appointments are called "consultations" +- Use ICD-10 codes for diagnoses: E11.9 for diabetes +- Patient consent forms must be acknowledged before proceeding +- Insurance verification takes 30-45 seconds to process +``` + +### UI interaction preferences + +```markdown +## Testing Instructions + +- Use emojis extensively in social media posts: πŸŽ‰βœ¨πŸ’πŸŒŸ +- Fill bio fields with creative, personality-rich content +- Use hashtags in relevant fields: #fashion #style #trendy +- Profile photos should represent diverse demographics +``` + +## Troubleshooting + +### Context not being applied + +- Verify `project-context.md` file exists in the `data` directory +- Check markdown syntax is valid +- Ensure file is committed to your repository +- Confirm the AI agent can access the file during test execution + +### Instructions not being followed + +- Make instructions more specific and actionable +- Add concrete examples of expected behavior +- Check for conflicting instructions within the context +- Test with simpler instructions first, then add complexity + +### File organization issues + +- Ensure file is named exactly `project-context.md` +- Verify the file is in the correct `data` directory path +- Check file permissions allow reading + +!!! warning "Context considerations" + + - Avoid including sensitive information in context files + - Keep instructions clear and unambiguous + - Test context changes in a development environment first + - Remember that context affects all tests in the project + +!!! note "Need help?" + + For project context configuration issues, contact our support team at [help@wopee.io](mailto:help@wopee.io) or visit our [community discussions](https://github.com/orgs/Wopee-io/discussions). diff --git a/docs/upload-files.md b/docs/upload-files.md new file mode 100644 index 0000000..244bb02 --- /dev/null +++ b/docs/upload-files.md @@ -0,0 +1,196 @@ +# πŸ“ Upload files + +Upload files to your testing environment to ensure your tests can interact with file upload functionality in your web application. + +## Overview + +File uploads are a common feature in web applications. Wopee.io allows you to upload files that your tests can use during test execution, ensuring realistic testing scenarios for file upload workflows. + +## Supported file types + +There is no limit on the file types you can upload. + +## How to upload files + +Files used for testing should be stored in GitHub. + +1. Upload files to the `data` directory in your GitHub repository. +2. Create new step manually, generate new test or modify existing test step in Commander UI. +3. Run the test. + +### Creating tests with file uploads + +You can create tests that use file uploads in several ways: + +#### Method 1: Using AI prompt to generate new test + +Create new user story and use prompt to generate test that uses file upload. + +![Add new user story](img/guides/upload-files/add-stories.png) + +!!! tip "Use prompt" + + Create new user story and use prompt to generate test that use file upload. + + ```prompt + Create test with following steps: + + - Navigate to `https://the-internet.herokuapp.com/upload` + - Upload file `wopee.png` + - Verify that the message `File Uploaded!` was displayed. + ``` + + ![Generate test with prompt](img/guides/upload-files/prompt-new-test.png) + +#### Method 2: Manual test creation + +You can also create tests manually that include file upload steps: + +![Create new test with file upload](img/guides/upload-files/new-test-upload-file.png) + +1. Navigate to your project in [Wopee Commander](https://cmd.wopee.io): Project > Analysis > Test +2. Click "Add new user story" or "Add new test" for existing user story +3. Add steps that include file upload interactions +4. Reference your uploaded files by their filename or relative path. +5. Save and run the test. + +## File management + +### Organizing uploaded files + +- Files are organized by project +- If you use files heavily consider using a folder structure in your `data` directory +- Files can be referenced in tests by their filename or relative path +- Maximum file size limit: 100MB per file (GitHub limit) + +### File naming conventions + +For better organization: + +- Use descriptive names: `sample-document.pdf` instead of `file1.pdf` +- Avoid special characters and spaces in filenames +- Use lowercase with hyphens: `test-image-large.jpg` +- Consider using folders: `data/images/product-photo.jpg`, `data/documents/sample.pdf` + +### Folder structure example + +``` +your-repository/ +β”œβ”€β”€ data/ +β”‚ β”œβ”€β”€ images/ +β”‚ β”‚ β”œβ”€β”€ wopee.png +β”‚ β”‚ β”œβ”€β”€ product-photo.jpg +β”‚ β”‚ └── user-avatar.png +β”‚ β”œβ”€β”€ documents/ +β”‚ β”‚ β”œβ”€β”€ sample.pdf +β”‚ β”‚ β”œβ”€β”€ test-invoice.pdf +β”‚ β”‚ └── user-manual.docx +β”‚ └── archives/ +β”‚ β”œβ”€β”€ backup.zip +β”‚ └── export-data.csv +``` + +## Using uploaded files in tests + +### AI testing agent + +When using AI testing agent, uploaded files are automatically detected and can be used for: + +- Form submissions with file inputs +- Document processing workflows +- Image upload validation +- Multi-file upload scenarios + +The AI agent will automatically: + +- Locate file input fields on the page +- Select the appropriate file from your data directory +- Handle the upload process +- Verify upload completion + +## Best practices + +!!! tip "File upload best practices" + + - **Test with realistic files**: Use files similar to what your users would upload + - **Vary file sizes**: Test with small and large files to ensure proper handling + - **Test different formats**: Upload various file types to validate format restrictions + - **Organize with folders**: Use a clear folder structure in your `data` directory + - **Descriptive naming**: Use clear, descriptive filenames for easy identification + - **Version control**: Keep test files in your repository for consistency across environments + +## Common use cases + +### E-commerce applications + +- Product image uploads +- Customer document verification +- Bulk product catalog imports + +### Content management systems + +- Media file uploads +- Document publishing workflows +- User avatar uploads + +### Business applications + +- Report uploads +- Data import functionality +- Compliance document submissions + +## File upload test scenarios + +### Single file upload + +```prompt +Test single file upload: +- Navigate to upload page +- Select file `test-document.pdf` +- Click upload button +- Verify success message appears +``` + +### Multiple file upload + +```prompt +Test multiple file upload: +- Navigate to multi-upload page +- Select files `image1.jpg`, `image2.png`, `document.pdf` +- Upload all files +- Verify all files appear in upload list +``` + +### File format validation + +```prompt +Test file format restrictions: +- Try uploading unsupported file type `script.exe` +- Verify error message about invalid format +- Upload supported file `image.jpg` +- Verify successful upload +``` + +## Troubleshooting + +### Upload fails + +- Check file size (must be ≀ 100MB for GitHub) +- Verify file exists in your repository's `data` directory +- Ensure file path is correct (case-sensitive) + +### File not found in tests + +- Verify file was committed to your GitHub repository +- Check file path reference in test (relative to `data` directory) +- Ensure file name matches exactly (case-sensitive) + +### Performance issues + +- Large files may take longer to upload during tests +- Consider using smaller test files for faster execution +- Monitor GitHub repository size limits + +!!! note "Need help?" + + If you encounter issues with file uploads, contact our support team at [help@wopee.io](mailto:help@wopee.io) or visit our [community discussions](https://github.com/orgs/Wopee-io/discussions). diff --git a/mkdocs.yml b/mkdocs.yml index 44b05fd..999f078 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -16,6 +16,11 @@ nav: - Manual setup: robot-framework/02-manual-setup.md - Setup with make: robot-framework/03-setup-with-make.md - Examples: robot-framework/04-some-more-examples.md + - Guides: + - πŸ“ Upload files: upload-files.md + - πŸ“₯ Download files: download-files.md + - πŸ—„οΈ Browser local storage: browser-local-storage.md + - 🌐 Project context: project-context.md - Other docs: - πŸ“– Glossary: glossary.md