You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.1 KiB
30 lines
1.1 KiB
describe('The Home Page', () => {
|
|
beforeEach(() => {
|
|
cy.visit('http://localhost:8080')
|
|
})
|
|
it('标题的文字', () => {
|
|
cy.get('.login-title > span').should('have.text', "登录智慧能源")
|
|
})
|
|
it('输入不规范账号密码', () => {
|
|
cy.intercept(
|
|
'https://www.enesoon-saas-back-test.cn:8381/**/*',
|
|
{ middleware: true },
|
|
(req) => {
|
|
req.on('before:response', (res) => {
|
|
// force all API responses to not be cached
|
|
res.headers['cache-control'] = 'no-store'
|
|
})
|
|
}
|
|
).as('login');
|
|
|
|
cy.get('body > uni-app > uni-page > uni-page-wrapper > uni-page-body > uni-view > uni-view:nth-child(2) > uni-view:nth-child(1) > uni-input > div > input')
|
|
.type('have.text')
|
|
cy.get('body > uni-app > uni-page > uni-page-wrapper > uni-page-body > uni-view > uni-view:nth-child(2) > uni-view:nth-child(2) > uni-input > div > input')
|
|
.type('have.text')
|
|
cy.get('.login').click()
|
|
cy.wait("@login").its('response.body').should((rep) => {
|
|
expect(rep).to.have.property("code", 1)
|
|
expect(rep).to.have.property("message", '用户名非邮箱手机号')
|
|
})
|
|
})
|
|
})
|