Refactor frontend to Vue 3 + Vite + Pinia + Cypress E2E

- Replace single-file 8441-line HTML with Vue 3 SPA
- Pinia stores: auth, oils, recipes, diary, ui
- Composables: useApi, useDialog, useSmartPaste, useOilTranslation
- 6 shared components: RecipeCard, RecipeDetailOverlay, TagPicker, etc.
- 9 page views: RecipeSearch, RecipeManager, Inventory, OilReference, etc.
- 14 Cypress E2E test specs (113 tests), all passing
- Multi-stage Dockerfile (Node build + Python runtime)
- Demo video generation scripts (TTS + subtitles + screen recording)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-06 18:35:00 +00:00
parent 0368e85abe
commit ee8ec23dc7
62 changed files with 15035 additions and 8448 deletions

View File

@@ -0,0 +1,32 @@
describe('App Loading', () => {
it('loads the home page with header and nav', () => {
cy.visit('/')
cy.get('.app-header').should('be.visible')
cy.contains('doTERRA 配方计算器').should('be.visible')
cy.get('.nav-tabs').should('be.visible')
cy.get('.nav-tab').should('have.length.gte', 4)
})
it('shows the search section by default', () => {
cy.visit('/')
cy.get('.nav-tab').first().should('have.class', 'active')
cy.get('input[placeholder*="搜索"]', { timeout: 8000 }).should('be.visible')
})
it('navigates between public tabs without login', () => {
cy.visit('/')
cy.get('.nav-tab').contains('精油价目').click()
cy.url().should('include', '/oils')
cy.contains('精油价目').should('be.visible')
cy.get('.nav-tab').contains('配方查询').click()
cy.url().should('not.include', '/oils')
})
it('prompts login when accessing protected tabs', () => {
cy.visit('/')
cy.get('.nav-tab').contains('管理配方').click()
// Should show login modal or dialog
cy.get('[class*="overlay"], [class*="login"], [class*="modal"], [class*="dialog"]', { timeout: 3000 }).should('exist')
})
})