├── .gitignore ├── LICENSE ├── README.md └── cy.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Walmyr 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cysh 2 | 3 | This project offers a single shell script that quickly initializes a [Cypress](https://cypress.io) testing automation project from scratch. 4 | 5 | > **Note:** This script only works on Unix-based operating systems, such as Linux and OSX. 6 | 7 | ## Usage 8 | 9 | 1. Download the [`cy.sh`](./cy.sh) file and move it to your root directory 10 | 11 | 2. In the root directory, run `./cy.sh name-of-the-project-you-want-to-create` to create a Cypress project from scratch (you might have first to give execution permission to the `cy.sh` file) 12 | 2.1. Alternatively, you can run `./cy.sh name-of-your-project-here x.x.x` (where `x.x.x` is the specific Cypress version you want to install). Otherwise, the latest version is installed. 13 | 14 | 3. After the script is run, access the newly created directory and run `npx cypress open` to start Cypress for the first time so it will bootstrap itself. 15 | 16 | ## What does `cy.sh` do? 17 | 18 | To understand exactly what it does, read the comments in the [cy.sh](./cy.sh) file. 19 | 20 | ## Support this project 21 | 22 | If you liked this project, consider leaving a ⭐. 23 | 24 | ___ 25 | 26 | Created with 🖤 by [Walmyr](https://walmyr.dev). 27 | -------------------------------------------------------------------------------- /cy.sh: -------------------------------------------------------------------------------- 1 | # Create the project directory and access it 2 | mkdir workspaces/$1 3 | cd workspaces/$1 4 | # Initialize git and .gitignore 5 | git init 6 | touch .gitignore 7 | echo ".DS_Store\ncypress.env.json\ncypress/downloads/\ncypress/screenshots/\ncypress/videos/\nnode_modules/" > .gitignore 8 | # Create a readme file to be defined 9 | touch README.md 10 | echo "# $1\n\nTBD." > README.md 11 | # Initialize npm 12 | npm init -y 13 | # Install Cypress (if the version is provided, it will install it, otherwise, the latestet version is installed) 14 | if [ "$2" ]; then 15 | npm i cypress@"$2" -D 16 | else 17 | npm i cypress -D 18 | fi 19 | # Create the cypress.env.json and cypress.env.example.json files defaulting them to empty objects 20 | touch cypress.env.json 21 | echo "{}" > cypress.env.json 22 | touch cypress.env.example.json 23 | echo "{}" > cypress.env.example.json 24 | # Version and commit all the files and directories 25 | git add . 26 | git commit -m "Create cypress project" 27 | # Open the project on VSCode 28 | code . 29 | --------------------------------------------------------------------------------