install chance in cypress code example
Example 1: install cypress
npm install cypress or npm install cypress --save-dev
./node_modules/.bin/cypress open
Example 2: install chance in cypress
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)
})
})