All Tests Fixed with Initialize feature
This commit is contained in:
@@ -15,11 +15,18 @@ test.describe('II. Workout Management', () => {
|
||||
|
||||
try {
|
||||
const heading = page.getByRole('heading', { name: /Change Password/i });
|
||||
const initAcc = page.getByRole('heading', { name: /Setup Your Account/i });
|
||||
const dashboard = page.getByText('Free Workout');
|
||||
await expect(heading.or(dashboard)).toBeVisible({ timeout: 5000 });
|
||||
await expect(heading.or(initAcc).or(dashboard)).toBeVisible({ timeout: 5000 });
|
||||
|
||||
if (await heading.isVisible()) {
|
||||
await page.getByLabel('New Password').fill('StrongNewPass123!');
|
||||
await page.getByRole('button', { name: /Save|Change/i }).click();
|
||||
await expect(initAcc.or(dashboard)).toBeVisible();
|
||||
}
|
||||
|
||||
if (await initAcc.isVisible()) {
|
||||
await page.getByRole('button', { name: /Get Started/i }).click();
|
||||
await expect(dashboard).toBeVisible();
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -296,11 +303,18 @@ test.describe('II. Workout Management', () => {
|
||||
// Handle password change if it appears (reusing logic from helper)
|
||||
try {
|
||||
const heading = page.getByRole('heading', { name: /Change Password/i });
|
||||
const initAcc = page.getByRole('heading', { name: /Setup Your Account/i });
|
||||
const dashboard = page.getByText('Free Workout');
|
||||
await expect(heading.or(dashboard)).toBeVisible({ timeout: 5000 });
|
||||
await expect(heading.or(initAcc).or(dashboard)).toBeVisible({ timeout: 10000 });
|
||||
|
||||
if (await heading.isVisible()) {
|
||||
await page.getByLabel('New Password').fill('StrongNewPass123!');
|
||||
await page.getByRole('button', { name: /Save|Change/i }).click();
|
||||
await expect(initAcc.or(dashboard)).toBeVisible();
|
||||
}
|
||||
|
||||
if (await initAcc.isVisible()) {
|
||||
await page.getByRole('button', { name: /Get Started/i }).click();
|
||||
await expect(dashboard).toBeVisible();
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user