I have a utility command in cypress:
Cypress.Commands.add('generateDummyText', (length: number, delay?: number) => { const wordLength = 5; const lorem = new LoremIpsum({ wordsPerSentence: { max: wordLength, min: wordLength, }, words: ['word1', 'word2', 'word3', 'word4', 'word5'], }); const words = lorem.generateWords(Math.ceil(length / wordLength)); cy.wrap(words).as('dummyText'); }); it('test', () => { // Generate dummy text cy.generateDummyText(280); // I want to type the "dummyText variable here" cy.get('myinput').type() }); How can this be done? I don't need to use a custom cypress command, but I'd prefer to use one. Looking forward to your reply!
this.dummyTexteg.cy.type(this.dummyText)