This repository is a collection of CypressIO examples. It will provide copy-and-paste commands and snippets to use agnostically with any installation of CypressIO.
What is CypressIO? Take a gander through their site, specifically their how it works section. CypressIO is an integration test framework. It is different from other frameworks in that it gives developers and quality engineers tools needed to debug and create BDD-style tests seamlessly.
It uses an Electron (Chrome) browser, either headless or headed. Using Mocha-style code, you describe
your feature in a number of it
clauses. After adding a spec that uses their API, some of which is unique and highly programmable, like get()
and should()
, use either the CLI or GUI to run your tests.
The benefits of choosing this framework are also available on their site, just incase, here they are:
- Sans-selenium. In an age where Selenium WebDriver is implemented poorly due to ever changing webkit technology, CypressIO uses its own driver to work around the problem and offer more to the developer and test engineer.
- End-to-end. This framework was designed with e2e and integration in mind. From the programmability of their API, to their robust driver, end-to-end testing never became more scaleable.
- Front-end or Back-end. Doesn't matter if you're testing front-end or back-end functionality, this framework can do it all.
- JS FTW. This framework leverages the modularization and object-oriented traits of JavaScript.
- Single installation. Aside from NodeJS and NPM, you only need to run one command line. That's refreshing!
- Developers in mind. This framework was made for developers and quality engineers alike, poke around and you'll see what I mean.
- Lightning-speed. Electron and JavaScript, need I say more? As fast as PhantomJS, as debuggable as Chrome.
- Reusable commands
visitBaseUrl
fillInForm
-
visitBaseUrl
: Visits using the configuration JSON in project root. UsesassertBaseUrl
to assert page is visited.-
hardReset
: Resets the entire browser and its cache. -
assertBaseUrl
: Asserts a traversed element module that represents the base URL. See baseUrl.js. - Wiki documentation for
visitBaseUrl
,assertBaseUrl
andhardReset
-
-
fillInForm
: Parameterized command that fills in form withid
,values
,submit
.submit
is a boolean that submits the form upon filling.
The tests are executed from the command line. Fire up terminal, and navigate to the project root.
git clone --recurse-submodules https://github.com/sajjadhossain/cypressio-examples.git
npm install
./node_modules/.bin/cypress install
npm run serve
npm run test