cypress-automation-learning

View on GitHub

Cypress Automation

Cypress automation of web3/dapps using the Synpress that allows us to test metamask login, authentication and interaction with smart contracts.

What is Synpress?

Synpress is a wrapper around Cypress and also extending it with the help of Puppeteer . Resulting in custom commands which allow you to interact with MetaMask.

How does it work?

It runs a global cypress before routine, that installs a MetaMask plugin, and configures it.

So remember:

Synpress allows us to test metamask login, authentication and interaction with smart contracts.

Synpress Setting up:

First setup Cypress

Now setup Synpress

Note: The env-cmd package installs an executable script named env-cmd which can be called before your scripts to easily load environment variables from an external file.

Add .env file

Add synpress.json file

Run the test

Important things to Remember:

How to use X-Path in Cypress:

Install cypress-xpath:

Usage:

Beware the XPath // trap:

What is XPath:

Absolute XPath

Relative XPath

How to verify xpath in browser console?