diff --git a/LICENSE b/LICENSE
index 6d1eddf5..1eb34609 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2019 spearmintjs
+Copyright (c) 2019-2021 spearmintjs
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index c9e230e5..40c5f1c5 100644
--- a/README.md
+++ b/README.md
@@ -2,10 +2,14 @@
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.
-## How to use
+# How to use
Download spearmint @ spearmintjs.com. Available for Mac OS and Windows.
+
+
+### React Testing
+
To run React tests generated by spearmint, install the following in your dev dependencies.
npm i -D jest @testing-library/jest-dom @testing-library/react test-data-bot
@@ -18,15 +22,44 @@ To run Hooks / Context tests generated by spearmint, install the following in yo
npm i -D @testing-library/react-hooks
+
+
+### Endpoint Testing
+
To run Endpoint tests generated by spearmint, install the following in your dev dependencies.
npm i -D jest supertest
+
+
+### Puppeteer Testing
+
To run Puppeteer tests generated by spearmint, install the following in your dev dependencies.
npm i -D jest puppeteer
-## How it works
+
+
+
+### Accessiblity Testing
+
+
+To run Accessibility tests generated by spearmint on HTML, install the following in your dev dependencies.
+
+ npm i -D axe-core regenerator-runtime jest
+
+To run Accessibility tests generated by spearmint on React Components, install the following in your dev dependencies.
+
+ npm i -D axe-core regenerator-runtime jest enzyme enzyme-adapter-react-16
+
+To run Accessibility tests generated by spearmint on URL's with Puppeteer, install the following in your dev dependencies.
+
+ npm i -D axe-core puppeteer
+
+
+
+
+# How it works
1. On the initial screen, enter the URL of your project and load your application to start creating tests.
@@ -42,16 +75,22 @@ To run Puppeteer tests generated by spearmint, install the following in your dev
![](/public/testfile.png?raw=true)
-## Team
+
+
+### The Spearmint Team
+
> Alex [@apark0720](https://github.com/apark0720) ·
+> Alfred [@astaiglesia](https://github.com/astaiglesia) ·
+> Annie [@annieshinn](https://github.com/annieshinn) ·
> Ben [@bkwak](https://github.com/bkwak) ·
-> Charlie [@charlie-maloney](https://github.com/charlie-maloney) ·
-> Chloe [@HeyItsChloe](https://github.com/HeyItsChloe)
+> Charlie [@charlie-maloney](https://github.com/charlie-maloney)
+> Chloe [@HeyItsChloe](https://github.com/HeyItsChloe) ·
> Cornelius [@corneeltron](https://github.com/corneeltron) ·
> Dave [@davefranz](https://github.com/davefranz) ·
> Evan [@Berghoer](https://github.com/Berghoer) ·
-> Johnny [@johnny-lim](https://github.com/johnny-lim)
+> Gabriel [@bielchristo](https://github.com/bielchristo)
+> Johnny [@johnny-lim](https://github.com/johnny-lim) ·
> Julie [@julicious100](https://github.com/julicious100) ·
> Karen [@karenpinilla](https://github.com/karenpinilla) ·
> Linda [@lcwish](https://github.com/lcwish) ·
@@ -59,7 +98,10 @@ To run Puppeteer tests generated by spearmint, install the following in your dev
> Mike [@mbcoker](https://github.com/mbcoker) ·
> Natlyn [@natlynp](https://github.com/natlynp) ·
> Nick [@nicolaspita](https://github.com/nicolaspita) ·
-> Rachel [@rachethecreator](https://github.com/rachethecreator)
-> Sean [@sean-haverstock](https://github.com/Sean-Haverstock) ·
+> Rachel [@rachethecreator](https://github.com/rachethecreator) ·
+> Sean [@sean-haverstock](https://github.com/Sean-Haverstock)
+> Sharon [@sharon-zhu](https://github.com/sharon-zhu) ·
> Sieun [@sieunjang](https://github.com/sieunjang) ·
-> Tristen [@twastell](https://github.com/twastell)
+> Tolan [@taoantaoan](https://github.com/taoantaoan) ·
+> Tristen [@twastell](https://github.com/twastell)
+
\ No newline at end of file
diff --git a/todoDemo.mov b/deprecated files/todoDemo.mov
similarity index 100%
rename from todoDemo.mov
rename to deprecated files/todoDemo.mov
diff --git a/package.json b/package.json
index f4a53634..82b4b970 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
- "name": "Spearmint",
- "version": "0.1.0",
- "description": "Spearmint",
+ "name": "spearmint",
+ "version": "0.5.0",
+ "description": "An open-source developer tool that simplifies testing and hopes to help increase awareness about web accessibility.",
"author": "spearmintjs",
"build": {
"appId": "com.spearmint",
@@ -37,20 +37,23 @@
"react-dom": "^16.8.6",
"react-modal": "^3.8.1",
"react-monaco-editor": "^0.25.1",
- "react-scripts": "3.4.1",
+ "react-scripts": "^3.4.1",
"sass": "^1.26.5",
"typescript": "^3.9.2",
"wait-on": "^3.3.0"
},
"scripts": {
- "react-start": "react-scripts start",
- "react-build": "NODE_ENV=production react-scripts build",
"test": "react-scripts test --env=jsdom",
+ "test:e2e": "./node_modules/mocha/bin/mocha src/__tests__/spec.e2e.js",
+ "test:integra": "mocha src/__tests__/spec.integra.js",
"test:watch": "jest --watch",
+ "react-start": "react-scripts start",
"react-eject": "react-scripts eject",
+ "build": "NODE_ENV=production npm run react-build && npm run electron-build",
+ "react-build": "NODE_ENV=production react-scripts build",
"electron-build": "NODE_ENV=production electron-builder -mwl",
"release": "npm run react-build && electron-builder --publish=always",
- "build": "NODE_ENV=production npm run react-build && npm run electron-build",
+ "start-windows": "SET NODE_ENV=development concurrently \"cross-env BROWSER=none npm run react-start\" \"wait-on http://localhost:3000 && electron .\"",
"start": "NODE_ENV=development concurrently \"cross-env BROWSER=none npm run react-start\" \"wait-on http://localhost:3000 && electron .\""
},
"browserslist": {
@@ -69,9 +72,12 @@
"@testing-library/jest-dom": "^5.8.0",
"@testing-library/react": "^8.0.9",
"@testing-library/react-hooks": "^3.2.1",
+ "@types/classnames": "^2.2.11",
"@types/jest": "^25.2.3",
"@typescript-eslint/eslint-plugin": "^2.33.0",
"@typescript-eslint/parser": "^2.33.0",
+ "chai": "^4.3.4",
+ "chai-as-promised": "^7.1.1",
"electron": "^5.0.3",
"electron-builder": "^22.6.1",
"electron-devtools-installer": "^3.0.0",
@@ -82,6 +88,7 @@
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.20.0",
"eslint-plugin-react-hooks": "^2.5.1",
+ "mocha": "^8.3.2",
"react-test-renderer": "^16.12.0",
"spectron": "^5.0.0",
"test-data-bot": "^0.8.0"
diff --git a/public/index.html b/public/index.html
index d8464cb2..36315630 100644
--- a/public/index.html
+++ b/public/index.html
@@ -20,7 +20,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
- spearmint
+ spearmint | testing, simplified
@@ -42,6 +42,5 @@
return '/monaco-editor-worker-loader-proxy.js';
},
};
- // require(['vs/editor/editor.main'], function() {});
diff --git a/src/App.jsx b/src/App.jsx
index 55fdbb3c..3705bd11 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -8,10 +8,6 @@ import RightPanel from './pages/RightPanel/RightPanel';
import About from './pages/About/About';
const App = () => {
- // useReducer takes a reducer and initial state as
- // args and return the current state paired with a dispatch method
- // distpatchTo method invokes associated reducer function
-
const [global, dispatchToGlobal] = useReducer(globalReducer, globalState);
if (!global.isProjectLoaded) {
diff --git a/src/__tests__/globalReducer.test.js b/src/__tests__/globalReducer.test.js
index 3d4e2d8b..868daf32 100644
--- a/src/__tests__/globalReducer.test.js
+++ b/src/__tests__/globalReducer.test.js
@@ -179,14 +179,14 @@ describe('Global Reducer works properly', () => {
});
});
- it('should handle UPDATE_FILE_SHOW', () => {
- let action = { type: 'UPDATE_FILE_SHOW', testString: '' };
+ it('should handle UPDATE_FILE', () => {
+ let action = { type: 'UPDATE_FILE', testString: '' };
expect(globalReducer(initialState, action)).toEqual({
...initialState,
file: '',
});
action = {
- type: 'UPDATE_FILE_SHOW',
+ type: 'UPDATE_FILE',
testString: `import React from "react";
import { render, fireEvent } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect`,
diff --git a/src/__tests__/spec.e2e.js b/src/__tests__/spec.e2e.js
new file mode 100644
index 00000000..e816cd07
--- /dev/null
+++ b/src/__tests__/spec.e2e.js
@@ -0,0 +1,49 @@
+const Application = require('spectron').Application;
+const path = require('path');
+const chai = require('chai');
+const chaiAsPromised = require('chai-as-promised');
+
+// specifies the path of the application to launch
+const electronPath = require('electron');
+
+// tell spectron to look and use the main.js file + package.json located 2 levels above
+const appPath = path.join(__dirname, '../..');
+
+
+// instantiates the spearmint application given the optional paramaters of the Application API
+const app = new Application({
+ path: electronPath, // string path to the Electron application executable to launch
+ args: [appPath], // array of paths to find the executable files and package.json
+});
+
+// define the use of chai and chai as promised packages
+global.before(function () {
+ chai.should();
+ chai.use(chaiAsPromised);
+});
+
+describe('Application Accessibility Audit', function () {
+ this.timeout(10000);
+
+ beforeEach(function () {
+ return app.start();
+ });
+
+ afterEach(function () {
+ if (app && app.isRunning()) {
+ return app.stop();
+ }
+ });
+
+ it('Audits Accessibility', function (done) {
+ app.client.auditAccessibility().then(function (audit) {
+ if (audit.failed) {
+ console.error('Please address the following accessibility issues in your application: \n', audit.results)
+ }
+ else {
+ console.log('No accessibility issues have been found.')
+ }
+ done()
+ })
+ });
+});
\ No newline at end of file
diff --git a/src/__tests__/spec.integra.js b/src/__tests__/spec.integra.js
new file mode 100644
index 00000000..a712ff1f
--- /dev/null
+++ b/src/__tests__/spec.integra.js
@@ -0,0 +1,41 @@
+const Application = require('spectron').Application;
+const path = require('path');
+const assert = require('assert');
+
+// specifies the path of the application to launch
+const electronPath = require('electron');
+
+// tell spectron to look and use the main.js file + package.json located 2 levels above
+const appPath = path.join(__dirname, '../..');
+
+// instantiates the spearmint application given the optional paramaters of the Application API
+const app = new Application({
+ path: electronPath, // string path to the Electron application executable to launch
+ args: [appPath], // array of paths to find the executable files and package.json
+});
+
+
+describe('Application Accessibility Audit', function () {
+ this.timeout(10000);
+
+ beforeEach(function () {
+ return app.start();
+ });
+
+ afterEach(function () {
+ if (app && app.isRunning()) {
+ return app.stop();
+ }
+ });
+
+ it('Audits Accessibility', function () {
+ return app.client.auditAccessibility().then(function (audit) {
+ if (audit.failed) {
+ console.error('Please address the following accessibility issues in your application: \n', audit.results)
+ }
+ else {
+ console.log('No accessibility issues have been found.')
+ }
+ })
+ });
+});
\ No newline at end of file
diff --git a/src/assets/images/spearmintHomepage.png b/src/assets/images/spearmintHomepage.png
new file mode 100644
index 00000000..ade25ff4
Binary files /dev/null and b/src/assets/images/spearmintHomepage.png differ
diff --git a/src/assets/stylesheets/colors.scss b/src/assets/stylesheets/colors.scss
index d1b06664..7ffe1fdf 100644
--- a/src/assets/stylesheets/colors.scss
+++ b/src/assets/stylesheets/colors.scss
@@ -1,5 +1,5 @@
-$mint: #02c2c3;
-$mint2: #69e5ce;
+$mint: #038181;
+$mint2: #02c3c33f;
$dark-gray: #808080;
$light-gray: #d5d5d5;
$light-gray2: #f6f8f9;
diff --git a/src/assets/stylesheets/reset.scss b/src/assets/stylesheets/reset.scss
index 630b3f53..09272c4f 100644
--- a/src/assets/stylesheets/reset.scss
+++ b/src/assets/stylesheets/reset.scss
@@ -89,7 +89,7 @@ video {
/* make sure to set some focus styles for accessibility */
:focus {
- outline: 0;
+ outline: 2px solid darkblue;
}
/* HTML5 display-role reset for older browsers */
diff --git a/src/components/AccTestComponent/AccTestTypes/AccTestTypes.module.scss b/src/components/AccTestComponent/AccTestTypes/AccTestTypes.module.scss
new file mode 100644
index 00000000..84759b4b
--- /dev/null
+++ b/src/components/AccTestComponent/AccTestTypes/AccTestTypes.module.scss
@@ -0,0 +1,13 @@
+#AccTestTypesComponent{
+ margin-right: 35px;
+}
+
+#AccTestTypesLabel {
+ display: block;
+ margin-bottom: 6px;
+}
+
+.AccTestTypesInput{
+ margin-top: 4px;
+ min-height: 35px;
+}
\ No newline at end of file
diff --git a/src/components/AccTestComponent/AccTestTypes/AccTestTypes.tsx b/src/components/AccTestComponent/AccTestTypes/AccTestTypes.tsx
new file mode 100644
index 00000000..aa3ff600
--- /dev/null
+++ b/src/components/AccTestComponent/AccTestTypes/AccTestTypes.tsx
@@ -0,0 +1,23 @@
+import React from 'react';
+import styles from './AccTestTypes.module.scss';
+
+const AccTestTypes = ({ dispatch, action, currTypes }) => {
+ const handleChange = (e: React.ChangeEvent) => {
+ dispatch(action(e.target.value));
+ };
+
+ return (
+
-
+
New Test +
diff --git a/src/components/TestMenu/PuppeteerTestMenu.tsx b/src/components/TestMenu/PuppeteerTestMenu.tsx
index 9c1d6c64..7b36ea9b 100644
--- a/src/components/TestMenu/PuppeteerTestMenu.tsx
+++ b/src/components/TestMenu/PuppeteerTestMenu.tsx
@@ -53,7 +53,7 @@ const PuppeteerTestMenu = () => {
-
+
New Test +
Preview
diff --git a/src/components/TestMenu/ReactTestMenu.jsx b/src/components/TestMenu/ReactTestMenu.jsx
index 9ad5a50b..f235f913 100644
--- a/src/components/TestMenu/ReactTestMenu.jsx
+++ b/src/components/TestMenu/ReactTestMenu.jsx
@@ -50,7 +50,7 @@ const ReactTestMenu = () => {
- New Test +
+ New Test +Preview
Run Test
diff --git a/src/components/TestMenu/ReduxTestMenu.tsx b/src/components/TestMenu/ReduxTestMenu.tsx
index b3c3aba5..5d13c395 100644
--- a/src/components/TestMenu/ReduxTestMenu.tsx
+++ b/src/components/TestMenu/ReduxTestMenu.tsx
@@ -67,7 +67,7 @@ const ReduxTestMenu = () => {
- Spearmint helps developers easily create functional React/Redux/Endpoint/Paint Timing
+ Spearmint helps developers easily create functional React/Redux/Endpoint/Paint Timing/Accessibility
tests without writing any code. It dynamically converts user inputs into executable Jest
test code by using DOM query selectors provided by @testing-library.
@@ -61,6 +62,30 @@ const About = ({ dispatch: dispatchToGlobal }: { dispatch: (action: Action) => v
npm i -D jest puppeteer
+
+
+
+ To run Accessibility tests generated by spearmint on HTML, install the following in your dev dependencies.
+
+
+ npm i -D axe-core regenerator-runtime jest
+
+
+
+ To run Accessibility tests generated by spearmint on React Components, install the following in your dev dependencies.
+
+
+ npm i -D axe-core regenerator-runtime jest enzyme enzyme-adapter-react-16
+
+
+
+ To run Accessibility tests generated by spearmint on URL's with Puppeteer, install the following in your dev dependencies.
+
+
+ npm i -D axe-core puppeteer
+
+
+
How it works
@@ -70,8 +95,8 @@ const About = ({ dispatch: dispatchToGlobal }: { dispatch: (action: Action) => v
@@ -83,7 +108,7 @@ const About = ({ dispatch: dispatchToGlobal }: { dispatch: (action: Action) => v
-
+
@@ -102,11 +127,16 @@ const About = ({ dispatch: dispatchToGlobal }: { dispatch: (action: Action) => v