Clean up
This commit is contained in:
parent
3930982bd8
commit
ad7968dadd
53 changed files with 564 additions and 1013 deletions
|
|
@ -11,8 +11,11 @@ test.describe('Life Towers smoke test', () => {
|
|||
test('create page → tower → block, mark done, reload, persists', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
|
||||
// Wait for the empty-state hint that means init() completed.
|
||||
await expect(page.getByText('Add a new page to get started!')).toBeVisible({ timeout: 15000 });
|
||||
// Wait for init, then dismiss the welcome modal so the page controls are reachable.
|
||||
await expect(page.getByText('Welcome to Life Towers')).toBeVisible({ timeout: 15000 });
|
||||
await page.getByRole('button', { name: 'Start empty' }).click();
|
||||
await page.waitForSelector('section.modal', { state: 'detached' });
|
||||
await expect(page.getByText('Add a new page to get started!')).toBeVisible();
|
||||
|
||||
// Create a page via the select-add dropdown.
|
||||
await page.locator('lt-select-add .top').first().click();
|
||||
|
|
@ -24,7 +27,7 @@ test.describe('Life Towers smoke test', () => {
|
|||
|
||||
// Create a tower.
|
||||
await page.locator('img[alt="Add tower"]').click();
|
||||
await page.locator('input[placeholder="Tower name…"]').fill('Side projects');
|
||||
await page.locator('input[placeholder="New tower"]').fill('Side projects');
|
||||
await page.locator('lt-tower-settings button[type="submit"]').click();
|
||||
|
||||
// Tower's name input is rendered with the tower name as its value.
|
||||
|
|
@ -43,27 +46,25 @@ test.describe('Life Towers smoke test', () => {
|
|||
await page.locator('textarea[placeholder="Write a description here…"]').fill(
|
||||
'Modernise the towers app',
|
||||
);
|
||||
await page.getByRole('button', { name: 'Create and exit' }).click();
|
||||
await page.getByLabel('Already done').uncheck();
|
||||
await page.getByRole('button', { name: 'Create and exit', exact: true }).click();
|
||||
|
||||
// New block is pending → appears in the tasks accordion.
|
||||
// (Tasks header shows N tasks.)
|
||||
await expect(page.locator('lt-tasks')).toContainText('1');
|
||||
|
||||
// Open the tasks accordion + click the task to edit it, then flip done.
|
||||
await page.locator('lt-tasks .container').click();
|
||||
await page.locator('lt-tasks .task-container').click();
|
||||
await page.locator('lt-tasks .header').click();
|
||||
await page.locator('lt-tasks .task-description').click();
|
||||
|
||||
// Toggle done in the block-edit modal — the right label is "Done".
|
||||
// Toggle done in the block-edit modal.
|
||||
const putLanded = page.waitForResponse(
|
||||
(r) => r.url().endsWith('/api/v1/data') && r.request().method() === 'PUT' && r.ok(),
|
||||
);
|
||||
// Toggle uses verbose labels — "Goal accomplished" flips it to done.
|
||||
await page
|
||||
.locator('lt-block-edit lt-toggle span')
|
||||
.filter({ hasText: 'Goal accomplished' })
|
||||
.click();
|
||||
await page.getByRole('button', { name: 'Create and exit' }).click();
|
||||
await page.locator('lt-block-edit .card.active').getByLabel('Already done').check();
|
||||
await putLanded;
|
||||
await page.locator('lt-block-edit .card.active .exit').click();
|
||||
await page.waitForSelector('section.modal', { state: 'detached' });
|
||||
|
||||
// Done block now appears as a colored square in the tower's falling stack.
|
||||
await expect(page.locator('lt-tower lt-block').first()).toBeVisible();
|
||||
|
|
@ -73,7 +74,7 @@ test.describe('Life Towers smoke test', () => {
|
|||
await expect(page.locator('lt-select-add .top').first()).toContainText('Hobbies', {
|
||||
timeout: 15000,
|
||||
});
|
||||
await expect(page.getByDisplayValue('Side projects')).toBeVisible();
|
||||
await expect(page.locator('lt-tower input').first()).toHaveValue('Side projects');
|
||||
await expect(page.locator('lt-tower lt-block').first()).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
import { test } from '@playwright/test';
|
||||
|
||||
test.skip(
|
||||
process.env['CAPTURE_VISUALS'] !== '1',
|
||||
'Set CAPTURE_VISUALS=1 to run the visual screenshot capture suite.',
|
||||
);
|
||||
|
||||
/**
|
||||
* Visual capture: drives the UI into key states and writes screenshots
|
||||
* for human review of the legacy-styled design.
|
||||
|
|
@ -55,12 +60,12 @@ test.describe('Life Towers visuals', () => {
|
|||
.fill('Finish The Brothers Karamazov');
|
||||
// Uncheck "Already done" so this becomes a pending task.
|
||||
await createCard.getByLabel('Already done').uncheck();
|
||||
await page.getByRole('button', { name: 'Create and exit' }).click();
|
||||
await page.getByRole('button', { name: 'Create and exit', exact: true }).click();
|
||||
await page.waitForSelector('section.modal', { state: 'detached' });
|
||||
|
||||
// Open the tasks accordion to show the new tickbox.
|
||||
await page.waitForTimeout(200);
|
||||
await page.locator('lt-tasks .container').click();
|
||||
await page.locator('lt-tasks .header').click();
|
||||
await page.waitForTimeout(300);
|
||||
await page.screenshot({ path: 'visuals/04b-tasks-accordion-with-tickbox.png', fullPage: true });
|
||||
|
||||
|
|
@ -83,7 +88,7 @@ test.describe('Life Towers visuals', () => {
|
|||
await cc.locator('lt-select-add .top').click();
|
||||
await page.waitForTimeout(100);
|
||||
await cc.locator('textarea[placeholder="Write a description here…"]').fill(desc);
|
||||
await page.getByRole('button', { name: 'Create and exit' }).click();
|
||||
await page.getByRole('button', { name: 'Create and exit', exact: true }).click();
|
||||
await page.waitForSelector('section.modal', { state: 'detached' });
|
||||
}
|
||||
|
||||
|
|
@ -196,9 +201,9 @@ test.describe('Life Towers visuals', () => {
|
|||
await page.screenshot({ path: 'visuals/14-mobile-populated.png', fullPage: true });
|
||||
|
||||
// Open the block-edit carousel for the first tower's first task.
|
||||
await page.locator('lt-tasks .container').first().click();
|
||||
await page.locator('lt-tasks .header').first().click();
|
||||
await page.waitForTimeout(400);
|
||||
await page.locator('lt-tasks .task-container').first().click();
|
||||
await page.locator('lt-tasks .task-description').first().click();
|
||||
await page.waitForSelector('section.modal.active');
|
||||
await page.waitForTimeout(400);
|
||||
await page.screenshot({ path: 'visuals/15-mobile-carousel.png', fullPage: true });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue