Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: e2e test & CI integration #2740

Merged
merged 38 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
6a16d1f
chore: cupress
Alex-huxiyang Nov 11, 2024
99c005f
chore: cypress ci
Alex-huxiyang Nov 12, 2024
140b31e
chore: update
Alex-huxiyang Nov 12, 2024
8d3f08e
chore: update
Alex-huxiyang Nov 12, 2024
8beff5c
fix: install
Alex-huxiyang Nov 12, 2024
22cc2fe
fix: install
Alex-huxiyang Nov 12, 2024
7fe0719
chore: update
Alex-huxiyang Nov 12, 2024
2524793
chore: update
Alex-huxiyang Nov 12, 2024
75d817a
chore: update
Alex-huxiyang Nov 12, 2024
23661fa
chore: update
Alex-huxiyang Nov 12, 2024
69268e6
chore: update
Alex-huxiyang Nov 12, 2024
2b051dd
chore: update
Alex-huxiyang Nov 12, 2024
c89278d
chore: update
Alex-huxiyang Nov 12, 2024
d860276
chore: update
Alex-huxiyang Nov 12, 2024
efc90b7
chore: update
Alex-huxiyang Nov 12, 2024
e821c24
chore: update
Alex-huxiyang Nov 12, 2024
d71669d
chore: update
Alex-huxiyang Nov 13, 2024
eeefcbc
chore: update
Alex-huxiyang Nov 13, 2024
515a12b
chore: update
Alex-huxiyang Nov 13, 2024
16f267c
chore: update
Alex-huxiyang Nov 13, 2024
1a392de
fix: revert commit log
Alex-huxiyang Dec 5, 2024
9a07d69
fix: resolve conflicts with v3
Alex-huxiyang Dec 5, 2024
ab38f06
fix: ci failed
Alex-huxiyang Dec 5, 2024
7db2f3c
fix: ci no reaction
Alex-huxiyang Dec 5, 2024
9939b3b
fix: save content
Alex-huxiyang Dec 6, 2024
0498272
fix: update lock file to resolve conflicts
Alex-huxiyang Dec 10, 2024
d3f4658
Merge branch 'feat_v3.x' into hxy/cypress/ci-1111
Alex-huxiyang Dec 10, 2024
b8bfcfa
fix: update lock file to resolve conflicts
Alex-huxiyang Dec 10, 2024
75f4799
refactor: cypress directory common and utils test method
Alex-huxiyang Dec 10, 2024
cd07550
refactor: cypress directory common and utils test method
Alex-huxiyang Dec 10, 2024
aa13e8b
refactor: cypress directory common and utils test method
Alex-huxiyang Dec 10, 2024
88a4c6e
fix: re
Alex-huxiyang Dec 11, 2024
650fe55
fix: re
Alex-huxiyang Dec 11, 2024
d4fc196
fix: resolve conflicts
Alex-huxiyang Dec 11, 2024
e221ea8
fix: resolve conflicts
Alex-huxiyang Dec 11, 2024
4ff94e2
Merge branch 'feat_v3.x' into hxy/cypress/ci-1111
Alex-huxiyang Dec 11, 2024
4931cba
fix: resolve conflicts
Alex-huxiyang Dec 11, 2024
912f64a
fix: resolve conflicts
Alex-huxiyang Dec 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: E2E Tests

on:
push:
branches:
- feat_v3.x
pull_request:
branches:
- feat_v3.x

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install pnpm
run: corepack enable pnpm

- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Run E2E Tests for H5
env:
CI: true
run: pnpm cypress install --force && pnpm e2e:run:h5

# Taro的自动化测试,demo包管理解决后解除注释
# - name: Run E2E Tests for Taro
# env:
# CI: true
# pnpm cypress install --force && run: pnpm e2e:run:taro
7 changes: 3 additions & 4 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import { defineConfig } from 'cypress'

export default defineConfig({
e2e: {
baseUrl: 'http://localhost:10086/#/',
specPattern: 'cypress/e2e/**/*.js',
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
},
viewportWidth: 414,
viewportHeight: 896,
viewportWidth: 375,
viewportHeight: 667,
})
67 changes: 0 additions & 67 deletions cypress/component/Actionsheet.cy.jsx

This file was deleted.

6 changes: 0 additions & 6 deletions cypress/component/Button.cy.jsx

This file was deleted.

37 changes: 0 additions & 37 deletions cypress/component/Cell.cy.jsx

This file was deleted.

32 changes: 32 additions & 0 deletions cypress/e2e/common/pageWhiteTest.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { visitH5Demo, visitTaroDemo } from '../utils/visit-demo.cy.js'
import data from '../../../src/config.json'

const { nav } = data
export const checkH5Blank = () => {
const componentArr = nav
.map((i) => i.packages)
.flat(Infinity)
.filter((i) => i.show)
.map((i) => i.name)

it('check h5 demos blank', () => {
componentArr.forEach((com) => {
visitH5Demo(com)
})
})
}
Alex-huxiyang marked this conversation as resolved.
Show resolved Hide resolved
export const checkTaroBlank = () => {
it('check taro demos blank', () => {
nav.forEach((item) => {
const path = item.enName
item.packages
.filter((i) => i.show && i.taro && i.version === '3.0.0')
.forEach((i) => {
visitTaroDemo(path, i.name)
})
})
})
}
Cypress.on('uncaught:exception', (err, runnable) => {
return false
})
Alex-huxiyang marked this conversation as resolved.
Show resolved Hide resolved
25 changes: 25 additions & 0 deletions cypress/e2e/h5/base.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { visitH5Demo } from '../utils/visit-demo'

describe('base components test', () => {
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
})
Alex-huxiyang marked this conversation as resolved.
Show resolved Hide resolved
22 changes: 22 additions & 0 deletions cypress/e2e/h5/bussiness.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { visitH5Demo } from '../utils/visit-demo'

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

describe('dentry components test', () => {
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')
})
})
61 changes: 61 additions & 0 deletions cypress/e2e/h5/exhibition.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { visitH5Demo } from '../utils/visit-demo'

describe('exhibition components test', () => {
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')
})
})
Loading
Loading