**INSTALLING CYPRESS:**

In the root of create-e2e-automation, run:

`npm init -y`

`npm install cypress --save-dev`

This will install Cypress locally as a dev dependency for your project

**OPENING CYPRESS:**

Inside same directory:

`npx cypress open`

This will start the Cypress test runner. Click on a filename to run the test spec inside of chosen Cypress browser.

**NOTE:**

Test specs are currently pointed at a local site

Update baseURL in `cypress.json` to change test site

Include user credentials in `cypress/support/commands.js`

**EXISTING INSTALLS ASSUME:**

[WP Test](http://wptest.io/) data has been imported, including attachments and media files

Create v1.7.x installed & activated

MCP activated & authenticated

At least 1 Create card published in a post before card index specs run

Classic Editor (plugin) is installed and active. Block editor is default and user can switch between the two

Default option of confirm to publish is enabled in Wordpress post editors (is enabled by default)

Create Settings:

* Registration tab has been completed
* Enable JTR Button option has been checked √√
* Enable Social Footer has been checked √√

**CLEAN INSTALLS ASSUME:**

[WP Test](http://wptest.io/) data has been imported, including attachments and media files

Create v1.7.x installed & activated

MCP activated & authenticated

Cards specs should run before Indexes - At least 1 Create card published in a post before card index specs run

Classic Editor (plugin) is installed and active. Block editor is default and user can switch between the two

Default option of confirm to publish is enabled in Wordpress post editors (is enabled by default)

Create Settings:

* (default for all)

**UPDATE THESE CYPRESS FILES:**

baseUrl and viewport set in `cypress.json` :

    {
        "baseUrl": "https://inappropriate-blackbird.jurassic.ninja/wp-admin/",
        "viewportWidth": 1440,
        "viewportHeight": 900
    }

update test spec run order using testFiles config and disable video spec recording in `cypress.json` :
    
    {
    "baseUrl": "https:………../wp-admin/",
    "viewportWidth": 1440,
    "viewportHeight": 900,
    "projectId": "3xvqac",
    "video": false,
    "testFiles": [
      "wpLatest/clean/settingsValidation/**/*",
      "wpLatest/clean/productsValidation/**/*"
    ]
  }

WP authorization in `/support/commands.js`:

    Cypress.Commands.add('login', () => {
      cy.visit('/')
        cy.get('#loginform').within(function() {
          cy.get('#user_login').clear().type('demo', {log:false})
          cy.get('#user_pass').clear().type('Xo0Ln1zhlQ9g', {log:false})
          cy.root().submit()
        })
      cy.url().should('include', '/wp-admin')
    })

WP cookies preserve code in `/support/index.js`:

    Cypress.Cookies.defaults({
        preserve: /wordpress_.*/
    })

    Cypress.on('uncaught:exception', (err, runnable) => {
      return false
    })
