Skip to main content

Cypress UI Automation - part 1

Java to Cypress-JavaScript Automation Migration

Introduction:

Across Cancer Research UK engineering department, we currently use a Java automation framework for our User interface and API testing. The framework has evolved in the last 3 to 4 years and currently, we have 19 products/project, (running approximately 1350 test scenarios) using the framework to run the respective sanity/regression packs. The project/products extend across different technology stacks such as Drupal, Symphony, React JS, .Net, OBI and Siebel CRM. 

The Quality Assurance (QA) test team are currently under the process to be transformed into a fully-fledged Quality Assurance function.  As part of this transformation, we would like to have a comprehensive, automated test suite that can be maintained by developers and testers. Furthermore, our front-end web development is moving into JavaScript, now is the right time to migrate our automation framework also from java into JavaScript.

The introduction shows why there was a need to implement this project and the business benefit to the organisation.

Range of Test Automation Tools



Screenshot from (https://medium.com/@briananderson2209/best-automation-testing-tools-for-2018-top-10-reviews-8a4a19f664d2).

In the above screenshot, you will notice that Selenium is rated high and very popular, however, it requires a high advance testing skills to install and make use off. It can be very daunting getting started on selenium, however, it’s very popular for being the first automation tool testers chooses to test. It also has wide support available for free to help from.

How to Perform an automation Test

In order to perform an automation test, one must do thorough research on the best automation tools available. Think about the cost and if it’s an open-source, what sort of support is available. One must also know the language to perform the automation, for example, Java, JavaScript, python etc. One must also consider the benefit of such a tool, is it open source, can other tools be integrated and how easy it is to set-up and get started.

Once all these factors have been considered, then the tool can be downloaded and installed. During test script design, one must apply the best automation Testing practice and tips –

  • ·        Testing must start early.
  • ·        Test more often- regression testing.
  • ·        Decide what test cases to automation (some test cases are best left as manual testing).
  • ·        Create good quality test data
  • ·        Create tests that are resistant to changes in the User Interface(sometimes, elements and test data are updated and changed, causing errors within the automation code. Fixing this can be costly).
  • The plan to enable Quality Assurance(QA) and Developers to collaborate more so we can build and run more tests on each commit, focus on more  API automation testing,  shift left testing, develop the QA  team to have more cross-skilled testers. 
  • This shows my understanding of this project and the business value to the organisation.

Why a new Framework:

Currently, the maintenance, execution of automation regression takes too much of our time. Also, because some parts of the framework were developed by a third party, some QAs had difficulty understanding the flow or structure.

Why Cypress?

Before we chose cypress, we researched other possible frameworks:

 




 We chose cypress for the reasons below, the main point is how easy it is to set-up and starts coding, the JavaScript language making it easy for both the Quality Assurance(QA) department and Developers to work and collaborate, and it’s really fast. Cypress is also a developers testing tool so it would make it so easy for the QA and Developers team to collaborate. 




The Benefits of Software Automation Tools

  • ·        Test Automation tools, if used as documented, are more reliable and consistent than human software testers.
  • ·        Human testers may grow tired carrying out manual tests over time, while test automation does not weary out.
  • ·        Suitable for repetitive tests steps with different data sets.
  • ·        Automation test scripts are reusable.
  • ·        Generates detailed tests results with metrics.
  • ·        Comprehensive testing (covering all functional points) is possible.
  • ·        Manual testing all scenarios with positives and negatives can be time-consuming.
  • ·        However, automating testing can be cost-effective, improves flexibility without the intervention of human beings improve the speed of execution time.

Risks of Software Automation Tools.

·        Unrealistic expectations from the tools

·        Automation tools incompatibility with the organisation’s test environments and other software testing tools.

·        If automation tool is expensive then it can have an impact on the project budget.

·        Vendors inability to provide technical support.

·        If a Vendor goes into liquidation.


About this Project.

Project Brief

The purpose of this project is to document the process I went through to convert the e-commerce website’s java automation into JavaScript using Cypress.

We were required as testers to create Jira tickets for each test basis or feature files from the test basis. We began coding by pulling the main developer repository from our GitHub (version control), then created new branches from the main branch, with a reference to the Jira tickets. Each code was required to go through code review before it was accepted to be merged into the main Develop branch. By following this name convention, I know I am doing my job well. 

Test Plan

Find more details of the Test Plan here.



Find part 1b here.
















 

Comments

Popular posts from this blog

Working with Dropdownbox elements in Selenium WebDriver

How to select element from a Dropbox We are going to use Selenium webDriver and chrome driver to test this. In addition, this test was created on Mac.  I assume you have installed and setup java in your system path.  Also, install Eclipse for jee. 1. First let's take a look at a quick test case: Test case: TC_1. Register on http://automationpractice.com/index.php TC_1.1: Launch hope page -http://automationpractice.com/index.php TC_1.2 : Click on link ‘Sign in’ TC_1.3 : Under “Create Account” subheading, enter Email address in ‘Email address’ textfield TC_1.4 : Click on ‘Create an account’ button. —————————————————————————————— Test data: Email address: gorgeous12@hotmail.com http://automationpractice.com/index.php ---------------------------------------------------------------- Expected : http://automationpractice.com/index.php?controller=my-account ———————————------------ 2. Next, create a maven project in Eclipse 3....

Performance Testing

  Performance Testing As part of the Quality Assurance Test Approach, each tester has to implement performance testing within its product team. In this section of the project, I will be using Apache JMeter as the testing tool for the test approach. Apache JMeter is an open-source performance testing tool for load, stress and many more testing. Screenshot from: https://www.youtube.com/watch?v=817zU_bXh9Y&list=PLUDwpEzHYYLs33uFHeIJo-6eU92IoiMZ7 JMeter works by creating a request to a target server(website), the server then responds, saves responses, collects, calculate statistics, return results to request and then generate reports.