📜  在 cypress 中安装机会 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:25.098000             🧑  作者: Mango

代码示例2
Just install chancejs with npm:
npm install chance
Then just use it in your test for example:
/// 
import Chance from 'Chance';
const chance = new Chance();
describe('Testing chance', function (){
   const company =chance.company();
   it('type company in duckduckgo.com', function () {
        cy.visit('https://duckduckgo.com/')
        cy.get('#search_form_input_homepage')
        .should('be.visible')
        .type(company)
    })
})