Skip to content

Commit

Permalink
test: improve e2e test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed Dec 14, 2023
1 parent 6432119 commit f677de2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
24 changes: 12 additions & 12 deletions e2e/tests/site-data.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ describe('siteData', () => {

it('title', () => {
cy.title().should('eq', 'VuePress E2E')
cy.get('head title').should('have.text', 'VuePress E2E')
cy.get('head title')
.should('have.length', 1)
.should('have.text', 'VuePress E2E')
})

it('description', () => {
cy.get('head meta[name="description"]').should(
'have.attr',
'content',
'VuePress E2E Test Site',
)
cy.get('head meta[name="description"]')
.should('have.length', 1)
.should('have.attr', 'content', 'VuePress E2E Test Site')
})

it('head', () => {
Expand Down Expand Up @@ -48,15 +48,15 @@ describe('siteData', () => {

it('title', () => {
cy.title().should('eq', 'VuePress E2E')
cy.get('head title').should('have.text', 'VuePress E2E')
cy.get('head title')
.should('have.length', 1)
.should('have.text', 'VuePress E2E')
})

it('description', () => {
cy.get('head meta[name="description"]').should(
'have.attr',
'content',
'VuePress E2E 测试站点',
)
cy.get('head meta[name="description"]')
.should('have.length', 1)
.should('have.attr', 'content', 'VuePress E2E 测试站点')
})

it('head', () => {
Expand Down
24 changes: 12 additions & 12 deletions e2e/tests/update-head.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ describe('updateHead', () => {
cy.get('html').should('have.attr', 'lang', 'en-US')
// title
cy.title().should('eq', 'VuePress E2E')
cy.get('head title').should('have.text', 'VuePress E2E')
cy.get('head title')
.should('have.length', 1)
.should('have.text', 'VuePress E2E')
// description
cy.get('head meta[name="description"]').should(
'have.attr',
'content',
'VuePress E2E Test Site',
)
cy.get('head meta[name="description"]')
.should('have.length', 1)
.should('have.attr', 'content', 'VuePress E2E Test Site')
// head
cy.get('head meta[name="foo"]')
.should('have.length', 1)
Expand All @@ -35,13 +35,13 @@ describe('updateHead', () => {
cy.get('html').should('have.attr', 'lang', 'zh-CN')
// title
cy.title().should('eq', 'VuePress E2E')
cy.get('head title').should('have.text', 'VuePress E2E')
cy.get('head title')
.should('have.length', 1)
.should('have.text', 'VuePress E2E')
// description
cy.get('head meta[name="description"]').should(
'have.attr',
'content',
'VuePress E2E 测试站点',
)
cy.get('head meta[name="description"]')
.should('have.length', 1)
.should('have.attr', 'content', 'VuePress E2E 测试站点')
// head
cy.get('head meta[name="foo"]')
.should('have.length', 1)
Expand Down

0 comments on commit f677de2

Please sign in to comment.