Skip to content

Latest commit

 

History

History
134 lines (103 loc) · 5.02 KB

README.md

File metadata and controls

134 lines (103 loc) · 5.02 KB

dm_tests

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

The Percy Project for dev.dailymaverick.co.za

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

cookies

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

npm install installs script in package.json

Config Files

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

Generally to run all tests

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

Cypress

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

Visual Tests

npm install
npx eyes-setup

check the apiKey is set properly npm run cypress:f

Applitools Example: Cypress JavaScript with the Ultrafast Grid

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:

To run this example project, you'll need:

  1. An Applitools account, which you can register for free
  2. Node.js version 16 or higher
  3. A good JavaScript editor like Visual Studio Code
  4. 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!

GPG secrets for github

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/

Useful links :

##Notes Testing Websites – The Best Devices and Browsers https://weareama.com/testing-websites-best-devices-browsers/