Compare commits
1 Commits
3b30119317
...
f0ba028d77
| Author | SHA1 | Date | |
|---|---|---|---|
| f0ba028d77 |
@@ -1,137 +0,0 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
const BASE_URL = process.env.BASE_URL || process.env.FRONTEND_URL || 'http://frontend:3000';
|
||||
|
||||
// Test credentials from globalSetup
|
||||
const ADMIN_USERNAME = 'admin';
|
||||
const ADMIN_PASSWORD = 'admin123';
|
||||
|
||||
test.describe('Full Workflow', () => {
|
||||
test('login -> create project -> create milestone -> create task/meeting/support -> logout', async ({ page }) => {
|
||||
// Step 1: Login
|
||||
console.log('🔐 Logging in...');
|
||||
await page.goto(`${BASE_URL}/login`);
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
await page.fill('input[type="text"], input[name="username"]', ADMIN_USERNAME);
|
||||
await page.fill('input[type="password"], input[name="password"]', ADMIN_PASSWORD);
|
||||
await page.click('button[type="submit"], button:has-text("Sign in")');
|
||||
|
||||
// Wait for navigation
|
||||
await page.waitForURL(`${BASE_URL}/**`, { timeout: 10000 });
|
||||
await page.waitForLoadState('networkidle');
|
||||
console.log('✅ Logged in');
|
||||
|
||||
// Step 2: Create Project
|
||||
console.log('📁 Creating project...');
|
||||
await page.goto(`${BASE_URL}/projects`);
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
// Click create project button - it's "+ New"
|
||||
await page.click('button:has-text("+ New")');
|
||||
await page.waitForSelector('form.inline-form', { timeout: 5000 });
|
||||
|
||||
// Fill project form
|
||||
const projectName = 'Test Project ' + Date.now();
|
||||
await page.fill('input[placeholder="Project name"]', projectName);
|
||||
await page.fill('textarea[placeholder="Description"]', 'Project for E2E testing');
|
||||
|
||||
// Submit project form
|
||||
await page.click('button:has-text("Create")');
|
||||
|
||||
// Wait for project to be created (and appear in the grid)
|
||||
await page.waitForSelector(`.project-card h3:has-text("${projectName}")`, { timeout: 10000 });
|
||||
console.log('✅ Project created');
|
||||
|
||||
// Step 3: Create Milestone
|
||||
console.log('🎯 Creating milestone...');
|
||||
await page.goto(`${BASE_URL}/milestones`);
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
// Wait for page to load
|
||||
await page.waitForSelector('h2:has-text("Milestones")', { timeout: 10000 });
|
||||
|
||||
// Select the newly created project in the filter
|
||||
await page.selectOption('select[aria-label="Project filter"]', { label: projectName });
|
||||
await page.waitForLoadState('networkidle');
|
||||
await page.waitForTimeout(1000); // Give it a moment to update
|
||||
|
||||
// Click create milestone button - it's "+ NewMilestones"
|
||||
await page.click('button:has-text("+ NewMilestones")');
|
||||
await page.waitForSelector('form', { timeout: 5000 });
|
||||
|
||||
// Fill milestone form
|
||||
const milestoneTitle = 'Test Milestone ' + Date.now();
|
||||
await page.fill('input[placeholder="Title"]', milestoneTitle);
|
||||
await page.fill('textarea[placeholder="Description"]', 'Milestone for E2E testing');
|
||||
|
||||
// Submit milestone form
|
||||
await page.click('button:has-text("Create")');
|
||||
|
||||
// Wait for milestone to be created
|
||||
await page.waitForSelector(`.milestone-card h3:has-text("${milestoneTitle}")`, { timeout: 10000 });
|
||||
console.log('✅ Milestone created');
|
||||
|
||||
// Step 4: Create Task (under milestone)
|
||||
console.log('📝 Creating task...');
|
||||
await page.goto(`${BASE_URL}/issues/new`);
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
// Wait for form to load
|
||||
await page.waitForSelector('select[name="issue_type"]', { timeout: 10000 });
|
||||
|
||||
// Select issue type: Task
|
||||
await page.selectOption('select[name="issue_type"]', 'task');
|
||||
await page.fill('input[placeholder="Title"]', 'Test Task');
|
||||
await page.fill('textarea[placeholder="Description"]', 'Task for E2E testing');
|
||||
|
||||
await page.click('button:has-text("Create")');
|
||||
await page.waitForTimeout(2000);
|
||||
console.log('✅ Task created');
|
||||
|
||||
// Step 5: Create Meeting (under milestone)
|
||||
console.log('📅 Creating meeting...');
|
||||
await page.goto(`${BASE_URL}/issues/new`);
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
await page.waitForSelector('select[name="issue_type"]', { timeout: 10000 });
|
||||
|
||||
// Select issue type: Meeting
|
||||
await page.selectOption('select[name="issue_type"]', 'meeting');
|
||||
await page.selectOption('select[name="issue_subtype"]', 'recap');
|
||||
await page.fill('input[placeholder="Title"]', 'Test Meeting');
|
||||
await page.fill('textarea[placeholder="Description"]', 'Meeting for E2E testing');
|
||||
|
||||
await page.click('button:has-text("Create")');
|
||||
await page.waitForTimeout(2000);
|
||||
console.log('✅ Meeting created');
|
||||
|
||||
// Step 6: Create Support (under milestone)
|
||||
console.log('🆘 Creating support...');
|
||||
await page.goto(`${BASE_URL}/issues/new`);
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
await page.waitForSelector('select[name="issue_type"]', { timeout: 10000 });
|
||||
|
||||
// Select issue type: Support
|
||||
await page.selectOption('select[name="issue_type"]', 'support');
|
||||
await page.selectOption('select[name="issue_subtype"]', 'information');
|
||||
await page.fill('input[placeholder="Title"]', 'Test Support');
|
||||
await page.fill('textarea[placeholder="Description"]', 'Support request for E2E testing');
|
||||
|
||||
await page.click('button:has-text("Create")');
|
||||
await page.waitForTimeout(2000);
|
||||
console.log('✅ Support created');
|
||||
|
||||
// Step 7: Logout
|
||||
console.log('🚪 Logging out...');
|
||||
|
||||
// Click logout button in sidebar
|
||||
await page.click('button:has-text("Logout")');
|
||||
await page.waitForURL(`${BASE_URL}/login`, { timeout: 10000 });
|
||||
console.log('✅ Logged out');
|
||||
|
||||
// Verify we're on login page
|
||||
await expect(page.locator('h1, h2')).toContainText(/Login|Sign/i, { timeout: 5000 });
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user