Skip to content

Commit 156f004

Browse files
authored
Merge pull request #123 from open-source-labs/dev
Updated readme
2 parents 112cfd9 + 7bed436 commit 156f004

38 files changed

+36327
-130
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
APP_DEV=true
22
BROWSER=non
33
SKIP_PREFLIGHT_CHECK=true
4-
MONGO_LINK=
4+
MONGO_LINK=mongodb://localhost:27017

Dockerfile

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# FROM node:14
1+
# use node version 16.13
22
FROM node:16.13
33
RUN apt-get update && apt-get install \
44
git libx11-xcb1 libxcb-dri3-0 libxshmfence-dev libdrm-dev \
@@ -9,47 +9,34 @@ RUN apt-get update && apt-get install \
99
&& apt-get clean && rm -rf /var/lib/apt/lists/*
1010

1111
RUN useradd -d /spearmint spearmint
12-
#creates home directory for the user and ensures bash is default shell
12+
13+
# root here to bypass permissions, not the best way to do this
1314
# USER spearmint
1415
USER root
15-
# root here to bypass permissions, not the best way to do this
16-
WORKDIR /spearmint
16+
1717
# WORKDIR sets the working directory for subsequent commands
18+
WORKDIR /spearmint
19+
1820
COPY . .
1921
COPY package.json .
2022

21-
# RUN npm run install-once
22-
# # RUN npm install
23-
RUN rm -rf node_modules
2423
# remove node modules from the file and only leave dependencies to be installed later
25-
# RUN npm install -g npm@latest
26-
# USER node
24+
RUN rm -rf node_modules
25+
# install node modules
2726
RUN npm install -force
28-
# global configuration
29-
# RUN npm install --save --legacy-peer-deps
30-
# "restor peer dependy instalatino behavrio from NPM v4 thru v6"
31-
# RUN npx electron-forge package
32-
# RUN npx electron-forge make
3327
RUN npx electron-rebuild -f -w node-pty
3428

3529

36-
# EXPOSE 3000
30+
# EXPOSE port 3001
3731
EXPOSE 3001
32+
3833
# Electron needs root for sandboxing
3934
# see https://github.com/electron/electron/issues/17972
4035
USER root
4136
RUN chown root /spearmint/node_modules/electron/dist/chrome-sandbox
4237
# adding additional layers to the image without deleteing the previos layer
4338
RUN chmod 4755 /spearmint/node_modules/electron/dist/chrome-sandbox
44-
# USER spearmint
45-
#commands to try to run using XQuartz
46-
# RUN apt-get update && apt-get install -y firefox
47-
# CMD ["/usr/bin/firefox"]
48-
49-
# ADD start.sh /
50-
# RUN chmod +x /start.sh
5139

52-
# CMD ["/start.sh"]
40+
# USER spearmint
5341
USER root
5442
CMD bash
55-
# CMD npm run start

README-dev.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# How to use in development mode
2+
3+
**Mac Developers**: Install Xcode
4+
5+
**Windows Developers**: Install Node.js globally, may also have to run Spearmint in admin mode.
6+
7+
1. Fork and clone this repository.
8+
2. Use node version 16.13: ```nvm use 16.13``` (make sure that you already installed v 16.13, ```nvm install 16.13```)
9+
3. ```npm install```
10+
4. Create a .env file in the root directory of the project
11+
5. Insert the following lines of code into the .env file
12+
```
13+
APP_DEV=true
14+
BROWSER=non
15+
SKIP_PREFLIGHT_CHECK=true
16+
MONGO_LINK=
17+
```
18+
6. Set MONGO_LINK to your MongoDB URI (ex: mongodb://localhost:27017)
19+
7. Make sure your MongoDB is running if it's hosted locally.
20+
8. ```npm run rebuild```
21+
9. ```npm run watch``` on one terminal
22+
10. ```npm run start-dev``` on another terminal, make sure you also use node version 16.13 in this terminal.
23+
24+
25+
26+
# Build and Run image on Docker
27+
28+
## Pre-requisites
29+
- Mongo: Mongodb is used for authentication functionality. If you didn't use locally hosted mongodb URI in .env file, you may skip to the X server section.
30+
31+
1. Add `172.17.0.1` and `0.0.0.0` to the network interfaces of mongo config file.
32+
33+
a. Open `mongod.cfg` (Usually located in C:\Program Files\MongoDB\Server\4.4\bin)
34+
35+
# network interfaces
36+
net:
37+
port: 27017
38+
bindIp: 127.0.0.1, 172.17.0.1, 0.0.0.0
39+
40+
2. Run mongo on port 27017
41+
42+
- X server
43+
44+
1. Download and run either [X410](https://x410.dev/) or [VcXsrv](https://sourceforge.net/projects/vcxsrv/)
45+
46+
* For X410, use the following configuration
47+
48+
![x410 with display = 0](/public/x410.png)
49+
50+
* For VcXsrv: change the display number to 0, for other settings, use default.
51+
52+
![VcXsrv with display = 0](/public/VcXsrv.png)
53+
54+
55+
## Running the image
56+
After running the mongo on port 27017 and running the x server with display number of 0, follow the steps below.
57+
58+
1. Build the docker image by running the following command
59+
60+
`docker build -t [image name] .`
61+
62+
2. Run the docker image by using the following command:
63+
64+
`docker run -e DISPLAY='host.docker.internal:0.0' -it -v [directory of project to be tested]:/[directory to create volume] [image name]`
65+
66+
- `-e DISPLAY='host.docker.internal:0.0'`: Set environment variable ‘display’ to host.docker.internal:0.0
67+
68+
- `-it`: Run container as interactive
69+
70+
- `-v`: Creates a volume and mounts the testing application into the container. (ex: `-v [testing files]:[created volume]`)
71+
72+
*Please note that once the spearmint container is running, you can only access the folders that you mounted here.
73+
74+
*Please note that the image uses root user, as shown in the Dockerfile.
75+

README.md

Lines changed: 32 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,14 @@
11
![](/public/spearmint_crop.png)
22

3-
Spearmint helps developers easily create functional Accessibility, Endpoint, GraphQL, Puppeteer, React, Hooks, Redux, Svelte, Vue, and Security tests without writing any code. It dynamically converts user inputs into executable Jest test code by using DOM query selectors provided by @testing-library.
3+
Spearmint helps developers easily create functional Accessibility, Endpoint, GraphQL, Puppeteer, React, Hooks, Redux, Svelte, Vue, Security, and now **_Solid.js_** tests without writing any code. It dynamically converts user inputs into executable Jest test code by using DOM query selectors provided by @testing-library.
44

55
# Installation
6-
Please download spearmint from our [website](https://www.spearmintjs.com/). Available for Mac OS, Windows, and Linux.
6+
Please download spearmint from our [website](https://www.spearmintjs.com/).
77

88

99
# How to use in development mode
1010

11-
**Mac Developers**: Install Xcode
12-
13-
**Windows Developers**: Install Node.js globally
14-
15-
1. Fork and clone this repository.
16-
2. ```npm install```
17-
3. ```npm run watch```
18-
4. ```npm run start-dev```
19-
20-
Note: Windows users may also have to run Spearmint in admin mode
21-
22-
5. Create a .env file in the root directory of the project
23-
6. Insert the following lines of code into the .env file
24-
```
25-
APP_DEV=true
26-
BROWSER=non
27-
SKIP_PREFLIGHT_CHECK=true
28-
MONGO_LINK=
29-
```
30-
7. Set MONGO_LINK to your MongoDB URI
31-
11+
Please refer to [README-dev.md](https://github.com/open-source-labs/spearmint/blob/main/README-dev.md)
3212

3313
<br>
3414

@@ -38,93 +18,55 @@ MONGO_LINK=
3818

3919
1. On the initial screen, a user is prompt to login, sign up (via OAuth or standard sign-up/login), or login as a guest. Once logged in, choose your file and load your application to start creating tests.
4020

41-
![](/public/darkModeLogin.gif)
21+
![Demo of the login page](/public/LoginDemo.gif)
4222

43-
2. Utilize our auto-complete, drop-down options, and tooltips features to easily create arrangement, action, and assertion test statements for React, Vue, and Svelte; reducer, action creator, asynchronous action creator, and middleware test statements for Redux; and hooks, context, endpoint, and GraphQL test statements. Spearmint can save test templates for future use for logged in user (not guests).
23+
2. Utilize our auto-complete, drop-down options, and tooltips features to easily create arrangement, action, and assertion test statements for React, Vue, Svelte, and Solid; reducer, action creator, asynchronous action creator, and middleware test statements for Redux; and hooks, context, endpoint, and GraphQL test statements. Spearmint can save test templates for future use for logged in user (not guests).
4424

45-
![](/public/testingModal.png)
25+
![Demo of the show button](/public/ShowDemo.gif)
4626

4727
3. Spearmint will then convert user input to dynamically generate a test file. You can click the export icon on the nav bar to automatically save the test file in the **\_\_tests\_\_** folder to run test or to modify in the future.
4828

49-
![](/public/saveTest.png)
29+
![Demo of the save button](/public/SaveDemo.gif)
5030

5131

5232
4. Lastly click **Run Test** button and follow the guide on the popup and click what type of test you would like to perform.
53-
![](/public/runTest.png)
54-
33+
![Demo of the run button](/public/RunDemo.gif)
5534

56-
5. The latest version of Spearmint adopted testing capability for Svelte and GraphQL. The [Svelte](https://testing-library.com/docs/svelte-testing-library/intro/) library has been utilized to test your Svelte application.
35+
5. Spearmint v.0.11 now supports Solid.js, an up-and-coming front-end JavaScript library.
5736

58-
![](/public/svelte.gif)
37+
![Screenshot of the solid panel](/public/demo.png)
5938

60-
# New features with version 0.10.0
39+
# Containerization with Docker
40+
Spearmint is now available as an OCI-compliant container image via Docker.
6141

62-
* Testing capability for Svelte components
42+
Windows and Linux users may access Spearmint by running a Docker image.
6343

64-
* GraphQL endpoint testing functionality
44+
Please pull down the image from [Docker hub](https://hub.docker.com/repository/docker/spearmintoslabs/spearmint) if you would like to run Spearmint on Docker.
6545

66-
* Google Oauth
46+
![Screenshot of spearmint's docker hub webpage](/public/docker.png)
6747

68-
* Facebook Oauth
48+
For developers: [README-dev.md](https://github.com/open-source-labs/spearmint/blob/main/README-dev.md)
6949

70-
* Dependency refactoring
50+
# New features with version 0.11.0
7151

72-
* Additional typescript component conversions
52+
* Testing capability for Solid.js components
7353

74-
* Logout button
54+
* Optimized UI/UX features
7555

76-
* UI/UX streamlining
77-
78-
* Ample bug fixes
56+
* Containerization in Docker
7957

8058
<br>
8159

82-
<!-- # Demos
83-
84-
### Guest login
85-
![](/public/demos/guest-login.gif)
86-
87-
### Signup + login
88-
![](/public/demos/pwlogin.gif)
89-
90-
### Github Oauth login
91-
![](/public/demos/oauth.gif)
92-
93-
### Facebook Oauth login
94-
![](/public/demos/oauth2.gif)
95-
96-
### Google Oauth login
97-
![](/public/demos/oauth3.gif)
98-
99-
### Vue Test
100-
![](/public/demos/vuetest.gif)
101-
102-
### Svelte Test
103-
![](/public/demos/sveltetest.gif)
104-
105-
### GraphQL Test
106-
![](/public/demos/graphqltest.gif)
107-
108-
### Dark Mode + Upgraded UI/UX
109-
![](/public/darkMode.gif)
110-
111-
### Save Test Functionality
112-
![](/public/saveTest.gif)
113-
114-
### Run a security test
115-
![](/public/demos/snyk-auth-testdep.gif)
116-
117-
<br> -->
118-
119-
12060
# The Spearmint Team
12161
<hr>
12262

12363
> Alan [@alanrichardson7](https://github.com/alanrichardson7) <br />
12464
> Alex [@apark0720](https://github.com/apark0720) <br />
12565
> Alfred [@astaiglesia](https://github.com/astaiglesia) <br />
66+
> Anjanie [@anjaniemccoy](https://github.com/anjaniemccoy) <br />
12667
> Annie [@annieshinn](https://github.com/annieshinn) <br />
12768
> Ben [@bkwak](https://github.com/bkwak) <br />
69+
> Chacta [@StaticShock93](https://github.com/StaticShock93) <br />
12870
> Charlie [@charlie-maloney](https://github.com/charlie-maloney) <br />
12971
> Chen(Chloe) [@chloelu29](https://github.com/chloelu29) <br />
13072
> Chloe [@HeyItsChloe](https://github.com/HeyItsChloe) <br />
@@ -134,7 +76,8 @@ MONGO_LINK=
13476
> Dave [@davefranz](https://github.com/davefranz) <br />
13577
> Deriante [@dsin16](https://github.com/dsin16) <br />
13678
> Dieu [@dieunity](https://github.com/dieunity) <br />
137-
> Eric [@ericgpark](https://github.com/ericgpark) <br />
79+
> Eric K. [@etkomatsu](https://github.com/etkomatsu) <br />
80+
> Eric P. [@ericgpark](https://github.com/ericgpark) <br />
13881
> Evan [@Berghoer](https://github.com/Berghoer) <br />
13982
> Gabriel [@bielchristo](https://github.com/bielchristo) <br />
14083
> Huy [@huyqbui](https://github.com/huyqbui) <br />
@@ -144,10 +87,11 @@ MONGO_LINK=
14487
> Julie [@julicious100](https://github.com/julicious100) <br />
14588
> Justin [@JIB3377](https://github.com/JIB3377) <br />
14689
> Karen [@karenpinilla](https://github.com/karenpinilla) <br />
90+
> Li [@delacour124](https://github.com/delacour124) <br />
14791
> Linda [@lcwish](https://github.com/lcwish) <br />
14892
> Luis [@Luis-KM-Lo](https://github.com/Luis-KM-Lo) <br />
149-
> Max B[@mbromet](https://github.com/mbromet) <br />
150-
> Max W [@MaxWeisen](https://github.com/MaxWeisen) <br />
93+
> Max B. [@mbromet](https://github.com/mbromet) <br />
94+
> Max W. [@MaxWeisen](https://github.com/MaxWeisen) <br />
15195
> Mike [@mbcoker](https://github.com/mbcoker) <br />
15296
> Mina [@alsdk850](https://github.com/alsdk850) <br />
15397
> Mo [@mhmaidi789](https://github.com/mhmaidi789) <br />
@@ -157,21 +101,21 @@ MONGO_LINK=
157101
> Owen [@oweneldridge](https://github.com/oweneldridge) <br />
158102
> Rachel [@rachethecreator](https://github.com/rachethecreator) <br />
159103
> Ruzeb [@Ruzeb](https://github.com/Ruzeb) <br />
160-
> Sean Y [@seanyyoo](https://github.com/seanyyoo) <br />
161-
> Sean H [@sean-haverstock](https://github.com/Sean-Haverstock) <br />
104+
> Sean H. [@sean-haverstock](https://github.com/Sean-Haverstock) <br />
105+
> Sean Y. [@seanyyoo](https://github.com/seanyyoo) <br />
162106
> Sharon [@sharon-zhu](https://github.com/sharon-zhu) <br />
163107
> Sieun [@sieunjang](https://github.com/sieunjang) <br />
164108
> Terence [@TERR-inss](https://github.com/TERR-inss) <br />
165109
> Tolan [@taoantaoan](https://github.com/taoantaoan) <br />
166110
> Tristen [@twastell](https://github.com/twastell) <br />
167-
> Tyler [@tytyjameson](https://github.com/tytyjameson)
111+
> Tyler [@tytyjameson](https://github.com/tytyjameson) <br />
112+
> Yeunha [@yeunhakim93](https://github.com/yeunhakim93)
168113
<hr>
169114
170115
***
171116

172117
# If You Want To Contribute:
173118
The following is a list of features + improvements for future open-source developers that the Spearmint team has either started or would like to see implemented. Or, if you have additional new ideas, feel free to implement those as well!
174-
- Containerization with Docker
175119
- Exporting test files in TypeScript
176120
- Additional security testing functionality
177-
- Dry refactoring of codebase
121+
- Dry refactoring of codebase

docker-compose.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)