Cypress toolkit for Harvard DCE
npm install dcekyA Cypress-based testing framework by Harvard DCE
It's easy to use ky as your testing framework. To get started, follow these steps:
Install Cypress: npm i --save-dev cypress
Configure Cypress:
1. Use npx cypress open
2. Choose "E2E"
3. On the configuration page, simply click "Continue"
4. When you get to the browser chooser, close Cypress
From this point onward, you won't run cypress directly
Install ky: npm i --save-dev dceky
Set up ky: npm run ky:setup
You'll have a bunch of changes to commit and push. Do that now.
To start running ky tests, use npm run ky:start and follow instructions.
You'll be automatically guided through a launch process where you'll choose whether tests will run visibly or headless, which profile(s) you'll use, and which browser(s) you'll use. You can also set these through environment variables or arguments. See the examples below:
``ts`
// Arguments:
npm run ky:start --headless --browser=Chrome,Safari --profile=Stage
`ts`
// Example environment:
HEADLESS=true
BROWSER=Chrome,Safari
PROFILE=Stage
Whenever you update the version of ky or make changes to supporting project-specific commands or other non-test files, you should run ky:setup.
This will regenerate configuration files, typescript declarations, and other ky resources that keep your project working smoothly.
QA people and CI systems should start tests using npm run ky:start because that ensures that no files, dependencies, or files will be changed on run.
But, developers should run tests using npm run ky:dev` because each time the tests are run, ky is automatically set up again, ensuring that ky files are up-to-date and running smoothly.