此系列文章会同步发文到个人部落格,有兴趣的读者可以前往观看喔。
当测试脚本有重复的地方,除了可以写在 command.js 外,也可以依照不同使用状况将程序码写在 before, beforeEach, after, afterEach 中。
before(() => {
})
beforeEach(() => {
})
after(() => {
})
afterEach(() => {
})
这个脚本有两个测试用例,在 beforeEach 中写在每个测试用例之前都要执行访问地址和登入,在 afterEach中写在每个测试用例之後都要登出。
describe("测试铁人赛登入", function () {
beforeEach(()=>{
cy.visit("https://ithelp.ithome.com.tw/");
cy.login({ userId: "account", password: "password" });
})
afterEach(()=>{
cy.get('li > a').contains("登出").click({force: true,}); //点选登出
})
it("输入正确帐密後应该要可以登入", function () {
cy.get('.img-circle').click({force: true,}); //点选头像
})
it("搜寻cypress後,应该要有文章", function () {
cy.get('.menu__search-toggle').click({force: true}); //点选搜寻
cy.get('.menu__search-input').type('cypress') //搜寻cypress
cy.get('#searchIronman').click({force: true,}); //选择铁人赛
cy.get('.menu__dropform-btn').click({force: true}); //点选搜寻
cy.get(".search-qa-list__title-link").contains("自动化测试,让你上班拥有一杯咖啡的时间 ").should("be.visible"); //要有cypress
})
})
这个范例把上个范例的 jQuery UI Selectmenu 放到 vue component 内...
我们前面已经学习了回调函式(Callback Function)与构造函式(Constrcutor...
【前言】 除了从 web3.js 来取得 ERC-721 的 Token's Ownership,...
今天内容为设定PlayerController.cs的程序码,让角色控制能够顺利同步,以及修正之前的...
什麽是 Fan-Out Fan-In Pattern? 将 input 由一个 producer 分...