# Unit testing framework for apps

**URL:** <https://forum.solidproject.org/t/unit-testing-framework-for-apps/467>\
**Category:** Solid App Development FAQs\
**Created:** [November 8, 2018, 6:38pm UTC](https://forum.solidproject.org/t/unit-testing-framework-for-apps/467 "2018-11-08T18:38:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rimmartin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/rimmartin/32/166_2.png) [@rimmartin](https://forum.solidproject.org/u/rimmartin)\
**Post date:** [November 8, 2018, 6:38pm UTC](https://forum.solidproject.org/t/unit-testing-framework-for-apps/467/1 "2018-11-08T18:38:35Z")

</div>

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/](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?

---

<div class="post-metadata">

**Author:** ![rimmartin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/rimmartin/32/166_2.png) [@rimmartin](https://forum.solidproject.org/u/rimmartin)\
**Post date:** [November 9, 2018, 12:32pm UTC](https://forum.solidproject.org/t/unit-testing-framework-for-apps/467/2 "2018-11-09T12:32:24Z")

</div>

I’m preparing to add unit testing to

> **[DataDriven-CAM/solid-fs](https://github.com/DataDriven-CAM/solid-fs)**
>
> client side functionality of the node fs API interfacing to a solid pod

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

---

<div class="post-metadata">

**Author:** ![real34](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/real34/32/121_2.png) [@real34](https://forum.solidproject.org/u/real34)\
**Post date:** [November 9, 2018, 1:20pm UTC](https://forum.solidproject.org/t/unit-testing-framework-for-apps/467/3 "2018-11-09T13:20:23Z")

</div>

Hi!

For unit testing in JS I would recommend using Jest.  
[Cypress.io](http://Cypress.io) would be great for E2E tests.

---

<div class="post-metadata">

**Author:** ![rimmartin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/rimmartin/32/166_2.png) [@rimmartin](https://forum.solidproject.org/u/rimmartin)\
**Post date:** [November 9, 2018, 1:33pm UTC](https://forum.solidproject.org/t/unit-testing-framework-for-apps/467/4 "2018-11-09T13:33:58Z")

</div>

Thank you!

[Cypress.io](http://Cypress.io) is looking good from its first page. I’ll experiment with it and see

---

<div class="post-metadata">

**Author:** ![rimmartin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/rimmartin/32/166_2.png) [@rimmartin](https://forum.solidproject.org/u/rimmartin)\
**Post date:** [November 9, 2018, 2:40pm UTC](https://forum.solidproject.org/t/unit-testing-framework-for-apps/467/5 "2018-11-09T14:40:57Z")

</div>

Cypress is the Cat’s Meow!

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

---

<div class="post-metadata">

**Author:** ![real34](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/real34/32/121_2.png) [@real34](https://forum.solidproject.org/u/real34)\
**Post date:** [November 10, 2018, 9:09am UTC](https://forum.solidproject.org/t/unit-testing-framework-for-apps/467/6 "2018-11-10T09:09:45Z")

</div>

My pleasure! Happy testing 🙂

---

<div class="post-metadata">

**Author:** ![rimmartin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/rimmartin/32/166_2.png) [@rimmartin](https://forum.solidproject.org/u/rimmartin)\
**Post date:** [November 24, 2018, 6:25pm UTC](https://forum.solidproject.org/t/unit-testing-framework-for-apps/467/7 "2018-11-24T18:25:43Z")

</div>

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

```auto
  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

---

<div class="post-metadata">

**Author:** ![Smag0](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/smag0/32/310_2.png) [@Smag0](https://forum.solidproject.org/u/Smag0)\
**Post date:** [December 29, 2018, 2:24pm UTC](https://forum.solidproject.org/t/unit-testing-framework-for-apps/467/8 "2018-12-29T14:24:34Z")

</div>

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](https://docs.cypress.io/guides/references/best-practices.html#Visiting-external-sites)

---

<div class="post-metadata">

**Author:** ![rimmartin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/rimmartin/32/166_2.png) [@rimmartin](https://forum.solidproject.org/u/rimmartin)\
**Post date:** [December 29, 2018, 7:59pm UTC](https://forum.solidproject.org/t/unit-testing-framework-for-apps/467/9 "2018-12-29T19:59:05Z")

</div>

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.
