Commit b982c9a9 authored by Cai Wei's avatar Cai Wei

feat(*): 添加测试脚本

parent e16d6e0d
Pipeline #1318 failed
# Custom Environment - 自定义测试环境
CYPRESS_BASE_URL=https://your-custom-url.com
CYPRESS_API_URL=https://your-custom-api-url.com
CYPRESS_USERNAME=custom_user@example.com
CYPRESS_PASSWORD=custom_password
CYPRESS_BASE_URL=https://screen.bmetech.com/admin/dctom/
CYPRESS_API_URL=https://screen.bmetech.com/admin/dctom/
CYPRESS_USERNAME=zongheng_admin
CYPRESS_PASSWORD=9%#F46vt
CYPRESS_REPORT_TITLE=Custom Tests
CYPRESS_REPORT_PAGE_TITLE=自定义环境测试报告
\ No newline at end of file
......@@ -4,8 +4,8 @@
VITE_ENV = development
# Development Environment
CYPRESS_BASE_URL=http://localhost:3000
CYPRESS_API_URL=http://localhost:3000
CYPRESS_BASE_URL=https://screen.bmetech.com/admin/dctom/
CYPRESS_API_URL=https://screen.bmetech.com/admin/dctom/
CYPRESS_USERNAME=test@example.com
CYPRESS_PASSWORD=testpassword
CYPRESS_REPORT_TITLE=Development Tests
......
// cypress/e2e/generic-login.cy.js
describe('通用登录测试', () => {
beforeEach(() => {
cy.visit('/')
cy.visit('https://screen.bmetech.com/admin/dctom/')
})
it('应该能够成功登录', () => {
......
......@@ -2,7 +2,7 @@ describe('template spec', () => {
/* ==== Test Created with Cypress Studio ==== */
it('test', function() {
/* ==== Generated with Cypress Studio ==== */
cy.visit('http://localhost:3000/');
cy.visit('https://screen.bmetech.com/admin/dctom/');
cy.get('[data-testid="login-username-input"]').clear('z');
cy.get('[data-testid="login-username-input"]').type('zongheng_admin');
cy.get('[data-testid="login-password-input"]').click();
......@@ -16,4 +16,26 @@ describe('template spec', () => {
cy.get('[data-testid="menu-item-dust-overview"] > span').click();
/* ==== End Cypress Studio ==== */
});
/* ==== Test Created with Cypress Studio ==== */
it('test1', function() {
/* ==== Generated with Cypress Studio ==== */
cy.visit('https://screen.bmetech.com/admin/dctom/#/login');
cy.get('[data-testid="login-username-input"]').clear('z');
cy.get('[data-testid="login-username-input"]').type('zongheng_admin');
cy.get('[data-testid="login-password-input"]').click();
cy.get('[data-testid="login-password-input"]').clear('9%#F46vt');
cy.get('[data-testid="login-password-input"]').type('9%#F46vt');
cy.get('[data-testid="login-captcha-input"]').clear('7');
cy.get('[data-testid="login-captcha-input"]').type('8888');
cy.get('[data-testid="login-submit-button"] > span').click();
cy.get('[data-testid="menu-item-dust-overview"] > span').click();
cy.get('[data-testid="dust-production-line-select"] > .el-select__wrapper').click();
cy.get('[data-testid="production-line-option-169108"]').click();
cy.get('[data-testid="dust-search-button"] > span').click();
cy.get('#el-id-4313-46').click();
cy.get('[data-testid="production-line-option-169109"]').click();
cy.get('[data-testid="dust-search-button"]').click();
/* ==== End Cypress Studio ==== */
});
})
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment