diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 5923dbd..bfafd69 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -42,7 +42,7 @@ jobs: # Run cypress from frontend dir cd frontend - SPECS=$(ls cypress/e2e/*.cy.js | grep -v demo | grep -v visual | grep -v check | tr '\n' ',') + SPECS=$(ls cypress/e2e/*.cy.js | grep -v demo-walkthrough | grep -v visual-check | grep -v check-price | tr '\n' ',') npx cypress run --spec "$SPECS" --config video=false EXIT_CODE=$? diff --git a/frontend/cypress/e2e/oil-reference.cy.js b/frontend/cypress/e2e/oil-reference.cy.js index 92cd865..ecd1bd3 100644 --- a/frontend/cypress/e2e/oil-reference.cy.js +++ b/frontend/cypress/e2e/oil-reference.cy.js @@ -1,32 +1,32 @@ describe('Oil Reference Page', () => { beforeEach(() => { cy.visit('/oils') - cy.get('.oil-card, .oils-grid', { timeout: 10000 }).should('exist') + cy.get('.oil-chip, .oils-grid', { timeout: 10000 }).should('exist') }) it('displays oil grid with items', () => { cy.contains('精油价目').should('be.visible') - cy.get('.oil-card').should('have.length.gte', 10) + cy.get('.oil-chip').should('have.length.gte', 10) }) it('shows oil name and price on each chip', () => { - cy.get('.oil-card').first().should('contain', '¥') + cy.get('.oil-chip').first().should('contain', '¥') }) it('filters oils by search', () => { - cy.get('.oil-card').then($chips => { + cy.get('.oil-chip').then($chips => { const initial = $chips.length cy.get('input[placeholder*="搜索精油"]').type('薰衣草') cy.wait(300) - cy.get('.oil-card').should('have.length.lt', initial) + cy.get('.oil-chip').should('have.length.lt', initial) }) }) it('toggles between bottle and drop price view', () => { - cy.get('.oil-card').first().invoke('text').then(textBefore => { + cy.get('.oil-chip').first().invoke('text').then(textBefore => { cy.contains('滴价').click() cy.wait(300) - cy.get('.oil-card').first().invoke('text').should('not.eq', textBefore) + cy.get('.oil-chip').first().invoke('text').should('not.eq', textBefore) }) }) }) diff --git a/frontend/cypress/e2e/performance.cy.js b/frontend/cypress/e2e/performance.cy.js index 64e3d99..3f55ea3 100644 --- a/frontend/cypress/e2e/performance.cy.js +++ b/frontend/cypress/e2e/performance.cy.js @@ -38,7 +38,7 @@ describe('Performance', () => { it('oil reference page loads within 3 seconds', () => { const start = Date.now() cy.visit('/oils') - cy.get('.oil-card', { timeout: 3000 }).should('have.length.gte', 1) + cy.get('.oil-chip', { timeout: 3000 }).should('have.length.gte', 1) cy.then(() => { expect(Date.now() - start).to.be.lt(3000) }) diff --git a/frontend/cypress/e2e/responsive.cy.js b/frontend/cypress/e2e/responsive.cy.js index 21924ed..8cc5689 100644 --- a/frontend/cypress/e2e/responsive.cy.js +++ b/frontend/cypress/e2e/responsive.cy.js @@ -35,7 +35,7 @@ describe('Responsive Design', () => { it('oil reference page works on mobile', () => { cy.visit('/oils') cy.contains('精油价目').should('be.visible') - cy.get('.oil-card').should('have.length.gte', 1) + cy.get('.oil-chip').should('have.length.gte', 1) }) }) @@ -51,7 +51,7 @@ describe('Responsive Design', () => { it('oil grid shows multiple columns', () => { cy.visit('/oils') - cy.get('.oil-card', { timeout: 10000 }).should('have.length.gte', 1) + cy.get('.oil-chip', { timeout: 10000 }).should('have.length.gte', 1) }) }) diff --git a/frontend/cypress/e2e/visual-check.cy.js b/frontend/cypress/e2e/visual-check.cy.js index 68549bc..836ac6b 100644 --- a/frontend/cypress/e2e/visual-check.cy.js +++ b/frontend/cypress/e2e/visual-check.cy.js @@ -18,7 +18,7 @@ describe('Visual Check - Screenshots', () => { it('oil reference page', () => { cy.visit('/oils', { onBeforeLoad(win) { win.localStorage.setItem('oil_auth_token', ADMIN_TOKEN) } }) - cy.get('.oil-card', { timeout: 10000 }).should('have.length.gte', 1) + cy.get('.oil-chip', { timeout: 10000 }).should('have.length.gte', 1) cy.wait(500) cy.screenshot('03-oil-reference') }) diff --git a/frontend/src/components/RecipeCard.vue b/frontend/src/components/RecipeCard.vue index b7a4f5b..354a13b 100644 --- a/frontend/src/components/RecipeCard.vue +++ b/frontend/src/components/RecipeCard.vue @@ -6,26 +6,31 @@ {{ tag }} -