Showing posts with label testing. Show all posts
Showing posts with label testing. Show all posts

Friday, October 4, 2019

Cypress - Automation tool

Cypress.io - Automation tool
------------------------------------

How to install cypress: https://docs.cypress.io/guides/getting-started/installing-cypress.html
---------------------------------------------------------------------------------------------------------------
1. install Homebrew (if not already installed)
- ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2. install node:
- brew install node
- brew upgrade node
- check node -v

2. install npm:
- npm is the world's largest Software Library (Registry)
- npm is also a software Package Manager and Installer)
- check if npm is already installed by checking npm -v
- if not, type install npm
- check npm -v

3. install cypress:
- npm install cypress --save-dev

4. install supporting libraries:
- npm install --save-dev @testing-library/dom
- npm install --save-dev @testing-library/react
- npm install --save-dev @testing-library/jest-dom
- npm install --save-dev cypress @testing-library/cypress
- npm install -g eslint
- npm install -g node-modules

More info here:
1. https://github.com/cypress-io/cypress
2. https://docs.cypress.io/guides/getting-started/installing-cypress.html

Cypress FAQ:
-----------------
1. how to open cypress(once installed)
./node_modules/.bin/cypress open
or, npx cypress open (prefer)
or, yarn run cypress open

2. how to create a file
- open terminal and create a file e.g. test1.js inside folder: /Users/rakesh/cypress/integration

3. how to run the above file using cypress - test runner
- in the testrunner, under integration , look for above file(test1.js) and click on it
- it will launch in chrome (url: http://localhost:51636/__/#/tests/integration/test1.js) and
shows the result

4. how to run cypress in headless mode:
https://snipcart.com/blog/frontend-testing-cypress

$ cypress run

5. how to run a js code locally in the terminal:
node file.js

Cypress Pros and Cons:
-----------------------------

Pros:
1. its built for front end/automation developers
2. it uses JS language, which front end webpages are also written in
3. it uses Mocha testing framework

Cons:
1. Cypress does not support cross browser testing:
- latest update: https://github.com/cypress-io/cypress/issues/310
2. Cypress supports only JS

Cypress Best practises:
-----------------------------
1. how to select elements properly:
https://docs.cypress.io/guides/references/best-practices.html#Selecting-Elements

2. assertions:
https://docs.cypress.io/guides/references/assertions.html#Chai

Saturday, June 15, 2013

Automation testing using TestComplete

For more than a year, I've been working on automation of functional testing, regression testing using TestComplete(http://smartbear.com/products/qa-tools/automated-testing-tools). It's a paid automation tool.

It's an little tricky to learn and use but quite similar to Selenium. You can use xpath, record and play to script test cases.

Pros:
- similar to Selenium IDE, you can record and play test scripts
- similar to Selenium RC, you can create test scripts in VBScript, JScript, DelphiScript, C++Script or C#Script. (personally, I liked VBScript)
- Test results logs helps in finding precisely the issue where test failed
- tests can be recorded in keywork driven or screen capture modes
- tests can be created for regression, functional, DDT (data driven testing), ODT(object driven testing), and so on
- can easily do cross-browser testing

Cons:
- automated tests can not be run on Mac OSX
- no support for mobile testing automation (though there is a package  'seetest' which can be integrated with TC)
- it can not read xpath values for browsers other than IE, Firefox, chrome, Safari.

Please read this book on TestComplete(reviewed by me): http://www.packtpub.com/testcomplete-cookbook/book 

Friday, February 17, 2012

Mobile Testing on DeviceAnywhere and Gmail bug

These days I am testing some softwares on mobile phones/tablets/smartphones. I'm using DeviceAnywhere tool for this purpose.  DA is good tool to test softwares on mobile but it has several limitations. Like it has poor keyboard interaction and some keys don't work. Sometimes, you type something and something else gets written on mobile.

Other issue is bad graphics of mobile phones. Sometimes phone screens look blurry. Another issue is trying to navigate to the web browser on mobile phones. There is no step by step process or guide. It assumes you know the phone that you are testing on. This is ridiculous as nobody can know 2500+ models in the US market.

One more issue with DA is slow response time of its website or acquiring any mobile device. Slow response time is also evident during device's interaction.

In short, you got to have lot of patience to play with different devices on DA.

Today, I found a bug in Gmail on mobile phone. Try this:

1. Open gmail in iphone in safari browser with cookies enabled for it
2. Disable cookie in settings for Safari
3. Try logout from gmail, you will see that it does not let you, it takes you back to inbox page.


Tuesday, March 22, 2011

Webdriver - Automated testing tool

Last week, I attended a seminar on Webdriver in Google New York office. It was presented by Simon Stewart on wednesday, March 16th 2011. Webdriver is an automation tool used to test codes written in Java, Python. It does not support PHP, which was a disappointment.

Webdriver is based on Selenium 2 with better GUI and features. More on Selenium at selenium.googlecode.com.

Wednesday, February 2, 2011

PHP NY Unit Testing seminar slides - Jan 25,2011

Check out this SlideShare Presentation:
Clean code
View more presentations from Bulat Shakirzyanov.