0

I hope it doesn't seem like a pointless question and I'm sorry if I don't give all the details first, but I would like to know if I can call from another file enterUsername(userone), where userone would like to be an object with more many features

enterUsername(userone){
       userone=( 
            cy.get('input[name="Parameter.UserName"]').type('userone'),
            cy.get('input[name="Parameter.Password"]').type('useronepass') 
               )
        return this;
    }

From another file calling directly enterUsername(userone) and not enterUsername('userone')

Please note that I have asked something similar and I have been given solutions that I have applied, but only with a call between apostrophes.

Alex
  • 1
  • 3
  • 1
    `'userone'` is a string. If you want to pass an object, then you can do just that. However, you should be prepared to handle the input as an object in this method. With that said, right now, you don't do anything with the input - you assign one value to it (because you use [a comma operator](https://stackoverflow.com/q/3561043)), so it doesn't matter what the input was originally - it will remain unchanged at the call site. Moreover, this one value isn't even used anywhere, so it doesn't matter for the operation of `enterUsername`. – VLAZ Jan 20 '22 at 14:43

0 Answers0