diff --git a/README.md b/README.md index 90a479fc..62d225f9 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,25 @@ # Lifen Autotest Hangout with Simon Priet -Description +This is a branch that does pure cypress code, and don't rely on gherkin and `cypress-cucumber-preprocessor`. It's less stable than the main branch and can be reviewed as extra work. If you did not reviewed the main branch, please inspect it first as it is intented to be the main hang out. I used pure js to code the automation, then refactored it to fit in the gherkin syntax. I found it was simpler for me to code first, then adapt the code to a `feature` file. + +Currently, cypress is still challenged with a SMS code, and I have not implemented a workaround. Cypress wait 20 for the operator to put the code in the GUI, then continue. Please feel free to reconfigure your environment with your own phone number to try out. **However**, this automate can't be industrialized into a CI/CD pipeline. + +I fond 2 tools that can help us more: + +* [`cypress-recurse` ๐ŸŒ](https://github.com/bahmutov/cypress-recurse) can retry several time a request until a certain condition is meet. This can help us wait for Irรจne to process the CommunicationRequest (`draft` โ†’ `suspended`), before going any further. +* [`cypress-mailosaur` ๐ŸŒ](https://mailosaur.com/docs/frameworks-and-tools/cypress/) is a mail and text provided that can help us read texts content sent by the server to a predefined phone number, and work around the text code challenge. # Installation -The code has been written with VSC in mind, so a launch.json is available to help run and debug the softwares. No helpers are available for other IDE. +The code has been written with VSC in mind, on a Windows 10 machine, so a launch.json is available to help run and debug the softwares. No helpers are available for other IDE. 1. Clone the repo to your local computer. You will need the following requierement: * Node.js 16 * Git -2. In VS code, run `Test Cypress via NPM`. The `Launch.json` file will trigger the `test` script configured in the `package.json`. -5. Then, type `npm run test` to launch the script via CLI. \ No newline at end of file +2. Open a terminal in your project folder +2. Purge the `node_module` folder ( `rm -rf ./node_modules/`) +3. Run `npm install` to reinstall cypress and it's dependences according to your OS's environment. npm will use the `package.json` to find what to do. +2. Type `npm run test` to launch the script. In VS code, run `Test Cypress via NPM` from the *Run and Debug* tab. The `Launch.json` file will trigger the `test` script configured in the `package.json`. +6. On the cypress GUI, select + * `api` to run test steps against the API, + * `inbox` for some tests against the Inbox website. \ No newline at end of file