Skip to content

Commit dff9eb5

Browse files
authored
Merge pull request #113 from oslabs-beta/master
Spearmint Version 0.9
2 parents 23d5b74 + caf7429 commit dff9eb5

File tree

138 files changed

+6739
-1936
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+6739
-1936
lines changed

.DS_Store

-10 KB
Binary file not shown.

.eslintrc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true,
5+
"node": true
6+
},
7+
"extends": [
8+
"airbnb",
9+
"plugin:prettier/reccomended",
10+
"prettier/react"
11+
],
12+
"root": true,
13+
"parser": "@typescript-eslint/parser",
14+
"parserOptions": {
15+
"ecmaFeatures": {
16+
"jsx": true
17+
},
18+
"ecmaVersion": "latest",
19+
"sourceType": "module"
20+
},
21+
"plugins": [
22+
"react",
23+
"@typescript-eslint"
24+
],
25+
"rules": {
26+
27+
}
28+
}

.prettierrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"trailingComma": "es5",
3+
"tabWidth": 2,
4+
"semi": true,
5+
"singleQuote": true
6+
}

Dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# FROM node:14
2+
FROM node:16.13
3+
RUN apt-get update && apt-get install \
4+
git libx11-xcb1 libxcb-dri3-0 libxtst6 libnss3 libatk-bridge2.0-0 libgtk-3-0 libxss1 libasound2 \
5+
-yq --no-install-suggests --no-install-recommends \
6+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
7+
RUN useradd -d /spearmint spearmint
8+
USER spearmint
9+
WORKDIR /spearmint
10+
# WORKDIR sets the working directory for subsequent commands
11+
COPY . .
12+
COPY package.json .
13+
# RUN npm run install-once
14+
# RUN npm install
15+
RUN npm install -g npm@latest
16+
RUN npm install --save --legacy-peer-deps
17+
RUN npx electron-rebuild
18+
# EXPOSE 3000
19+
EXPOSE 3001
20+
# Electron needs root for sandboxing
21+
# see https://github.com/electron/electron/issues/17972
22+
USER root
23+
RUN chown root /spearmint/node_modules/electron/dist/chrome-sandbox
24+
RUN chmod 4755 /spearmint/node_modules/electron/dist/chrome-sandbox
25+
USER spearmint
26+
27+
# ADD start.sh /
28+
# RUN chmod +x /start.sh
29+
30+
# CMD ["/start.sh"]
31+
32+
CMD ["npm","start"]

README.md

Lines changed: 43 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
![](https://lh5.googleusercontent.com/5Gr2dZXHJdmIiASsPw9put-6mR20e4g1gOk-af4krREaJ7NqkZnqXLD5QgiotfNHYhGRh387HSqdhjRwxdwOvQzg9ChhfIrZz0FdxVu6gktBtG-sy1MX6Xq36Gmrzu_6G_K7LDQZ)
1+
![](/public/spearmintbg.jpg)
22

3-
Spearmint helps developers easily create functional React/Redux/Endpoint/Paint Timing 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/Puppeteer/React/Hooks/Redux/Vue/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.
44

55
# Installation
66
Please download spearmint from our [website](https://www.spearmintjs.com/). Available for Mac OS and Windows.
@@ -12,7 +12,6 @@ Please download spearmint from our [website](https://www.spearmintjs.com/). Avai
1212

1313
**Prerequisite**: Install Xcode
1414

15-
First install
1615
1. Fork and clone this repository.
1716
2. ```npm install```
1817
3. ```npm run watch```
@@ -38,42 +37,50 @@ Note: Windows users may also have to run Spearmint in admin mode
3837
# How it works
3938

4039

41-
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.
40+
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.
4241

43-
![](/public/mainPage.png)
42+
![](/public/homePage.gif)
4443

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

47-
![](/public/generateTest.png)
46+
![](/public/dropdown.png)
4847

49-
3. Spearmint will then convert user input to dynamically generate a test file, which you can click export icon on the left nav bar to automatically save the test file in the **\_\_tests\_\_** folder.
48+
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.
5049

50+
![](/public/saveTest.png)
5151

52-
4. Lastly click **Run Test** button and follow the guide and click what type of test you would like to perform.
52+
53+
4. Lastly click **Run Test** button and follow the guide on the popup and click what type of test you would like to perform.
5354
![](/public/runTest.png)
5455

5556
5. An accessibility lens has been added in the app to give developers with different mismatches various options to interact with the app.
5657

5758
![](/public/AccLens_Demo.gif)
5859

59-
6. The latest version of Spearmint has a specific focus on security. The [Snyk](https://snyk.io/) library has been utilized to ensure your application is up to snuff for various security standards and protect your application from malicious attacks.
60+
6. Spearmint provides security testing. The [Snyk](https://snyk.io/) library has been utilized to ensure your application is up to snuff for various security standards and protect your application from malicious attacks.
6061
Users can now test their application for vulnerabilities including: SQL Injection, Cross-site Scripting (XSS), Hardcoded Secrets, and much more!
6162

6263
![](/public/demos/snyk-test-app.gif)
6364

64-
# New features with version 0.8.0
65+
7. The latest version of Spearmint adopted testing capability for Vue.js. The [Vue Test Utils](https://vue-test-utils.vuejs.org/) library has been utilized to test your Vue.js application.
66+
67+
![](/public/vueTest.png)
68+
69+
# New features with version 0.9.0
6570

66-
-Security testing via Snyk
71+
* Testing capability for Vue.js
6772

68-
-Guest Login
73+
* Github Oauth login
6974

70-
-Cross-platform functionality (Mac OS w/ M1 chip, Mac OS w/ Intel chip, Windows)
75+
* Modernized and upgraded user interface with dark mode option
7176

72-
-60% reduced package size
77+
* Better user experience with draggable modals and exit buttons
7378

74-
-Accelerated startup time
79+
* Save test functionality for easier modification of tests
7580

76-
-Ample bug fixes
81+
* Cross-platform functionality (Mac OS w/ M1 chip, Mac OS w/ Intel chip, Linux/Unix)
82+
83+
* Ample bug fixes
7784

7885
<br>
7986

@@ -83,32 +90,26 @@ Users can now test their application for vulnerabilities including: SQL Injectio
8390
![](/public/demos/guest-login.gif)
8491

8592
### Signup + login
86-
![](/public/demos/signup-login.gif)
93+
![](/public/demos/pwlogin.gif)
8794

88-
### Snyk auth + dependency test
89-
![](/public/demos/snyk-auth-testdep.gif)
95+
### Github Oauth login
96+
![](/public/demos/oauth.gif)
9097

91-
### Snyk fix dependencies
92-
![](/public/demos/snyk-fixdep.gif)
98+
### Vue Test
99+
![](/public/demos/vuetest.gif)
93100

94-
### Generate endpoint test
95-
![](/public/demos/snyk-auth-testdep.gif)
101+
### Dark Mode + Upgraded UI/UX
102+
![](/public/darkMode.gif)
96103

97-
### Run a specific test
104+
### Save Test Functionality
105+
![](/public/saveTest.gif)
106+
107+
### Run a security test
98108
![](/public/demos/snyk-auth-testdep.gif)
99109

100110
<br>
101111

102112

103-
# Snyk Setup
104-
105-
106-
### Authenticate Snyk
107-
![](/public/snyk-auth-testdep.gif)
108-
109-
### Enable Snyk code
110-
![](/public/snyk-enable.gif)
111-
112113
# The Spearmint Team
113114
<hr>
114115

@@ -118,13 +119,15 @@ Users can now test their application for vulnerabilities including: SQL Injectio
118119
> Annie [@annieshinn](https://github.com/annieshinn) <br />
119120
> Ben [@bkwak](https://github.com/bkwak) <br />
120121
> Charlie [@charlie-maloney](https://github.com/charlie-maloney) <br />
122+
> Chen(Chloe) [@chloelu29](https://github.com/chloelu29) <br />
121123
> Chloe [@HeyItsChloe](https://github.com/HeyItsChloe) <br />
122124
> Cornelius [@corneeltron](https://github.com/corneeltron) <br />
123125
> Dave [@davefranz](https://github.com/davefranz) <br />
124126
> Dieu [@dieunity](https://github.com/dieunity) <br />
125127
> Eric [@ericgpark](https://github.com/ericgpark) <br />
126128
> Evan [@Berghoer](https://github.com/Berghoer) <br />
127129
> Gabriel [@bielchristo](https://github.com/bielchristo) <br />
130+
> Huy [@huyqbui](https://github.com/huyqbui)<br />
128131
> Joe [@josephnagy](https://github.com/Josephnagy) <br />
129132
> Johnny [@johnny-lim](https://github.com/johnny-lim) <br />
130133
> Julie [@julicious100](https://github.com/julicious100) <br />
@@ -135,11 +138,13 @@ Users can now test their application for vulnerabilities including: SQL Injectio
135138
> Max B[@mbromet](https://github.com/mbromet) <br />
136139
> Max W [@MaxWeisen](https://github.com/MaxWeisen) <br />
137140
> Mike [@mbcoker](https://github.com/mbcoker) <br />
141+
> Mina [@alsdk850](https://github.com/alsdk850)<br />
138142
> Mo [@mhmaidi789](https://github.com/mhmaidi789) <br />
139143
> Natlyn [@natlynp](https://github.com/natlynp) <br />
140144
> Nick [@nicolaspita](https://github.com/nicolaspita) <br />
141145
> Owen [@oweneldridge](https://github.com/oweneldridge) <br />
142146
> Rachel [@rachethecreator](https://github.com/rachethecreator) <br />
147+
> Ruzeb [@Ruzeb](https://github.com/Ruzeb) <br />
143148
> Sean Y [@seanyyoo](https://github.com/seanyyoo)<br />
144149
> Sean H [@sean-haverstock](https://github.com/Sean-Haverstock) <br />
145150
> Sharon [@sharon-zhu](https://github.com/sharon-zhu) <br />
@@ -154,6 +159,8 @@ Users can now test their application for vulnerabilities including: SQL Injectio
154159

155160
# If You Want To Contribute:
156161
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!
157-
- Vue test generation
158-
- Github OAuth login (was available in previous versions, but the components used became deprecated)
162+
- GraphQL test generation
163+
- Containerization with Docker
164+
- Exporting test files in TypeScript
159165
- Additional security testing functionality
166+
- Dry refactoring of codebase

docker-compose.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# version: '3'
2+
version: '3.0'
3+
services:
4+
frontend:
5+
# container_name: frontend
6+
# image: frontend
7+
container_name: 'frontend'
8+
image: 'frontend'
9+
security_opt:
10+
- seccomp=profile.json #Override the default labeling scheme for each container
11+
environment:
12+
- DISPLAY=host.docker.internal:0
13+
stdin_open: true #for keeping the containers open for interactive control
14+
ports:
15+
- "3000:3000" #should probably fix, think we have only backend port which is 3001?
16+
networks:
17+
- spearmint
18+
backend:
19+
container_name: backend
20+
image: backend
21+
ports:
22+
- "3001:3001"
23+
networks:
24+
- spearmint
25+
networks:
26+
spearmint:
27+
driver: bridge #specifies a logging driver for the service’s containers

package.json

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,34 @@
44
"description": "An open-source developer tool that simplifies testing and hopes to help increase awareness about web accessibility.",
55
"main": "public/electron.jsx",
66
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1",
7+
"test": "NODE_ENV=test jest",
88
"start": "electron-forge start",
99
"start-dev": "concurrently \"electron .\" \"nodemon server/server.js\"",
1010
"watch": "webpack --config webpack.config.ts --watch",
1111
"package": "electron-forge package",
1212
"make": "electron-forge make"
1313
},
14+
"build": {
15+
"appId": "spearmint",
16+
"productName": "spearmint",
17+
"mac": {
18+
"icon": "./public/icon.icns",
19+
"category": "public.app-category.utilities"
20+
},
21+
"win": {
22+
"icon": "./public/icon.png"
23+
},
24+
"files": [
25+
"./build/**/*",
26+
"./dist/**/*",
27+
"./node_modules/**/*",
28+
"./public/**/*",
29+
"*.js"
30+
],
31+
"directories": {
32+
"buildResources": "public"
33+
}
34+
},
1435
"keywords": [],
1536
"author": "team spearmint",
1637
"license": "ISC",
@@ -22,6 +43,7 @@
2243
"@codemirror/lang-javascript": "^0.19.3",
2344
"@material-ui/core": "^4.12.3",
2445
"@material-ui/icons": "^4.11.2",
46+
"@material-ui/lab": "^4.0.0-alpha.60",
2547
"@uiw/react-codemirror": "^4.2.4",
2648
"babel-loader": "^8.2.2",
2749
"bcrypt": "^5.0.1",
@@ -32,18 +54,24 @@
3254
"css-loader": "^6.2.0",
3355
"dotenv": "^10.0.0",
3456
"electron-devtools-installer": "^3.2.0",
57+
"electron-reload": "^2.0.0-alpha.1",
3558
"electron-squirrel-startup": "^1.0.0",
3659
"express": "^4.17.1",
3760
"fix-path": "^3.0.0",
3861
"js-beautify": "^1.14.0",
3962
"mongoose": "^6.0.14",
40-
"node-fetch": "^3.1.0",
63+
"node-fetch": "^3.2.0",
4164
"node-pty": "^0.10.1",
65+
"passport": "^0.5.2",
66+
"passport-github2": "^0.1.12",
4267
"react": "^17.0.2",
4368
"react-autosuggest": "^10.1.0",
4469
"react-beautiful-dnd": "^13.1.0",
4570
"react-dom": "^17.0.2",
71+
"react-draggable": "^4.4.4",
72+
"react-icons": "^4.3.1",
4673
"react-modal": "^3.14.4",
74+
"react-transition-group": "^4.4.2",
4775
"sass": "^1.37.5",
4876
"sass-loader": "^12.1.0",
4977
"save-dev": "0.0.1-security",
@@ -52,6 +80,7 @@
5280
"webpack": "^5.50.0",
5381
"webpack-cli": "^4.7.2",
5482
"xterm": "^4.15.0",
83+
"xterm-addon-fit": "^0.5.0",
5584
"xterm-for-react": "^1.0.4"
5685
},
5786
"devDependencies": {
@@ -62,14 +91,22 @@
6291
"@electron-forge/maker-squirrel": "^6.0.0-beta.61",
6392
"@electron-forge/maker-zip": "^6.0.0-beta.61",
6493
"@types/webpack-dev-server": "^3.11.5",
65-
"@typescript-eslint/parser": "^5.6.0",
94+
"@typescript-eslint/eslint-plugin": "^5.10.1",
95+
"@typescript-eslint/parser": "^5.10.1",
6696
"axe-core": "^4.3.5",
6797
"electron": "^13.6.3",
6898
"electron-rebuild": "^3.2.5",
69-
"electron-reload": "^2.0.0-alpha.1",
70-
"eslint-plugin-import": "^2.25.3",
99+
"electron-reloader": "^1.2.1",
100+
"eslint": "^8.7.0",
101+
"eslint-config-airbnb": "^19.0.4",
102+
"eslint-config-prettier": "^8.3.0",
103+
"eslint-plugin-import": "^2.25.4",
104+
"eslint-plugin-jsx-a11y": "^6.5.1",
105+
"eslint-plugin-react": "^7.28.0",
106+
"eslint-plugin-react-hooks": "^4.3.0",
71107
"jest": "^27.4.5",
72108
"nodemon": "^2.0.15",
109+
"prettier": "2.5.1",
73110
"regenerator-runtime": "^0.13.9",
74111
"ts-node": "^10.2.0",
75112
"typescript": "^4.3.5",

public/darkMode.gif

6.54 MB
Loading

public/demos/guest-login.gif

40.4 KB
Loading

public/demos/oauth.gif

977 KB
Loading

0 commit comments

Comments
 (0)