https://cypress.io logo
Hi Everyone, I am trying to be able to reuse Steps...
# e2e-testing
r
Hi Everyone, I am trying to be able to reuse Steps in Cucumber with Cypress. by using something like this
Copy code
Then('I set {string} field {string} to {string}', (page: string, locator: string, value: string) => {
  searchGuestPage.getMyLocator().type(value);
  // eslint-disable-next-line no-eval
  (0,eval)(`${page}Page.get${locator}().type('${value}')`);
});
but I am getting a error that its not finding searchGuestPage, the previous line to the eval works properly and its exactly to what the eval will run, can someone guide me on how to make it work?