.url 抓取测试url
.window 使用window物件
.its 在window底下使用localstorage
import { buildUser } from '../xx';
describe('register a new user', () => {
const user = buildUser();
cy.visit('/')
.findByText(/register/i)
.click()
.findByLobelText(/username/i)
.type(user.username)
.findByLobelText(/password/i)
.type(user.password)
.findByText(/submit/i)
.click()
.url()
.should('eq', 'http://localhost:8080/')
.window()
.its('localhost.token')
.should('be.a', 'string')
.findByTestId('username-display')
.should('have.text', user.username)
});
模拟 http responsive error
cy.server().route({
method: 'POST',
url: 'http://localhost:3000/register',
status: 500,
response: {},
});
模拟request
cy.request({
url: 'http:/localhost:3000/register',
method: 'POST',
body: user,
});
很多重复的指令,可以透过custom commands 去
cy.server().route({
method: 'POST',
url: 'http://localhost:3000/register',
status: 500,
response: {}
})
<<: 连续 30 天 玩玩看 ProtoPie - Day 17
>>: [Day 17]从零开始学习 JS 的连续-30 Days---AJAX--方法介绍
Youtube连结:https://bit.ly/3m1VQWV 在我们了解Binary Tree...
将资料上传至Firebase上 使用UIImagePikerController来选取照片上传 使用...
之前我们学会了如何用talib计算一分K技术指标,也学会了如何用line发送通知。因为shioaji...
如果上一篇威尔猪讲的 Flex 是十字形排版法,那今天讲的 Grid 就属於棋盘格排版法。它比 F...
我Day 2有关於Unity介面的介绍,一般来说,学习顺序是Unity -> Unreal,因...