2.4 KiB
Lifen Autotest Hangout with Simon Priet
Please find in this project my hangout of your technical test. The test is performed with cypress
, and include cypress-cucumber-preprocessor
. This module process .feature
files (they carry the test case in Gherkin syntax) and find matching .js
files to run them by cypress runner. I initially coded cypress to do the part 2 only, but took time to include the part one as well. Now cypress run the api to generate the communication with the document, then connect the user to send the mail.
Currently, cypress is still challenged with a SMS code, and I have not implemented a workaround. Cypress wait 20 for me 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
🌐 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
🌐 is a mail and text provider that can help us read texts content sent by the server to a predefined phone number, and work around the text code challenge.
Please note the existance of a 'pure cypress' branch on this repo that doesn't rely on BDD.
Installation
The code has been written with VSC in mind, on a Windows 10 machine, so a launch.json
configuration file is available to help run and debug the software. No helpers are available for other IDE.
- Clone the repo to your local computer. You will need the following requierement:
- Node.js 16
- Git
- Open a terminal in your project folder
- Purge the
node_module
folder (rm -rf ./node_modules/
) - Run
npm install
to reinstall cypress and it's dependences according to your OS's environment. npm will use thepackage.json
to find what to do. - Type
npm run test
to launch the script. In VS code, runTest Cypress via NPM
from the Run and Debug tab. TheLaunch.json
file will trigger thetest
script configured in thepackage.json
. - On the cypress GUI, select
sendDocument
for the throughout test, andinbox
for some subtests in the Inbox website.