An iOS demo project showcasing Quality Engineering (QE) best practices using XCtest, XCUITest, and SwiftUI.
This project demonstrates:
- 🧪 Unit Testing: Using XCtest for business logic validation.
- 🎯 UI Testing: Using XCUITest with Page Object Model (POM).
- 🔐 Environment Management: Using .env files for sensitive data.
- 🚦 Best Practices: Test organization, maintainability, and modularity.
- Xcode 14+ installed on macOS.
- iOS Simulator or a physical device.
- Git for version control.
git clone https://github.com/aovsiyenko/iOSQEDemo.git
cd iOSQEDemo
open iOSQEDemo.xcodeproj
- Select a simulator (e.g., iPhone 14).
- Press Command + R to build and run the app.
- Unit Tests:
Command + U
- UI Tests: Run from the Xcode Test Navigator or using the diamond icons next to test methods.
iOSQEDemo/
├─ Source/ # Main app code
├─ ViewModels/ # Business logic
├─ Tests/
│ ├─ UnitTests/ # Unit Tests with XCtest
│ └─ UITests/ # UI Tests with XCUITest
└─ .env # Environment variables
Command + U
- Navigate to LoginViewModelTests.swift under Tests/UnitTests.
- Go to Tests/UITests.
- Select LoginUITests.swift.
- Run all tests or individual tests using the diamond icon.
USERNAME=...
PASSWORD=...
INVALID_USERNAME=wronguser
INVALID_PASSWORD=wrongpassword
.env
- Centralized Test Data: Using .env files.
- Separation of Concerns: UI, business logic, and test code are separated.
- Code Reuse: Page Object Model (POM) for UI testing.
- Test Isolation: Each test method is independent.
Alex Ovsiyenko