a repo to hold the DM tests.
npm run cypress:open
//the dev env
npm run cypress:open_local
npm run cypress:open_internal
npm run cypress:internal_delete_subscriber
npm run cypress:delete_subscriber
npm run cypress:set_otp_subscriber
percy.io
open up the terminal. get token from https://percy.io/9f297d8f/https-dev.dailymaverick.co.za-/settings
export PERCY_TOKEN=<your token here>
npm run cypress:percy
The admin logins work on setting cookies to bypass the login process and cloud flair authentication -
these cookies should not be check into the repo.
var cookieData = document.cookie.split(';').map(function(c) { var i = c.indexOf('='); return [c.substring(0, i), c.substring(i + 1)]; }); copy(JSON.stringify(JSON.stringify(cookieData)));
//copies the cookies to clipboard
npm install
installs script in package.json
These can we found here: https://drive.google.com/drive/folders/1SxmL6_x5IvZfCJveh75JTFy5kpe8Y6Xl?usp=sharing
or
Take a copy of the env vars in cypress.config.js and create a corresponding json file to adjust for the local env
i.e. make the new file: touch internal.cypress.config.js
npm run cypress:f
this refers to a script in package.json using the local config file.
or
$(npm bin)/cypress open --config-file dev.cypress.config.js
the configuration fie is for the git hub actions using secrets
$(npm bin)/cypress open
or npx cypress open
and test as per https://docs.cypress.io/guides/end-to-end-testing/testing-your-app
By default we use the dev environment to test off.
Pointing to a internal configuration file
$(npm bin)/cypress open --config-file internal.cypress.config.js
Pointing to a local configuration file $(npm bin)/cypress open --config-file local.cypress.config.js
E2E and chrome
npm install
npx eyes-setup
check the apiKey is set properly
npm run cypress:f
This is the example project for the Cypress JavaScript tutorial. It shows how to start automating visual tests with Applitools Eyes and the Ultrafast Grid using Cypress in JavaScript.
It uses:
- JavaScript as the programming language
- Cypress 10 for browser automation
- Google Chrome as the local browser for testing
- npm for dependency management
- Applitools Eyes for visual testing
- Applitools Ultrafast Grid for cross-browser execution
To run this example project, you'll need:
- An Applitools account, which you can register for free
- Node.js version 16 or higher
- A good JavaScript editor like Visual Studio Code
- Up-to-date versions of the following browsers:
To install project dependencies and set up Applitools Eyes, run:
npm install
npx eyes-setup
The Applitools config file is applitools.config.js
.
To execute tests, set the APPLITOOLS_API_KEY
environment variable
to your account's API key.
Then, to open the Cypress window for launching tests, run:
npx cypress open
If you want to run tests directly from the command line, run this instead:
npx cypress run
For full instructions on running this project, take our Cypress JavaScript tutorial!
https://www.gab.lc/articles/encrypt_file_for_github_actions/ download an install the GPG suite gpg --symmetric --cipher-algo AES256 adminUserLoginCookiesFromCypress.json
##Use env encrypted secrets & config https://docs.github.com/en/actions/security-guides/encrypted-secrets https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsenv To set up I used this example : https://applitools.com/blog/link-github-actions/
- https://www.stevenhicks.me/blog/2020/02/working-with-variables-in-cypress-tests/
- https://filiphric.com/switch-between-environments-in-cypress
##Notes Testing Websites – The Best Devices and Browsers https://weareama.com/testing-websites-best-devices-browsers/