Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

install chance in cypress

Just install chancejs with npm:
npm install chance
Then just use it in your test for example:
/// <reference types="cypress" />
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)
    })
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #install #chance #cypress
ADD COMMENT
Topic
Name
5+2 =