Unit testing framework for apps

Hi,

I’m curious what others have experienced in unit testing for client and browser app libraries?

In the past I’ve used http://nightwatchjs.org/ successfully. It does involve setting up the selenium server yet the test to go thru each browser you choose to test against.

What other frameworks do you like?

I’m preparing to add unit testing to

and would like to know what framework people have had good experiences with

Hi!

For unit testing in JS I would recommend using Jest.
Cypress.io would be great for E2E tests.

2 Likes

Thank you!

Cypress.io is looking good from its first page. I’ll experiment with it and see

Cypress is the Cat’s Meow!

Thanks again, I’m converting my other project’s tests to this

1 Like

My pleasure! Happy testing :slight_smile:

Got further with testing! An instance of chrome is stood up each time for a test run. It then jumps to the solid login because the session

  const session = await solid.auth.currentSession();
  if (!session)
    await solid.auth.login(idp);
  else
    alert(`Logged in as ${session.webId}`);

is run at the beginning to use the webId.

Does anyone know the id for the username and passwrd fields or any other way to find them? Hoping to automate the test thru this step so the rest of the tests are then possible

Your problem is to find id of username & password or to switch to the pop-up page?
I used selenium, and in this case , you have to switch to the new page/ handle

Cypress doesn’t recommend to test using 3rd party server https://docs.cypress.io/guides/references/best-practices.html#Visiting-external-sites

Hi @Smag0 ,

I’d like to get past somehow or at least wait till back to the page of interest. Fill in the user and password would be nice too.

I used nightwatch and selenium in the past but certain thing like mouse panning never worked. I’m hoping cypress has better functionality.

Thanks for the link.