Skip to content

Commit

Permalink
fix: save content
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-huxiyang committed Dec 6, 2024
1 parent 7db2f3c commit 9939b3b
Show file tree
Hide file tree
Showing 12 changed files with 320 additions and 112 deletions.
21 changes: 21 additions & 0 deletions cypress/e2e/common/visit-demo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export const visitH5Demo = (componentName, delay = 800) => {
const getPath = () => `${Cypress.env('baseUrl')}${componentName}`
cy.visit(getPath(componentName), {
onBeforeLoad: (win) => {
Object.defineProperty(win.navigator, 'userAgent', {
value:
'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/14E5239e Safari/602.1',
})
},
})
cy.get('#nav').contains(componentName)
cy.wait(delay)
}
export const visitTaroDemo = (componentName, delay = 1000) => {
const getPath = (component) =>
`${Cypress.env('baseUrl')}base/pages/${component.toLowerCase()}/index`

cy.visit(getPath(componentName))
cy.get('.applets-demo-header').contains(componentName)
cy.wait(delay)
}
26 changes: 19 additions & 7 deletions cypress/e2e/h5/base.cy.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
import { componentTest } from './utils'
import { visitH5Demo } from '../common/visit-demo'

describe('base components test', () => {
componentTest('Button', () => {})
componentTest('Cell', () => {})
componentTest('ConfigProvider', () => {})
componentTest('Icon', () => {})
componentTest('Image', () => {})
componentTest('Overlay', () => {})
it('Button', () => {
visitH5Demo('Button')
})
it('Cell', () => {
visitH5Demo('Cell')
})
it('ConfigProvider', () => {
visitH5Demo('ConfigProvider')
})
it('Icon', () => {
visitH5Demo('Icon')
})
it('Image', () => {
visitH5Demo('Image')
})
it('Overlay', () => {
visitH5Demo('Overlay')
})
})
Cypress.on('uncaught:exception', (err, runnable) => {
return false
Expand Down
26 changes: 19 additions & 7 deletions cypress/e2e/h5/bussiness.cy.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
import { componentTest } from './utils'
import { visitH5Demo } from '../common/visit-demo'

describe('bussiness components test', () => {
componentTest('Barrage', () => {})
componentTest('Card', () => {})
componentTest('TimeSelect', () => {})
componentTest('TrendArrow', () => {})
componentTest('WaterMark', () => {})
componentTest('AvatarCropper', () => {})
it('Barrage', () => {
visitH5Demo('Barrage')
})
it('Card', () => {
visitH5Demo('Card')
})
it('TimeSelect', () => {
visitH5Demo('TimeSelect')
})
it('TrendArrow', () => {
visitH5Demo('TrendArrow')
})
it('WaterMark', () => {
visitH5Demo('WaterMark')
})
it('AvatarCropper', () => {
visitH5Demo('AvatarCropper')
})
})
86 changes: 64 additions & 22 deletions cypress/e2e/h5/dentry.cy.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,67 @@
import { componentTest } from './utils'
import { visitH5Demo } from '../common/visit-demo'

describe('dentry components test', () => {
componentTest('Address', () => {})
componentTest('Calendar', () => {})
componentTest('CalendarCard', () => {})
componentTest('Cascader', () => {})
componentTest('Checkbox', () => {})
componentTest('DatePicker', () => {})
componentTest('Form', () => {})
componentTest('Input', () => {})
componentTest('InputNumber', () => {})
componentTest('Menu', () => {})
componentTest('NumberKeyboard', () => {})
componentTest('Picker', () => {})
componentTest('Radio', () => {})
componentTest('Range', () => {})
componentTest('Rate', () => {})
componentTest('SearchBar', () => {})
componentTest('ShortPassword', () => {})
componentTest('Signature', () => {})
componentTest('Switch', () => {})
componentTest('TextArea', () => {})
componentTest('Uploader', () => {})
it('Address', () => {
visitH5Demo('Address')
})
it('Calendar', () => {
visitH5Demo('Calendar')
})
it('CalendarCard', () => {
visitH5Demo('CalendarCard')
})
it('Cascader', () => {
visitH5Demo('Cascader')
})
it('Checkbox', () => {
visitH5Demo('Checkbox')
})
it('DatePicker', () => {
visitH5Demo('DatePicker')
})
it('Form', () => {
visitH5Demo('Form')
})
it('Input', () => {
visitH5Demo('Input')
})
it('InputNumber', () => {
visitH5Demo('InputNumber')
})
it('Menu', () => {
visitH5Demo('Menu')
})
it('NumberKeyboard', () => {
visitH5Demo('NumberKeyboard')
})
it('Picker', () => {
visitH5Demo('Picker')
})
it('Radio', () => {
visitH5Demo('Radio')
})
it('Range', () => {
visitH5Demo('Range')
})
it('Rate', () => {
visitH5Demo('Rate')
})
it('SearchBar', () => {
visitH5Demo('SearchBar')
})
it('ShortPassword', () => {
visitH5Demo('ShortPassword')
})
it('Signature', () => {
visitH5Demo('Signature')
})
it('Switch', () => {
visitH5Demo('Switch')
})
it('TextArea', () => {
visitH5Demo('TextArea')
})
it('Uploader', () => {
visitH5Demo('Uploader')
})
})
78 changes: 58 additions & 20 deletions cypress/e2e/h5/exhibition.cy.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,61 @@
import { componentTest } from './utils'
import { visitH5Demo } from '../common/visit-demo'

describe('exhibition components test', () => {
componentTest('Animate', () => {})
componentTest('AnimatingNumbers', () => {})
componentTest('Audio', () => {})
componentTest('Avatar', () => {})
componentTest('CircleProgress', () => {})
componentTest('Collapse', () => {})
componentTest('CountDown', () => {})
componentTest('Ellipsis', () => {})
componentTest('ImagePreview', () => {})
componentTest('Indicator', () => {})
componentTest('Pagination', () => {})
componentTest('Price', () => {})
componentTest('Progress', () => {})
componentTest('Swiper', () => {})
componentTest('Table', () => {})
componentTest('Tag', () => {})
componentTest('Tour', () => {})
componentTest('Video', () => {})
componentTest('VirtualList', () => {})
it('Animate', () => {
visitH5Demo('Animate')
})
it('AnimatingNumbers', () => {
visitH5Demo('AnimatingNumbers')
})
it('Audio', () => {
visitH5Demo('Audio')
})
it('Avatar', () => {
visitH5Demo('Avatar')
})
it('CircleProgress', () => {
visitH5Demo('CircleProgress')
})
it('Collapse', () => {
visitH5Demo('Collapse')
})
it('CountDown', () => {
visitH5Demo('CountDown')
})
it('Ellipsis', () => {
visitH5Demo('Ellipsis')
})
it('ImagePreview', () => {
visitH5Demo('ImagePreview')
})
it('Indicator', () => {
visitH5Demo('Indicator')
})
it('Pagination', () => {
visitH5Demo('Pagination')
})
it('Price', () => {
visitH5Demo('Price')
})
it('Progress', () => {
visitH5Demo('Progress')
})
it('Swiper', () => {
visitH5Demo('Swiper')
})
it('Table', () => {
visitH5Demo('Table')
})
it('Tag', () => {
visitH5Demo('Tag')
})
it('Tour', () => {
visitH5Demo('Tour')
})
it('Video', () => {
visitH5Demo('Video')
})
it('VirtualList', () => {
visitH5Demo('VirtualList')
})
})
66 changes: 49 additions & 17 deletions cypress/e2e/h5/feedback.cy.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,52 @@
import { componentTest } from './utils'
import { visitH5Demo } from '../common/visit-demo'

describe('feedback components test', () => {
componentTest('ActionSheet', () => {})
componentTest('Badge', () => {})
componentTest('Dialog', () => {})
componentTest('Drag', () => {})
componentTest('Empty', () => {})
componentTest('ResultPage', () => {})
componentTest('InfiniteLoading', () => {})
componentTest('Loading', () => {})
componentTest('NoticeBar', () => {})
componentTest('Notify', () => {})
componentTest('Popover', () => {})
componentTest('Popup', () => {})
componentTest('PullToRefresh', () => {})
componentTest('Skeleton', () => {})
componentTest('Swipe', () => {})
componentTest('Toast', () => {})
it('ActionSheet', () => {
visitH5Demo('ActionSheet')
})
it('Badge', () => {
visitH5Demo('Badge')
})
it('Dialog', () => {
visitH5Demo('Dialog')
})
it('Drag', () => {
visitH5Demo('Drag')
})
it('Empty', () => {
visitH5Demo('Empty')
})
it('ResultPage', () => {
visitH5Demo('ResultPage')
})
it('InfiniteLoading', () => {
visitH5Demo('InfiniteLoading')
})
it('Loading', () => {
visitH5Demo('Loading')
})
it('NoticeBar', () => {
visitH5Demo('NoticeBar')
})
it('Notify', () => {
visitH5Demo('Notify')
})
it('Popover', () => {
visitH5Demo('Popover')
})
it('Popup', () => {
visitH5Demo('Popup')
})
it('PullToRefresh', () => {
visitH5Demo('PullToRefresh')
})
it('Skeleton', () => {
visitH5Demo('Skeleton')
})
it('Swipe', () => {
visitH5Demo('Swipe')
})
it('Toast', () => {
visitH5Demo('Toast')
})
})
4 changes: 0 additions & 4 deletions cypress/e2e/h5/index.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@ import './dentry.cy'
import './bussiness.cy'
import './exhibition.cy'
import './feedback.cy'

Cypress.on('uncaught:exception', (err, runnable) => {
return false
})
26 changes: 19 additions & 7 deletions cypress/e2e/h5/layout.cy.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
import { componentTest } from './utils'
import { visitH5Demo } from '../common/visit-demo'

describe('layout components test', () => {
componentTest('Divider', () => {})
componentTest('Grid', () => {})
componentTest('Layout', () => {})
componentTest('Space', () => {})
componentTest('Sticky', () => {})
componentTest('SafeArea', () => {})
it('Divider', () => {
visitH5Demo('Divider')
})
it('Grid', () => {
visitH5Demo('Grid')
})
it('Layout', () => {
visitH5Demo('Layout')
})
it('Space', () => {
visitH5Demo('Space')
})
it('Sticky', () => {
visitH5Demo('Sticky')
})
it('SafeArea', () => {
visitH5Demo('SafeArea')
})
})
Loading

0 comments on commit 9939b3b

Please sign in to comment.